42 if (Pstream::myProcNo(comm) == procIDs[0])
49 if (commsType == Pstream::scheduled || commsType == Pstream::blocking)
51 for (
label i = 1; i < procIDs.
size(); i++)
55 if (contiguous<Type>())
61 reinterpret_cast<char*>(procSlot.
begin()),
77 fromSlave >> procSlot;
85 if (!contiguous<Type>())
88 <<
"nonBlocking not supported for non-contiguous data" 92 label startOfRequests = Pstream::nRequests();
95 for (
label i = 1; i < procIDs.
size(); i++)
103 reinterpret_cast<char*>(procSlot.
begin()),
111 Pstream::waitRequests(startOfRequests);
116 if (commsType == Pstream::scheduled || commsType == Pstream::blocking)
118 if (contiguous<Type>())
124 reinterpret_cast<const char*>(fld.
begin()),
147 if (!contiguous<Type>())
150 <<
"nonBlocking not supported for non-contiguous data" 154 label startOfRequests = Pstream::nRequests();
161 reinterpret_cast<const char*>(fld.
begin()),
168 Pstream::waitRequests(startOfRequests);
187 gather(off, comm, procIDs, fld, allFld, tag, commsType);
189 if (Pstream::myProcNo(comm) == procIDs[0])
208 if (Pstream::myProcNo(comm) == procIDs[0])
212 if (commsType == Pstream::scheduled || commsType == Pstream::blocking)
214 for (
label i = 1; i < procIDs.
size(); i++)
223 if (contiguous<Type>())
229 reinterpret_cast<const char*>(procSlot.
begin()),
253 if (!contiguous<Type>())
256 <<
"nonBlocking not supported for non-contiguous data" 260 label startOfRequests = Pstream::nRequests();
263 for (
label i = 1; i < procIDs.
size(); i++)
276 reinterpret_cast<const char*>(procSlot.
begin()),
284 Pstream::waitRequests(startOfRequests);
289 if (commsType == Pstream::scheduled || commsType == Pstream::blocking)
291 if (contiguous<Type>())
297 reinterpret_cast<char*>(fld.
begin()),
320 if (!contiguous<Type>())
323 <<
"nonBlocking not supported for non-contiguous data" 327 label startOfRequests = Pstream::nRequests();
334 reinterpret_cast<char*>(fld.
begin()),
341 Pstream::waitRequests(startOfRequests);
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static void scatter(const labelUList &offsets, const label comm, const labelList &procIDs, const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes commsType=Pstream::nonBlocking)
Distribute data in processor order. Requires fld to be sized!
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gather(const labelUList &offsets, const label comm, const labelList &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes commsType=Pstream::nonBlocking)
Collect data in processor order on master (== procIDs[0]).
commsTypes
Types of communications.
void size(const label)
Override size to be inconsistent with allocated storage.
void deepCopy(const UList< T > &)
Copy elements of the given UList.
Input inter-processor communications stream.
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
bool read(const char *, int32_t &)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
iterator begin()
Return an iterator to begin traversing the UList.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Output inter-processor communications stream.
label size() const
Return the number of elements in the UList.
void setSize(const label)
Reset size of List.
T & last()
Return the last element of the list.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.