43 PstreamBuffers pBufs(UPstream::commsTypes::nonBlocking, tag, comm);
44 if (Pstream::master(comm))
46 for (
const int proci : Pstream::subProcs(comm))
49 os << masterLst[proci];
56 if (Pstream::master(comm))
58 myResult = masterLst[Pstream::myProcNo(comm)];
69 template<
class Type,
class fileOp>
80 Pout<<
"masterUncollatedFileOperation::masterOp : Operation "
81 <<
typeid(fileOp).
name()
82 <<
" on " << fName <<
endl;
84 if (Pstream::parRun())
87 filePaths[Pstream::myProcNo(comm)] = fName;
88 Pstream::gatherList(filePaths, tag, comm);
91 if (Pstream::master(comm))
93 result = fop(filePaths[0]);
94 for (label i = 1; i < filePaths.size(); i++)
96 if (filePaths[i] != filePaths[0])
98 result[i] = fop(filePaths[i]);
103 return scatterList(result, tag, comm);
112 template<
class Type,
class fileOp>
124 Pout<<
"masterUncollatedFileOperation : Operation on src:" << src
125 <<
" dest:" << dest <<
endl;
127 if (Pstream::parRun())
130 srcs[Pstream::myProcNo(comm)] = src;
131 Pstream::gatherList(srcs, tag, comm);
134 dests[Pstream::myProcNo(comm)] = dest;
135 Pstream::gatherList(dests, tag, comm);
138 if (Pstream::master(comm))
140 result = fop(srcs[0], dests[0]);
141 for (label i = 1; i < srcs.size(); i++)
143 if (srcs[i] != srcs[0])
145 result[i] = fop(srcs[i], dests[i]);
150 return scatterList(result, tag, comm);
154 return fop(src, dest);