fileOperations that performs all file operations on the master processor. Requires the calls to be parallel synchronised! More...
#include <masterUncollatedFileOperation.H>


Classes | |
| class | mkDirOp |
| class | chModOp |
| class | modeOp |
| class | typeOp |
| class | existsOp |
| class | isDirOp |
| class | isFileOp |
| class | fileSizeOp |
| class | lastModifiedOp |
| class | highResLastModifiedOp |
| class | mvBakOp |
| class | rmOp |
| class | rmDirOp |
| class | cpOp |
| class | lnOp |
| class | mvOp |
| class | fileOrNullOp |
| class | readDirOp |
Public Member Functions | |
| TypeName ("masterUncollated") | |
| Runtime type information. | |
| masterUncollatedFileOperation (bool verbose=false) | |
| Default construct. | |
| masterUncollatedFileOperation (const Tuple2< label, labelList > &commAndIORanks, const bool distributedRoots, bool verbose=false) | |
| Construct from communicator with specified io-ranks. | |
| virtual | ~masterUncollatedFileOperation () |
| Destructor. | |
| virtual void | storeComm () const |
| Transfer ownership of communicator to this fileOperation. Use with caution. | |
| virtual bool | mkDir (const fileName &, mode_t=0777) const |
| Make directory. | |
| virtual bool | chMod (const fileName &, const mode_t) const |
| Set the file mode. | |
| virtual mode_t | mode (const fileName &, const bool followLink=true) const |
| Return the file mode. | |
| virtual fileName::Type | type (const fileName &, const bool followLink=true) const |
| Return the file type: DIRECTORY, FILE or SYMLINK. | |
| virtual bool | exists (const fileName &, const bool checkGzip=true, const bool followLink=true) const |
| Does the name exist (as DIRECTORY or FILE) in the file system? | |
| virtual bool | isDir (const fileName &, const bool followLink=true) const |
| Does the name exist as a DIRECTORY in the file system? | |
| virtual bool | isFile (const fileName &, const bool checkGzip=true, const bool followLink=true) const |
| Does the name exist as a FILE in the file system? | |
| virtual off_t | fileSize (const fileName &, const bool followLink=true) const |
| Return size of file. | |
| virtual time_t | lastModified (const fileName &, const bool followLink=true) const |
| Return time of last file modification. | |
| virtual double | highResLastModified (const fileName &, const bool followLink=true) const |
| Return time of last file modification. | |
| virtual fileNameList | readDir (const fileName &, const fileName::Type=fileName::FILE, const bool filtergz=true, const bool followLink=true) const |
| Read a directory and return the entries as a string list. | |
| virtual bool | cp (const fileName &src, const fileName &dst, const bool followLink=true) const |
| Copy, recursively if necessary, the source to the destination. | |
| virtual bool | ln (const fileName &src, const fileName &dst) const |
| Create a softlink. dst should not exist. Returns true if. | |
| virtual bool | mv (const fileName &src, const fileName &dst, const bool followLink=false) const |
| Rename src to dst. | |
| virtual bool | mvBak (const fileName &, const std::string &ext="bak") const |
| Rename to a corresponding backup file. | |
| virtual bool | rm (const fileName &) const |
| Remove a file, returning true if successful otherwise false. | |
| virtual bool | rmDir (const fileName &dir, const bool silent=false, const bool emptyOnly=false) const |
| Remove a directory and its contents. | |
| virtual fileName | filePath (const bool checkGlobal, const IOobject &io, const word &typeName, const bool search) const |
| Search for an object. | |
| virtual fileName | dirPath (const bool checkGlobal, const IOobject &io, const bool search) const |
| Search for a directory. | |
| virtual fileNameList | readObjects (const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const |
| Search directory for objects. Used in IOobjectList. | |
| virtual bool | readHeader (IOobject &, const fileName &, const word &typeName) const |
| Read object header from supplied file. | |
| virtual autoPtr< ISstream > | readStream (regIOobject &, const fileName &, const word &typeName, const bool readOnProc=true) const |
| Reads header for regIOobject and returns an ISstream to read the contents. | |
| virtual bool | read (regIOobject &, const bool masterOnly, const IOstreamOption::streamFormat format, const word &typeName) const |
| Top-level read. | |
| virtual bool | writeObject (const regIOobject &io, IOstreamOption streamOpt=IOstreamOption(), const bool writeOnProc=true) const |
| Writes a regIOobject (so header, contents and divider). | |
| virtual autoPtr< ISstream > | NewIFstream (const fileName &) const |
| Generate an ISstream that reads a file. | |
| virtual autoPtr< OSstream > | NewOFstream (const fileName &pathname, IOstreamOption streamOpt=IOstreamOption(), const bool writeOnProc=true) const |
| Generate an OSstream that writes a file. | |
| virtual autoPtr< OSstream > | NewOFstream (IOstreamOption::atomicType atomic, const fileName &pathname, IOstreamOption streamOpt=IOstreamOption(), const bool writeOnProc=true) const |
| Generate an OSstream that writes a file. | |
| virtual label | addWatch (const fileName &) const |
| Add watching of a file. Returns handle. | |
| virtual bool | removeWatch (const label) const |
| Remove watch on a file (using handle). | |
| virtual label | findWatch (const labelList &watchIndices, const fileName &) const |
| Find index (or -1) of file in list of handles. | |
| virtual void | addWatches (regIOobject &, const fileNameList &) const |
| Helper: add watches for list of regIOobjects. | |
| virtual fileName | getFile (const label) const |
| Get name of file being watched (using handle). | |
| virtual void | updateStates (const bool masterOnly, const bool syncPar) const |
| Update state of all files. | |
| virtual fileMonitor::fileState | getState (const label) const |
| Get current state of file (using handle). | |
| virtual void | setUnmodified (const label) const |
| Set current state of file (using handle) to unmodified. | |
| virtual instantList | findTimes (const fileName &directory, const word &constantName="constant") const |
| Get sorted list of times. | |
| virtual IOobject | findInstance (const IOobject &io, const scalar startValue, const word &stopInstance="", const bool constant_fallback=true) const |
Find time instance where IOobject is located. The name of the IOobject can be empty, in which case only the IOobject::local() is checked. Does not search beyond stopInstance (if set) or constant. | |
| virtual void | setTime (const Time &) const |
| Callback for time change. | |
| virtual void | flush () const |
| Forcibly wait until all output done. Flush any cached data. | |
| virtual void | sync () |
| Forcibly parallel sync. | |
| const HashPtrTable< DynamicList< instant > > & | times () const noexcept |
| Return cached times. | |
| Public Member Functions inherited from fileOperation | |
| TypeName ("fileOperation") | |
| Runtime type information. | |
| fileOperation (const label comm, const labelUList &ioRanks=labelUList::null(), const bool distributedRoots=false) | |
| Construct from communicator, optionally with specified io-ranks and/or distributed roots. | |
| fileOperation (const Tuple2< label, labelList > &commAndIORanks, const bool distributedRoots=false) | |
| Construct from communicator with specified io-ranks. | |
| declareRunTimeSelectionTable (autoPtr, fileOperation, word,(bool verbose),(verbose)) | |
| declareRunTimeSelectionTable (autoPtr, fileOperation, comm,(const Tuple2< label, labelList > &commAndIORanks, const bool distributedRoots, bool verbose),(commAndIORanks, distributedRoots, verbose)) | |
| virtual | ~fileOperation ()=default |
| Destructor. | |
| label | comm () const noexcept |
| Communicator to use. | |
| label | comm (label communicator) const noexcept |
| Set communicator to use [mutable]. Negative values are a no-op. | |
| bool | distributed () const noexcept |
| Distributed roots (parallel run). | |
| bool | distributed (bool on) const noexcept |
| Set distributed roots on/off [mutable]. | |
| const labelList & | ioRanks () const noexcept |
| The list of IO ranks (global ranks). | |
| InfoProxy< fileOperation > | info () const noexcept |
| Return info proxy, used to print information to a stream. | |
| virtual bool | good () const |
| True if the fileOperation can be considered valid. At the moment, primarily used to detect the dummy fileOperation. | |
| virtual bool | broadcastCopy (const label comm, const bool writeOnProc, const fileName &src, const fileName &dst) const |
| Read dir/file (recursively if necessary) on master of the communicator, send and write contents to all 'writeOnProc' processors with local file name. | |
| virtual fileName | objectPath (const IOobject &io, const word &typeName) const |
| Generate disk file name for object. Opposite of filePath. | |
| virtual fileName | filePath (const fileName &, const bool checkGzip=true, const bool followLink=true) const |
| Search for a file or directory. Use IOobject version in preference. | |
| virtual word | processorsDir (const IOobject &io) const |
| Actual name of processors dir (for use in mode PROCOBJECT, PROCINSTANCE). | |
| virtual word | processorsDir (const fileName &) const |
| Actual name of processors dir (for use in mode PROCOBJECT, PROCINSTANCE). | |
| label | nProcs () const noexcept |
| Overall number of processors, from UPstream::nProcs() or detected from directories/results. | |
| label | nProcs (const label numProcs) noexcept |
| Set number of processor directories/results. | |
| virtual label | nProcs (const fileName &dir, const fileName &local="", const label wantedNProcs=0) const |
| Get number of processor directories/results. | |
| fileName | processorsCasePath (const IOobject &io, const word &procDir) const |
| Generate path (like io.path) from root+casename with any. | |
| fileName | processorsPath (const IOobject &io, const word &instance, const word &procDir) const |
| Generate path (like io.path) with provided instance and any. | |
| fileName | processorsPath (const fileName &, const word &procDir) const |
| Operating on fileName: replace processorXXX with procDir. | |
| label | setNProcs (label numProcs) |
| Same as nProcs. | |
Static Public Attributes | |
| static float | maxMasterFileBufferSize |
| Max size of parallel communications. Switches from non-blocking. | |
| Static Public Attributes inherited from fileOperation | |
| static const Enum< pathType > | pathTypeNames_ |
| static word | processorsBaseDir = "processors" |
| Return the processors directory name (usually "processors"). | |
| static word | defaultFileHandler |
| Name of the default fileHandler. | |
| static refPtr< fileOperation > | fileHandlerPtr_ |
| The currently active file handler. Avoid accessing directly. | |
Protected Member Functions | |
| template<class Type, class FileOp> | |
| Type | masterOp (const fileName &fName, const FileOp &fop, const int tag, const label comm) const |
| template<class Type, class FileOp> | |
| Type | masterOp (const fileName &src, const fileName &dest, const FileOp &fop, const int tag, const label comm) const |
| virtual fileName | filePathInfo (const bool checkGlobal, const bool isFile, const IOobject &io, const dirIndexList &pDirs, const bool search, pathType &searchType, word &processorsDir, word &instance) const |
| Search (locally!) for object; return info on how it was found. | |
| fileName | localObjectPath (const IOobject &, const pathType &searchType, const word &processorsDir, const word &instancePath) const |
| Construct filePath. | |
| bool | exists (const dirIndexList &, IOobject &io) const |
| Helper: check IO for local existence. Like filePathInfo but. | |
| Protected Member Functions inherited from fileOperation | |
| fileMonitor & | monitor () const |
| Get or create fileMonitor singleton. | |
| refPtr< dirIndexList > | lookupAndCacheProcessorsPath (const fileName &objectPath, const bool syncPar) const |
| Lookup name of processorsDDD using cache. | |
| virtual refPtr< dirIndexList > | lookupProcessorsPath (const fileName &objectPath) const |
| Lookup name of processorsDDD using cache. | |
| bool | exists (IOobject &io) const |
| Does IOobject exist? Is either a directory (empty name()) or a file. | |
| bool | isIOrank (const label proci) const |
| Is proci a master rank in the communicator (in parallel) or a master rank in the IO ranks (non-parallel). | |
| void | printRanks () const |
| Helper: output which ranks are IO. | |
Static Protected Member Functions | |
| static void | readAndSend (const fileName &filePath, const labelUList &recvProcs, PstreamBuffers &pBufs) |
| Read file contents and send to processors. | |
| static autoPtr< ISstream > | read (IOobject &io, const label comm, const bool uniform, const fileNameList &filePaths, const boolUList &readOnProcs) |
| Read files on comms master. | |
| Static Protected Member Functions inherited from fileOperation | |
| static void | mergeTimes (const UList< instant > &extraTimes, const word &constantName, instantList ×) |
| Merge two times. | |
| static bool | isFileOrDir (const bool isFile, const fileName &) |
| Helper: check for file (isFile) or directory (!isFile). | |
| static label | getManagedComm (const label communicator) |
| Construction helper: check for locally allocated communicator. | |
Protected Attributes | |
| HashPtrTable< DynamicList< instant > > | times_ |
| Cached times for a given directory. | |
| Protected Attributes inherited from fileOperation | |
| label | comm_ |
| Communicator to use. | |
| label | nProcs_ |
| Overall number of processors. | |
| bool | distributed_ |
| Distributed roots (parallel run). | |
| const labelList | ioRanks_ |
| The list of IO ranks (global ranks). | |
| HashTable< dirIndexList > | procsDirs_ |
| Detected processors directories. | |
| std::unique_ptr< fileMonitor > | monitorPtr_ |
| File-change monitor for all registered files. | |
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 } |
| Enumeration for the location of an IOobject. More... | |
| typedef Tuple2< fileName, Tuple2< pathType, int > > | dirIndex |
| Augment fileName with pathType and local offset. | |
| typedef List< dirIndex > | dirIndexList |
| typedef UPstream::rangeType | procRangeType |
| For addressing a range of processors (an int range). | |
| Static Public Member Functions inherited from fileOperation | |
| static refPtr< fileOperation > | null () |
| Reference to a dummy file handler. | |
| static autoPtr< fileOperation > | New (const word &handlerType, bool verbose=false) |
| Select fileHandler-type. Uses defaultFileHandler if the handlerType is empty. | |
| static autoPtr< fileOperation > | New (const word &handlerType, const Tuple2< label, labelList > &commAndIORanks, const bool distributedRoots, bool verbose=false) |
| Select fileHandler-type. Uses defaultFileHandler if the handlerType is empty. | |
| static autoPtr< fileOperation > | New (const fileOperation &origHandler, const boolUList &useProc, bool verbose=false) |
| Replicate the given fileHandler properties with a subset of (global) ranks. | |
| static autoPtr< fileOperation > | New (const fileOperation &origHandler, const bitSet &useProc, bool verbose=false) |
| Replicate the given fileHandler properties with a subset of (global) ranks. | |
| static autoPtr< fileOperation > | NewUncollated () |
| The commonly used uncollatedFileOperation. | |
| static const fileOperation & | fileHandler () |
| Return the current file handler. Will create the default file handler if necessary. | |
| static refPtr< fileOperation > | fileHandler (std::nullptr_t) |
| Delete current file handler. | |
| static refPtr< fileOperation > | fileHandler (refPtr< fileOperation > &newHandler) |
| Replace the current file handler. | |
| static refPtr< fileOperation > | fileHandler (refPtr< fileOperation > &&newHandler) |
| Replace the current file handler. | |
| static refPtr< fileOperation > | fileHandler (autoPtr< fileOperation > &&newHandler) |
| Replace the current file handler. | |
| static int | cacheLevel () noexcept |
| Return cache level. | |
| static int | cacheLevel (int level) noexcept |
| Set cache level (0 = off). | |
| static int | nProcsFilter () noexcept |
| Return collated 'processorsDDD' filtering. | |
| static int | nProcsFilter (int level) noexcept |
| Set collated 'processorsDDD' filtering (0 = off). | |
| static instantList | sortTimes (const fileNameList &dirEntries, const word &constantName="constant") |
| Sort directory entries according to time value,. | |
| static bool | uniformFile (const fileNameList &names) |
| True if the file names are identical. False on an empty list. | |
| static bool | uniformFile (const label comm, const fileName &name) |
| True if the file name is identical on all ranks. | |
| static label | splitProcessorPath (const fileName &objectPath, fileName &path, fileName &procDir, fileName &local, procRangeType &group, label &nProcs) |
| Split objectPath into part before 'processor' and part after. | |
| static label | detectProcessorPath (const fileName &objPath) |
| Detect processor number from '/aa/bb/processorDDD/cc'. | |
| static label | detectProcessorPath (const fileName &objPath, procRangeType &group, label *numProcs=nullptr) |
| Detect processor number from 'path/processorDDD/abc' or 'path/processorsNN/abc', 'path/processorsNN_0-10/abc'. | |
| static labelRange | subRanks (const labelUList &mainIOranks) |
| Get (contiguous) range/bounds of ranks addressed within the given main io-ranks. | |
| static labelList | getGlobalHostIORanks () |
| Get list of global IO master ranks based on the hostname. It is assumed that each host range is contiguous. | |
| static labelList | getGlobalIORanks () |
| Get list of global IO ranks from FOAM_IORANKS env variable. If set, these correspond to the IO master ranks. | |
| Static Protected Attributes inherited from fileOperation | |
| static int | cacheLevel_ |
| Cache level (eg, for caching time directories). Default: 1. | |
fileOperations that performs all file operations on the master processor. Requires the calls to be parallel synchronised!
Limitations
The main logic is in ::filePath which returns a
system/controlDict: filePath worldmaster: <globalRoot>/system/controlDict localmaster: ,, slave : ,,
processor0/uniform/time filePath worldmaster: <globalRoot>/processorXXX/uniform/time localmaster: ,, slave : ,,
processors0/0/p processors10/0/p processors10_2-4/0/p
Definition at line 78 of file masterUncollatedFileOperation.H.
|
explicit |
Default construct.
Definition at line 660 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, Foam::exit(), Foam::FatalError, FatalErrorInFunction, fileOperation::fileOperation(), Foam::getCommPattern(), fileOperation::getManagedComm(), UPstream::myProcNo(), and UPstream::nProcs().
Referenced by addWatches(), collatedFileOperation::collatedFileOperation(), collatedFileOperation::collatedFileOperation(), dirPath(), filePath(), findInstance(), findTimes(), hostUncollatedFileOperation::hostUncollatedFileOperation(), hostUncollatedFileOperation::hostUncollatedFileOperation(), read(), and readObjects().


