Public Member Functions | List of all members
hostCollatedFileOperation Class Reference

Version of collatedFileOperation with multiple read/write ranks. More...

Inheritance diagram for hostCollatedFileOperation:
Inheritance graph
[legend]
Collaboration diagram for hostCollatedFileOperation:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("hostCollated")
 
 hostCollatedFileOperation (const bool verbose)
 
virtual ~hostCollatedFileOperation ()
 
- Public Member Functions inherited from collatedFileOperation
 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)
 
- Public Member Functions inherited from masterUncollatedFileOperation
 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< ISstreamreadStream (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< ISstreamNewIFstream (const fileName &) const
 
virtual autoPtr< OSstreamNewOFstream (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
 
- Public Member Functions inherited from fileOperation
 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

- Public Types inherited from fileOperation
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< dirIndexdirIndexList
 
typedef IntRange< int > procRangeType
 
- Static Public Member Functions inherited from masterUncollatedFileOperation
static bool uniformFile (const fileNameList &)
 
- Static Public Member Functions inherited from fileOperation
static autoPtr< fileOperationNewUncollated ()
 
static autoPtr< fileOperationNew (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 Public Attributes inherited from collatedFileOperation
static float maxThreadFileBufferSize
 
- Static Public Attributes inherited from masterUncollatedFileOperation
static float maxMasterFileBufferSize
 
- Static Public Attributes inherited from fileOperation
static const Enum< pathTypepathTypeNames_
 
static word processorsBaseDir = "processors"
 
static word defaultFileHandler
 
static autoPtr< fileOperationfileHandlerPtr_
 
- Protected Member Functions inherited from collatedFileOperation
void printBanner (const bool printRanks=false) const
 
bool isMasterRank (const label proci) const
 
bool appendObject (const regIOobject &io, const fileName &pathName, IOstreamOption streamOpt) const
 
- Protected Member Functions inherited from masterUncollatedFileOperation
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
 
- Protected Member Functions inherited from fileOperation
fileMonitormonitor () const
 
refPtr< dirIndexListlookupAndCacheProcessorsPath (const fileName &objectPath, const bool syncPar) const
 
virtual refPtr< dirIndexListlookupProcessorsPath (const fileName &objectPath) const
 
bool exists (IOobject &io) const
 
- Static Protected Member Functions inherited from masterUncollatedFileOperation
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< ISstreamread (IOobject &io, const label comm, const bool uniform, const fileNameList &filePaths, const boolList &procValid)
 
- Static Protected Member Functions inherited from fileOperation
static labelList ioRanks ()
 
static void mergeTimes (const instantList &extraTimes, const word &constantName, instantList &times)
 
static bool isFileOrDir (const bool isFile, const fileName &)
 
- Protected Attributes inherited from collatedFileOperation
const label myComm_
 
OFstreamCollator writer_
 
label nProcs_
 
const labelList ioRanks_
 
- Protected Attributes inherited from masterUncollatedFileOperation
const label myComm_
 
HashPtrTable< instantListtimes_
 
- Protected Attributes inherited from fileOperation
const label comm_
 
bool distributed_
 
HashTable< dirIndexListprocsDirs_
 
autoPtr< fileMonitormonitorPtr_
 

Detailed Description

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

See also
collatedFileOperation
Source files

Definition at line 71 of file hostCollatedFileOperation.H.

Constructor & Destructor Documentation

◆ hostCollatedFileOperation()

hostCollatedFileOperation ( const bool  verbose)
explicit

Definition at line 121 of file hostCollatedFileOperation.C.

References Foam::infoDetailLevel.

◆ ~hostCollatedFileOperation()

Definition at line 146 of file hostCollatedFileOperation.C.

References UPstream::freeCommunicator(), and UPstream::worldComm.

Here is the call graph for this function:

Member Function Documentation

◆ TypeName()

TypeName ( "hostCollated"  )

The documentation for this class was generated from the following files: