Version of collatedFileOperation with multiple read/write ranks. More...
Public Member Functions | |
TypeName ("hostCollated") | |
hostCollatedFileOperation (const bool verbose) | |
virtual | ~hostCollatedFileOperation () |
![]() | |
TypeName ("collated") | |
collatedFileOperation (bool verbose) | |
collatedFileOperation (const label comm, const labelList &ioRanks, const word &typeName, bool verbose) | |
virtual | ~collatedFileOperation () |
virtual fileName | objectPath (const IOobject &io, const word &typeName) const |
virtual bool | writeObject (const regIOobject &, IOstreamOption streamOpt=IOstreamOption(), const bool valid=true) const |
virtual void | flush () const |
virtual word | processorsDir (const IOobject &) const |
virtual word | processorsDir (const fileName &) const |
virtual void | setNProcs (const label nProcs) |
![]() | |
TypeName ("masterUncollated") | |
masterUncollatedFileOperation (bool verbose) | |
masterUncollatedFileOperation (const label comm, bool verbose) | |
virtual | ~masterUncollatedFileOperation () |
virtual bool | mkDir (const fileName &, mode_t=0777) const |
virtual bool | chMod (const fileName &, const mode_t) const |
virtual mode_t | mode (const fileName &, const bool followLink=true) const |
virtual fileName::Type | type (const fileName &, const bool followLink=true) const |
virtual bool | exists (const fileName &, const bool checkGzip=true, const bool followLink=true) const |
virtual bool | isDir (const fileName &, const bool followLink=true) const |
virtual bool | isFile (const fileName &, const bool checkGzip=true, const bool followLink=true) const |
virtual off_t | fileSize (const fileName &, const bool followLink=true) const |
virtual time_t | lastModified (const fileName &, const bool followLink=true) const |
virtual double | highResLastModified (const fileName &, const bool followLink=true) const |
virtual fileNameList | readDir (const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true, const bool followLink=true) const |
virtual bool | cp (const fileName &src, const fileName &dst, const bool followLink=true) const |
virtual bool | ln (const fileName &src, const fileName &dst) const |
virtual bool | mv (const fileName &src, const fileName &dst, const bool followLink=false) const |
virtual bool | mvBak (const fileName &, const std::string &ext="bak") const |
virtual bool | rm (const fileName &) const |
virtual bool | rmDir (const fileName &dir, const bool silent=false) const |
virtual fileName | filePath (const bool checkGlobal, const IOobject &io, const word &typeName, const bool search) const |
virtual fileName | dirPath (const bool checkGlobal, const IOobject &io, const bool search) const |
virtual fileNameList | readObjects (const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const |
virtual bool | readHeader (IOobject &, const fileName &, const word &typeName) const |
virtual autoPtr< ISstream > | readStream (regIOobject &, const fileName &, const word &typeName, const bool valid=true) const |
virtual bool | read (regIOobject &, const bool masterOnly, const IOstreamOption::streamFormat format, const word &typeName) const |
virtual autoPtr< ISstream > | NewIFstream (const fileName &) const |
virtual autoPtr< OSstream > | NewOFstream (const fileName &pathname, IOstreamOption streamOpt=IOstreamOption(), const bool valid=true) const |
virtual label | addWatch (const fileName &) const |
virtual bool | removeWatch (const label) const |
virtual label | findWatch (const labelList &watchIndices, const fileName &) const |
virtual void | addWatches (regIOobject &, const fileNameList &) const |
virtual fileName | getFile (const label) const |
virtual void | updateStates (const bool masterOnly, const bool syncPar) const |
virtual fileMonitor::fileState | getState (const label) const |
virtual void | setUnmodified (const label) const |
virtual instantList | findTimes (const fileName &, const word &) const |
virtual IOobject | findInstance (const IOobject &io, const scalar startValue, const word &stopInstance) const |
virtual void | setTime (const Time &) const |
const HashPtrTable< instantList > & | times () const |
![]() | |
TypeName ("fileOperation") | |
fileOperation (const label comm, const bool distributedRoots=false) | |
declareRunTimeSelectionTable (autoPtr, fileOperation, word,(bool verbose),(verbose)) | |
virtual | ~fileOperation ()=default |
bool | distributed () const noexcept |
bool | distributed (bool on) const noexcept |
virtual fileName | filePath (const fileName &) const |
virtual label | nProcs (const fileName &dir, const fileName &local="") const |
fileName | processorsCasePath (const IOobject &, const word &procDir) const |
fileName | processorsPath (const IOobject &, const word &instance, const word &procDir) const |
fileName | processorsPath (const fileName &, const word &procDir) const |
Additional Inherited Members | |
![]() | |
enum | pathType : int { NOTFOUND = 0, ABSOLUTE, OBJECT, WRITEOBJECT, PROCUNCOLLATED, PROCBASEOBJECT = PROCUNCOLLATED + 1, PROCOBJECT = PROCBASEOBJECT + 1, PARENTOBJECT, FINDINSTANCE, PROCUNCOLLATEDINSTANCE, PROCBASEINSTANCE, PROCINSTANCE } |
typedef Tuple2< fileName, Tuple2< pathType, int > > | dirIndex |
typedef List< dirIndex > | dirIndexList |
typedef IntRange< int > | procRangeType |
![]() | |
static bool | uniformFile (const fileNameList &) |
![]() | |
static autoPtr< fileOperation > | NewUncollated () |
static autoPtr< fileOperation > | New (const word &handlerType, bool verbose=false) |
static instantList | sortTimes (const fileNameList &dirEntries, const word &constantName="constant") |
static label | splitProcessorPath (const fileName &objectPath, fileName &path, fileName &procDir, fileName &local, procRangeType &group, label &nProcs) |
static label | detectProcessorPath (const fileName &objPath) |
![]() | |
static float | maxThreadFileBufferSize |
![]() | |
static float | maxMasterFileBufferSize |
![]() | |
static const Enum< pathType > | pathTypeNames_ |
static word | processorsBaseDir = "processors" |
static word | defaultFileHandler |
static autoPtr< fileOperation > | fileHandlerPtr_ |
![]() | |
void | printBanner (const bool printRanks=false) const |
bool | isMasterRank (const label proci) const |
bool | appendObject (const regIOobject &io, const fileName &pathName, IOstreamOption streamOpt) const |
![]() | |
template<class Type > | |
Type | scatterList (const UList< Type > &, const int, const label comm) const |
template<class Type , class fileOp > | |
Type | masterOp (const fileName &, const fileOp &fop, const int tag, const label comm) const |
template<class Type , class fileOp > | |
Type | masterOp (const fileName &, const fileName &, const fileOp &fop, const int tag, const label comm) const |
virtual fileName | filePathInfo (const bool checkGlobal, const bool isFile, const IOobject &, const bool search, pathType &searchType, word &processorsDir, word &instance) const |
fileName | localObjectPath (const IOobject &, const pathType &searchType, const word &processorsDir, const word &instancePath) const |
bool | exists (const dirIndexList &, IOobject &io) const |
![]() | |
fileMonitor & | monitor () const |
refPtr< dirIndexList > | lookupAndCacheProcessorsPath (const fileName &objectPath, const bool syncPar) const |
virtual refPtr< dirIndexList > | lookupProcessorsPath (const fileName &objectPath) const |
bool | exists (IOobject &io) const |
![]() | |
static labelList | subRanks (const label n) |
static word | findInstancePath (const instantList &timeDirs, const instant &t) |
static void | readAndSend (const fileName &filePath, const labelUList &procs, PstreamBuffers &pBufs) |
static autoPtr< ISstream > | read (IOobject &io, const label comm, const bool uniform, const fileNameList &filePaths, const boolList &procValid) |
![]() | |
static labelList | ioRanks () |
static void | mergeTimes (const instantList &extraTimes, const word &constantName, instantList ×) |
static bool | isFileOrDir (const bool isFile, const fileName &) |
![]() | |
const label | myComm_ |
OFstreamCollator | writer_ |
label | nProcs_ |
const labelList | ioRanks_ |
![]() | |
const label | myComm_ |
HashPtrTable< instantList > | times_ |
![]() | |
const label | comm_ |
bool | distributed_ |
HashTable< dirIndexList > | procsDirs_ |
autoPtr< fileMonitor > | monitorPtr_ |
Version of collatedFileOperation with multiple read/write ranks.
In parallel it will assume ranks are sorted according to hostname and the lowest rank per hostname will be the IO rank. The output directories will get a unique name processors<N>_<low>-<high> where N is the overall number of processors and low and high is the range of ranks contained in the files. Each of these subsets uses its own communicator.
Instead of using the hostnames the IO ranks can be assigned using the FOAM_IORANKS environment variable (also when running non-parallel), e.g. when decomposing into 4:
FOAM_IORANKS='(0 2)' decomposePar -fileHandler hostCollated
will generate
processors4_0-1/ containing data for processors 0 to 1 processors4_2-3/ containing data for processors 2 to 3
Definition at line 71 of file hostCollatedFileOperation.H.
|
explicit |
Definition at line 121 of file hostCollatedFileOperation.C.
References Foam::infoDetailLevel.
|
virtual |
Definition at line 146 of file hostCollatedFileOperation.C.
References UPstream::freeCommunicator(), and UPstream::worldComm.
TypeName | ( | "hostCollated" | ) |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.