|
explicit |
Construct from communicator with specified io-ranks.
Definition at line 693 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, Foam::exit(), Foam::FatalError, FatalErrorInFunction, fileOperation::fileOperation(), UPstream::myProcNo(), and UPstream::nProcs().

|
virtual |
Destructor.
Definition at line 734 of file masterUncollatedFileOperation.C.
References UPstream::freeCommunicator().

|
protected |
Definition at line 28 of file masterUncollatedFileOperationTemplates.C.
References fileOperation::comm(), Foam::endl(), UPstream::gatherList, UPstream::is_parallel(), Pstream::listScatterValues(), UPstream::master(), UPstream::myProcNo(), name, UPstream::nProcs(), Foam::Pout, and List< T >::resize().
Referenced by chMod(), cp(), dirPath(), exists(), filePath(), fileSize(), highResLastModified(), isDir(), isFile(), lastModified(), ln(), mkDir(), mode(), mv(), mvBak(), readDir(), rm(), rmDir(), and type().


|
protected |
Definition at line 76 of file masterUncollatedFileOperationTemplates.C.
References fileOperation::comm(), Foam::endl(), UList< T >::first(), UPstream::gatherList, UPstream::is_parallel(), Pstream::listScatterValues(), UPstream::master(), UPstream::myProcNo(), UPstream::nProcs(), Foam::Pout, and List< T >::resize().

