34template<
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]);
82template<
class Type,
class FileOp>
94 Pout<<
"masterUncollatedFileOperation : Operation on src:" << src
95 <<
" dest:" << dest <<
endl;
103 List<Pair<fileName>> filePaths(numProc);
104 filePaths[myProci].first() = src;
105 filePaths[myProci].second() = dest;
114 result.resize(numProc);
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);
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void resize(const label len)
Adjust allocated size of list.
static T listScatterValues(const UList< T > &allValues, const int communicator=UPstream::worldComm, const int tag=UPstream::msgType())
Scatter individual values from list locations.
T & first()
Access first element of the list, position [0].
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Negative if the process is not a...
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
static bool is_parallel(const label communicator=worldComm)
True if parallel algorithm or exchange is required.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator). It is 1 for serial run.
@ gatherList
gatherList [manual algorithm]
A class for handling file names.
label comm() const noexcept
Communicator to use.
Type masterOp(const fileName &fName, const FileOp &fop, const int tag, const label comm) const
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.