34 template<
class Type,
class FileOp>
45 Pout<<
"masterUncollatedFileOperation::masterOp : Operation " 46 <<
typeid(FileOp).
name()
47 <<
" on " << fName <<
endl;
56 filePaths[myProci] = fName;
64 result = fop(filePaths[0]);
66 for (label i = 1; i < numProc; ++i)
68 if (filePaths[i] != filePaths[0])
70 result[i] = fop(filePaths[i]);
82 template<
class Type,
class FileOp>
94 Pout<<
"masterUncollatedFileOperation : Operation on src:" << src
95 <<
" dest:" << dest <<
endl;
104 filePaths[myProci].first() = src;
105 filePaths[myProci].second() = dest;
115 result = fop(filePaths[0].first(), filePaths[0].second());
117 for (label i = 1; i < numProc; ++i)
120 if (filePaths[i].first() != filePaths[0].first())
123 fop(filePaths[i].first(), filePaths[i].second());
131 return fop(src, dest);
static T listScatterValues(const UList< T > &allValues, const label comm=UPstream::worldComm, const int tag=UPstream::msgType())
Scatter individual values from list locations.
A class for handling file names.
void resize(const label len)
Adjust allocated size of list.
Type masterOp(const fileName &fName, const FileOp &fop, const int tag, const label comm) const
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void gatherList(const UList< commsStruct > &comms, UList< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run. ...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
static bool is_parallel(const label communicator=worldComm)
True if parallel algorithm or exchange is required.
int debug
Static debugging option.
label comm() const noexcept
Communicator to use.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.