|
protectedvirtual |
Search (locally!) for object; return info on how it was found.
Does not do any parallel communication.
| checkGlobal | also check undecomposed case | |
| isFile | True (check for file), False (check for directory) | |
| [out] | searchType | how was found |
| [out] | processorsDir | name of processor directory |
| [out] | instance | instance |
Definition at line 82 of file masterUncollatedFileOperation.C.
References fileOperation::ABSOLUTE, fileOperation::FINDINSTANCE, TimePaths::findInstancePath(), io, isFile(), fileOperation::isFileOrDir(), fileOperation::NOTFOUND, fileOperation::OBJECT, fileOperation::objectPath(), fileOperation::PARENTOBJECT, fileOperation::PROCBASEINSTANCE, fileOperation::PROCBASEOBJECT, fileOperation::processorsPath(), fileOperation::PROCINSTANCE, fileOperation::PROCOBJECT, fileOperation::PROCUNCOLLATED, fileOperation::PROCUNCOLLATEDINSTANCE, Foam::search(), times_, and fileOperation::WRITEOBJECT.
Referenced by dirPath(), and filePath().


|
protected |
Construct filePath.
Definition at line 260 of file masterUncollatedFileOperation.C.
References fileOperation::ABSOLUTE, fileOperation::FINDINSTANCE, io, UPstream::myProcNo(), Foam::name(), fileOperation::NOTFOUND, NotImplemented, fileOperation::OBJECT, fileOperation::objectPath(), fileOperation::PARENTOBJECT, UPstream::parRun(), fileOperation::PROCBASEINSTANCE, fileOperation::PROCBASEOBJECT, fileOperation::processorsDir(), fileOperation::processorsPath(), fileOperation::PROCINSTANCE, fileOperation::PROCOBJECT, fileOperation::PROCUNCOLLATED, fileOperation::PROCUNCOLLATEDINSTANCE, UPstream::worldComm, and fileOperation::WRITEOBJECT.
Referenced by dirPath(), filePath(), and collatedFileOperation::objectPath().


