40 PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking, tag, comm);
41 if (Pstream::master(comm))
43 for (
label proci = 1; proci < Pstream::nProcs(comm); proci++)
46 os << masterLst[proci];
53 if (Pstream::master(comm))
55 myResult = masterLst[Pstream::myProcNo(comm)];
66 template<
class Type,
class fileOp>
77 Pout<<
"masterUncollatedFileOperation::masterOp : Operation " 78 <<
typeid(fileOp).
name()
79 <<
" on " << fName <<
endl;
81 if (Pstream::parRun())
84 filePaths[Pstream::myProcNo(comm)] = fName;
85 Pstream::gatherList(filePaths, tag, comm);
88 if (Pstream::master(comm))
90 result = fop(filePaths[0]);
91 for (
label i = 1; i < filePaths.
size(); i++)
93 if (filePaths[i] != filePaths[0])
95 result[i] = fop(filePaths[i]);
100 return scatterList(result, tag, comm);
109 template<
class Type,
class fileOp>
121 Pout<<
"masterUncollatedFileOperation : Operation on src:" << src
122 <<
" dest:" << dest <<
endl;
124 if (Pstream::parRun())
127 srcs[Pstream::myProcNo(comm)] = src;
128 Pstream::gatherList(srcs, tag, comm);
131 dests[Pstream::myProcNo(comm)] = dest;
132 Pstream::gatherList(dests, tag, comm);
135 if (Pstream::master(comm))
137 result = fop(srcs[0], dests[0]);
140 if (srcs[i] != srcs[0])
142 result[i] = fop(srcs[i], dests[i]);
147 return scatterList(result, tag, comm);
151 return fop(src, dest);
A class for handling file names.
void finishedSends(const bool block=true)
Mark all sends as having been done. This will start receives.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Input inter-processor communications stream operating on external buffer.
Type scatterList(const UList< Type > &, const int, const label comm) const
Type masterOp(const fileName &, const fileOp &fop, const int tag, const label comm) const
Output inter-processor communications stream operating on external buffer.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
word name(const complex &)
Return a string representation of a complex.
prefixOSstream Pout(cout, "Pout")