46 template<
class T,
class CombineOp>
56 if (UPstream::parRun() && UPstream::nProcs(comm) > 1)
59 const commsStruct& myComm = comms[UPstream::myProcNo(comm)];
64 label belowID = myComm.
below()[belowI];
71 UPstream::commsTypes::scheduled,
73 reinterpret_cast<char*
>(&value),
81 Pout<<
" received from "
82 << belowID <<
" data:" << value <<
endl;
91 UPstream::commsTypes::scheduled,
101 Pout<<
" received from "
102 << belowID <<
" data:" << value <<
endl;
110 if (myComm.
above() != -1)
115 <<
" data:" << Value <<
endl;
122 UPstream::commsTypes::scheduled,
124 reinterpret_cast<const char*
>(&Value),
134 UPstream::commsTypes::scheduled,
147 template<
class T,
class CombineOp>
151 const CombineOp& cop,
156 if (UPstream::nProcs(comm) < UPstream::nProcsSimpleSum)
160 UPstream::linearCommunication(comm),
171 UPstream::treeCommunication(comm),
190 if (UPstream::parRun() && UPstream::nProcs(comm) > 1)
196 if (myComm.
above() != -1)
202 UPstream::commsTypes::scheduled,
204 reinterpret_cast<char*
>(&Value),
214 UPstream::commsTypes::scheduled,
220 Value =
T(fromAbove);
225 Pout<<
" received from "
226 << myComm.
above() <<
" data:" << Value <<
endl;
233 label belowID = myComm.
below()[belowI];
237 Pout<<
" sending to " << belowID <<
" data:" << Value <<
endl;
244 UPstream::commsTypes::scheduled,
246 reinterpret_cast<const char*
>(&Value),
256 UPstream::commsTypes::scheduled,
277 if (UPstream::nProcs(comm) < UPstream::nProcsSimpleSum)
279 combineScatter(UPstream::linearCommunication(comm), Value, tag, comm);
283 combineScatter(UPstream::treeCommunication(comm), Value, tag, comm);
288 template<
class T,
class CombineOp>
293 const CombineOp& cop,
298 if (UPstream::parRun() && UPstream::nProcs(comm) > 1)
301 const commsStruct& myComm = comms[UPstream::myProcNo(comm)];
306 label belowID = myComm.
below()[belowI];
310 List<T> receivedValues(Values.size());
314 UPstream::commsTypes::scheduled,
316 receivedValues.data_bytes(),
317 receivedValues.size_bytes(),
324 Pout<<
" received from "
325 << belowID <<
" data:" << receivedValues <<
endl;
330 cop(Values[i], receivedValues[i]);
337 UPstream::commsTypes::scheduled,
343 List<T> receivedValues(fromBelow);
347 Pout<<
" received from "
348 << belowID <<
" data:" << receivedValues <<
endl;
353 cop(Values[i], receivedValues[i]);
359 if (myComm.
above() != -1)
364 <<
" data:" << Values <<
endl;
371 UPstream::commsTypes::scheduled,
373 Values.cdata_bytes(),
383 UPstream::commsTypes::scheduled,
396 template<
class T,
class CombineOp>
400 const CombineOp& cop,
405 if (UPstream::nProcs(comm) < UPstream::nProcsSimpleSum)
409 UPstream::linearCommunication(comm),
420 UPstream::treeCommunication(comm),
439 if (UPstream::parRun() && UPstream::nProcs(comm) > 1)
445 if (myComm.
above() != -1)
451 UPstream::commsTypes::scheduled,
463 UPstream::commsTypes::scheduled,
474 Pout<<
" received from "
475 << myComm.
above() <<
" data:" << Values <<
endl;
482 label belowID = myComm.
below()[belowI];
486 Pout<<
" sending to " << belowID <<
" data:" << Values <<
endl;
493 UPstream::commsTypes::scheduled,
495 Values.cdata_bytes(),
505 UPstream::commsTypes::scheduled,
526 if (UPstream::nProcs(comm) < UPstream::nProcsSimpleSum)
530 UPstream::linearCommunication(comm),
540 UPstream::treeCommunication(comm),
549 template<
class Container,
class CombineOp>
554 const CombineOp& cop,
559 if (UPstream::parRun() && UPstream::nProcs(comm) > 1)
562 const commsStruct& myComm = comms[UPstream::myProcNo(comm)];
567 label belowID = myComm.
below()[belowI];
571 UPstream::commsTypes::scheduled,
577 Container receivedValues(fromBelow);
581 Pout<<
" received from "
582 << belowID <<
" data:" << receivedValues <<
endl;
587 typename Container::const_iterator slaveIter =
588 receivedValues.begin();
589 slaveIter != receivedValues.end();
593 typename Container::iterator
594 masterIter = Values.find(slaveIter.key());
596 if (masterIter != Values.end())
598 cop(masterIter(), slaveIter());
602 Values.insert(slaveIter.key(), slaveIter());
608 if (myComm.
above() != -1)
613 <<
" data:" << Values <<
endl;
618 UPstream::commsTypes::scheduled,
630 template<
class Container,
class CombineOp>
634 const CombineOp& cop,
639 if (UPstream::nProcs(comm) < UPstream::nProcsSimpleSum)
643 UPstream::linearCommunication(comm),
654 UPstream::treeCommunication(comm),
664 template<
class Container>
673 if (UPstream::parRun() && UPstream::nProcs(comm) > 1)
679 if (myComm.
above() != -1)
683 UPstream::commsTypes::scheduled,
693 Pout<<
" received from "
694 << myComm.
above() <<
" data:" << Values <<
endl;
701 label belowID = myComm.
below()[belowI];
705 Pout<<
" sending to " << belowID <<
" data:" << Values <<
endl;
710 UPstream::commsTypes::scheduled,
722 template<
class Container>
730 if (UPstream::nProcs(comm) < UPstream::nProcsSimpleSum)
734 UPstream::linearCommunication(comm),
744 UPstream::treeCommunication(comm),