|
staticprotected |
Read file contents and send to processors.
Handles compressed or uncompressed files
Definition at line 402 of file masterUncollatedFileOperation.C.
References IOstreamOption::BINARY, UList< T >::cdata_bytes(), IOstreamOption::compression(), UList< T >::empty(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, filePath(), IOstream::good(), Foam::Info, os(), IFstream::readContents(), and UList< T >::size_bytes().
Referenced by NewIFstream(), and read().


|
staticprotected |
Read files on comms master.
Definition at line 440 of file masterUncollatedFileOperation.C.
References UPstream::allProcs(), fileOperation::comm(), UList< T >::data(), UList< T >::empty(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, PstreamBuffers::finishedScatters(), io, UPstream::master(), UPstream::masterNo(), UPstream::myProcNo(), dummyISstream::New(), UPstream::nProcs(), Foam::Pout, UPstream::procID(), DynamicList< T, SizeMin >::push_back(), UIPstream::read(), readAndSend(), PstreamBuffers::recvDataCount(), autoPtr< T >::reset(), UList< T >::size(), and UPstream::subProcs().

|
protected |
Helper: check IO for local existence. Like filePathInfo but.
without parent searchign and instance searching
Definition at line 1372 of file masterUncollatedFileOperation.C.
References io, isFile(), fileOperation::isFileOrDir(), word::null, fileOperation::objectPath(), and fileOperation::processorsPath().

| TypeName | ( | "masterUncollated" | ) |
Runtime type information.
|
virtual |
Transfer ownership of communicator to this fileOperation. Use with caution.
Implements fileOperation.
Reimplemented in collatedFileOperation, hostCollatedFileOperation, and hostUncollatedFileOperation.
Definition at line 725 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, and fileOperation::getManagedComm().

|
virtual |
Make directory.
Implements fileOperation.
Definition at line 743 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), mode(), and UPstream::msgType().

|
virtual |
Set the file mode.
Implements fileOperation.
Definition at line 759 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), mode(), and UPstream::msgType().

|
virtual |
Return the file mode.
Implements fileOperation.
Definition at line 775 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().
Referenced by chMod(), masterUncollatedFileOperation::chModOp::chModOp(), mkDir(), and masterUncollatedFileOperation::mkDirOp::mkDirOp().


|
virtual |
Return the file type: DIRECTORY, FILE or SYMLINK.
Implements fileOperation.
Definition at line 791 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().
Referenced by collatedFileOperation::printBanner(), readDir(), and masterUncollatedFileOperation::readDirOp::readDirOp().


|
virtual |
Does the name exist (as DIRECTORY or FILE) in the file system?
Optionally enable/disable check for gzip file.
Implements fileOperation.
Definition at line 810 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().

|
virtual |
Does the name exist as a DIRECTORY in the file system?
Implements fileOperation.
Definition at line 827 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().

|
virtual |
Does the name exist as a FILE in the file system?
Optionally enable/disable check for gzip file.
Implements fileOperation.
Definition at line 843 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().
Referenced by exists(), masterUncollatedFileOperation::fileOrNullOp::fileOrNullOp(), and filePathInfo().


|
virtual |
Return size of file.
Implements fileOperation.
Definition at line 860 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().

|
virtual |
Return time of last file modification.
Implements fileOperation.
Definition at line 882 of file masterUncollatedFileOperation.C.
References masterOp(), UPstream::msgType(), and UPstream::worldComm.

|
virtual |
Return time of last file modification.
Implements fileOperation.
Definition at line 919 of file masterUncollatedFileOperation.C.
References masterOp(), UPstream::msgType(), and UPstream::worldComm.

|
virtual |
Read a directory and return the entries as a string list.
Implements fileOperation.
Definition at line 983 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), UPstream::msgType(), and type().

Copy, recursively if necessary, the source to the destination.
Implements fileOperation.
Definition at line 1001 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().

Create a softlink. dst should not exist. Returns true if.
successful.
Implements fileOperation.
Definition at line 1019 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().

Rename src to dst.
Implements fileOperation.
Definition at line 1036 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().

|
virtual |
Rename to a corresponding backup file.
If the backup file already exists, attempt with "01" .. "99" suffix
Implements fileOperation.
Definition at line 935 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().

|
virtual |
Remove a file, returning true if successful otherwise false.
Implements fileOperation.
Definition at line 951 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().

|
virtual |
Remove a directory and its contents.
| dir | the directory to remove |
| silent | do not report missing directory |
| emptyOnly | only remove empty directories (recursive) |
Implements fileOperation.
Definition at line 966 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, masterOp(), and UPstream::msgType().

|
virtual |
Search for an object.
| checkGlobal | also check undecomposed case |
| typeName | currently unused |
Implements fileOperation.
Definition at line 1056 of file masterUncollatedFileOperation.C.
References fileOperation::ABSOLUTE, UPstream::broadcast, Pstream::broadcasts(), fileOperation::cacheLevel(), fileOperation::comm_, Foam::endl(), filePathInfo(), fileOperation::FINDINSTANCE, findTimes(), Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, io, localObjectPath(), fileOperation::lookupProcessorsPath(), UPstream::master(), masterOp(), masterUncollatedFileOperation(), UPstream::msgType(), fileOperation::NOTFOUND, fileOperation::nProcs(), fileOperation::OBJECT, fileOperation::PARENTOBJECT, UPstream::parRun(), UPstream::parRun(), fileOperation::pathTypeNames_, Foam::Pout, fileOperation::PROCBASEINSTANCE, fileOperation::PROCBASEOBJECT, fileOperation::PROCINSTANCE, fileOperation::PROCOBJECT, fileOperation::PROCUNCOLLATED, fileOperation::PROCUNCOLLATEDINSTANCE, Foam::search(), UPstream::worldComm, and fileOperation::WRITEOBJECT.
Referenced by NewIFstream(), and readAndSend().


|
virtual |
Search for a directory.
| checkGlobal | also check undecomposed case |
Implements fileOperation.
Definition at line 1214 of file masterUncollatedFileOperation.C.
References fileOperation::ABSOLUTE, UPstream::broadcast, Pstream::broadcasts(), fileOperation::cacheLevel(), fileOperation::comm_, Foam::endl(), filePathInfo(), fileOperation::FINDINSTANCE, findTimes(), io, localObjectPath(), fileOperation::lookupProcessorsPath(), UPstream::master(), masterOp(), masterUncollatedFileOperation(), UPstream::msgType(), fileOperation::NOTFOUND, fileOperation::nProcs(), fileOperation::OBJECT, fileOperation::PARENTOBJECT, UPstream::parRun(), UPstream::parRun(), fileOperation::pathTypeNames_, Foam::Pout, fileOperation::PROCBASEINSTANCE, fileOperation::PROCBASEOBJECT, fileOperation::PROCINSTANCE, fileOperation::PROCOBJECT, fileOperation::PROCUNCOLLATED, fileOperation::PROCUNCOLLATEDINSTANCE, Foam::search(), UPstream::worldComm, and fileOperation::WRITEOBJECT.

|
virtual |
Search directory for objects. Used in IOobjectList.
Use non-time searching version
Reimplemented from fileOperation.
Definition at line 1671 of file masterUncollatedFileOperation.C.
References Pstream::broadcasts(), fileOperation::cacheLevel(), TimePaths::constant(), Foam::endl(), TimePaths::findInstancePath(), fileOperation::findTimes(), local, UPstream::master(), masterUncollatedFileOperation(), fileOperation::nProcs(), IOobject::objectPath(), UPstream::parRun(), Time::path(), Foam::Pout, fileOperation::readObjects(), objectRegistry::time(), and UPstream::worldComm.

Read object header from supplied file.
| typeName | currently unused |
Implements fileOperation.
Definition at line 1761 of file masterUncollatedFileOperation.C.
References UPstream::broadcast, Pstream::broadcasts(), fileOperation::comm_, Foam::endl(), PstreamBuffers::finishedScatters(), forAll, UPstream::gatherList, Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, IOstream::good(), io, UPstream::master(), UPstream::masterNo(), UPstream::msgType(), UPstream::myProcNo(), UPstream::nProcs(), os(), Foam::Pout, decomposedBlockData::readHeader(), List< T >::resize(), PstreamBuffers::subProcs(), fileOperation::uniformFile(), and UPstream::worldComm.

|
virtual |
Reads header for regIOobject and returns an ISstream to read the contents.
| typeName | currently unused |
Implements fileOperation.
Definition at line 1906 of file masterUncollatedFileOperation.C.
References UPstream::broadcast, autoPtr< T >::clear(), fileOperation::comm_, fileOperation::detectProcessorPath(), Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, Foam::fileSize(), Foam::flatOutput(), UPstream::gatherList, Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, io, fileOperation::ioRanks_, decomposedBlockData::isCollatedType(), UPstream::listGatherValues(), UPstream::master(), maxMasterFileBufferSize, UPstream::msgType(), UPstream::myProcNo(), UPstream::nonBlocking, UPstream::nProcs(), UPstream::parRun(), Foam::Pout, Foam::read(), decomposedBlockData::readBlock(), decomposedBlockData::readBlocks(), IOobject::readHeader(), UPstream::reduceOr(), autoPtr< T >::reset(), List< T >::resize(), UPstream::scheduled, fileOperation::uniformFile(), and UPstream::worldComm.

|
virtual |
Top-level read.
| format | The format for parallel send/recv |
| typeName | forwards to regIOobject |
Implements fileOperation.
Definition at line 2161 of file masterUncollatedFileOperation.C.
References fileOperation::cacheLevel(), Foam::endl(), format(), Foam::GlobalIOList< Tuple2< scalar, vector > >::typeName, io, UPstream::master(), masterUncollatedFileOperation(), UPstream::myProcNo(), fileOperation::nProcs(), os(), UPstream::parRun(), UPstream::parRun(), Foam::Pout, and UPstream::worldComm.

|
virtual |
Writes a regIOobject (so header, contents and divider).
Returns success state.
Reimplemented from fileOperation.
Reimplemented in collatedFileOperation.
Definition at line 2244 of file masterUncollatedFileOperation.C.
References Foam::endl(), io, NewOFstream(), os(), Foam::Pout, setTime(), and IOobject::writeEndDivider().

|
virtual |
Generate an ISstream that reads a file.
Implements fileOperation.
Definition at line 2401 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, UList< T >::data(), UList< T >::empty(), Foam::endl(), filePath(), PstreamBuffers::finishedSends(), UPstream::gatherList, Foam::identity(), UPstream::master(), UPstream::masterNo(), UPstream::msgType(), UPstream::myProcNo(), UPstream::nProcs(), UPstream::parRun(), Foam::Pout, UIPstream::read(), readAndSend(), PstreamBuffers::recvDataCount(), autoPtr< T >::reset(), UList< T >::size(), UPstream::subProcs(), and fileOperation::uniformFile().

|
virtual |
Generate an OSstream that writes a file.
Implements fileOperation.
Definition at line 2512 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, and IOstreamOption::NO_APPEND.
Referenced by writeObject().

|
virtual |
Generate an OSstream that writes a file.
Implements fileOperation.
Definition at line 2534 of file masterUncollatedFileOperation.C.
References fileOperation::comm_, and IOstreamOption::NO_APPEND.
|
virtual |
Add watching of a file. Returns handle.
Reimplemented from fileOperation.
Definition at line 2637 of file masterUncollatedFileOperation.C.
References UPstream::broadcast, UPstream::master(), fileOperation::monitor(), UPstream::parRun(), and UPstream::worldComm.
Referenced by addWatches().


|
virtual |
Remove watch on a file (using handle).
Reimplemented from fileOperation.
Definition at line 2653 of file masterUncollatedFileOperation.C.
References UPstream::broadcast, UPstream::master(), fileOperation::monitor(), UPstream::parRun(), and UPstream::worldComm.
Referenced by addWatches().


Find index (or -1) of file in list of handles.
Reimplemented from fileOperation.
Definition at line 2669 of file masterUncollatedFileOperation.C.
References UPstream::broadcast, forAll, getFile(), UPstream::master(), fileOperation::monitor(), UPstream::parRun(), and UPstream::worldComm.
Referenced by addWatches().


|
virtual |
Helper: add watches for list of regIOobjects.
Reimplemented from fileOperation.
Definition at line 2694 of file masterUncollatedFileOperation.C.
References addWatch(), UPstream::broadcast, fileOperation::cacheLevel(), HashTable< T, Key, Hash >::erase(), f(), findWatch(), UPstream::master(), masterUncollatedFileOperation(), fileOperation::nProcs(), UPstream::parRun(), DynamicList< T, SizeMin >::push_back(), removeWatch(), and regIOobject::watchIndices().

|
virtual |
Get name of file being watched (using handle).
Reimplemented from fileOperation.
Definition at line 2747 of file masterUncollatedFileOperation.C.
References UPstream::broadcast, UPstream::master(), fileOperation::monitor(), UPstream::parRun(), and UPstream::worldComm.
Referenced by findWatch().


|
virtual |
Update state of all files.
Reimplemented from fileOperation.
Definition at line 2763 of file masterUncollatedFileOperation.C.
References UPstream::master(), fileOperation::monitor(), UPstream::parRun(), and UPstream::worldComm.

|
virtual |
Get current state of file (using handle).
Reimplemented from fileOperation.
Definition at line 2777 of file masterUncollatedFileOperation.C.
References UPstream::broadcast, UPstream::master(), fileOperation::monitor(), UPstream::parRun(), fileMonitor::UNMODIFIED, and UPstream::worldComm.

|
virtual |
Set current state of file (using handle) to unmodified.
Reimplemented from fileOperation.
Definition at line 2793 of file masterUncollatedFileOperation.C.
References UPstream::master(), fileOperation::monitor(), UPstream::parRun(), and UPstream::worldComm.

|
virtual |
Get sorted list of times.
| directory | The directory to search |
| constantName | The "constant" name |
Reimplemented from fileOperation.
Definition at line 2286 of file masterUncollatedFileOperation.C.
References UPstream::broadcast, fileOperation::cacheLevel(), Foam::endl(), fileOperation::findTimes(), Foam::flatOutput(), UPstream::master(), masterUncollatedFileOperation(), Foam::nl, fileOperation::nProcs(), UPstream::parRun(), Foam::Pout, times(), times_, and UPstream::worldComm.
Referenced by dirPath(), filePath(), and findInstance().


|
virtual |
Find time instance where IOobject is located. The name of the IOobject can be empty, in which case only the IOobject::local() is checked. Does not search beyond stopInstance (if set) or constant.
If the instance cannot be found:
stopInstance (if set and reached)constant if constant_fallback is true.| stopInstance | The search stop instance |
| constant_fallback | Return "constant" instead of "" if the search failed |
Reimplemented from fileOperation.
Definition at line 1421 of file masterUncollatedFileOperation.C.
References UPstream::broadcast, fileOperation::cacheLevel(), TimePaths::constant(), UList< T >::empty(), Foam::endl(), Foam::exists(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, findTimes(), IOobject::instance(), io, IOobjectOption::isReadRequired(), IOobject::local(), fileOperation::lookupProcessorsPath(), UPstream::master(), masterUncollatedFileOperation(), IOobject::name(), name, fileOperation::nProcs(), UPstream::parRun(), Time::path(), Foam::Pout, UList< T >::size(), IOobject::time(), Time::timeName(), and UPstream::worldComm.

|
virtual |
Callback for time change.
Reimplemented from fileOperation.
Definition at line 2345 of file masterUncollatedFileOperation.C.
References TimePaths::constant(), Foam::endl(), Foam::findSortedIndex(), name, Time::path(), Foam::Pout, fileOperation::setTime(), Foam::stableSort(), Time::subCycling(), Time::timeName(), times(), times_, and dimensioned< Type >::value().

|
virtual |
Forcibly wait until all output done. Flush any cached data.
Reimplemented from fileOperation.
Reimplemented in collatedFileOperation.
Definition at line 2557 of file masterUncollatedFileOperation.C.
References fileOperation::flush(), and times_.
Referenced by collatedFileOperation::flush().


|
virtual |
Forcibly parallel sync.
Reimplemented from fileOperation.
Definition at line 2564 of file masterUncollatedFileOperation.C.
References Pstream::broadcasts(), Foam::endl(), forAll, forAllConstIters, local, UPstream::master(), UPstream::myProcNo(), Foam::name(), Foam::New(), UPstream::parRun(), path(), Foam::Pout, List< T >::resize(), fileOperation::splitProcessorPath(), fileOperation::sync(), times_, and UPstream::worldComm.

|
inlinenoexcept |
Return cached times.
Definition at line 903 of file masterUncollatedFileOperation.H.
References Foam::noexcept, and times_.
Referenced by findTimes(), and setTime().

|
mutableprotected |
Cached times for a given directory.
Definition at line 105 of file masterUncollatedFileOperation.H.
Referenced by filePathInfo(), findTimes(), flush(), setTime(), sync(), and times().
|
static |
Max size of parallel communications. Switches from non-blocking.
to scheduled when reading/writing files. Read as float to enable easy specification of large sizes.
Definition at line 492 of file masterUncollatedFileOperation.H.
Referenced by collatedFileOperation::printBanner(), readStream(), and Foam::fileOperations::registerOptSwitch().