Public Member Functions | Static Public Attributes | List of all members
collatedFileOperation Class Reference

Version of masterUncollatedFileOperation that collates regIOobjects into a container in the processors/ subdirectory. More...

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

Public Member Functions

 TypeName ("collated")
 Runtime type information. More...
 
 collatedFileOperation (const bool verbose)
 Construct null. More...
 
virtual ~collatedFileOperation ()
 Destructor. More...
 
virtual fileName objectPath (const IOobject &io, const word &typeName) const
 Generate disk file name for object. Opposite of filePath. More...
 
virtual bool writeObject (const regIOobject &, IOstream::streamFormat format=IOstream::ASCII, IOstream::versionNumber version=IOstream::currentVersion, IOstream::compressionType compression=IOstream::UNCOMPRESSED, const bool valid=true) const
 Writes a regIOobject (so header, contents and divider). More...
 
- Public Member Functions inherited from masterUncollatedFileOperation
 TypeName ("masterUncollated")
 Runtime type information. More...
 
 masterUncollatedFileOperation (const bool verbose)
 Construct null. More...
 
virtual ~masterUncollatedFileOperation ()
 Destructor. More...
 
virtual bool mkDir (const fileName &, mode_t=0777) const
 Make directory. More...
 
virtual bool chMod (const fileName &, const mode_t) const
 Set the file mode. More...
 
virtual mode_t mode (const fileName &, const bool followLink=true) const
 Return the file mode. More...
 
virtual fileName::Type type (const fileName &, const bool followLink=true) const
 Return the file type: DIRECTORY, FILE or LINK. More...
 
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? More...
 
virtual bool isDir (const fileName &, const bool followLink=true) const
 Does the name exist as a DIRECTORY in the file system? More...
 
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? More...
 
virtual off_t fileSize (const fileName &, const bool followLink=true) const
 Return size of file. More...
 
virtual time_t lastModified (const fileName &, const bool followLink=true) const
 Return time of last file modification. More...
 
virtual double highResLastModified (const fileName &, const bool followLink=true) const
 Return time of last file modification. More...
 
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. More...
 
virtual bool cp (const fileName &src, const fileName &dst, const bool followLink=true) const
 Copy, recursively if necessary, the source to the destination. More...
 
virtual bool ln (const fileName &src, const fileName &dst) const
 Create a softlink. dst should not exist. Returns true if. More...
 
virtual bool mv (const fileName &src, const fileName &dst, const bool followLink=false) const
 Rename src to dst. More...
 
virtual bool mvBak (const fileName &, const std::string &ext="bak") const
 Rename to a corresponding backup file. More...
 
virtual bool rm (const fileName &) const
 Remove a file, returning true if successful otherwise false. More...
 
virtual bool rmDir (const fileName &) const
 Remove a dirctory and its contents. More...
 
virtual fileName filePath (const bool checkGlobal, const IOobject &, const word &typeName) const
 Search for an object. checkGlobal : also check undecomposed case. More...
 
virtual fileName dirPath (const bool checkGlobal, const IOobject &) const
 Search for a directory. checkGlobal : also check undecomposed. More...
 
virtual fileNameList readObjects (const objectRegistry &db, const fileName &instance, const fileName &local, word &newInstance) const
 Search directory for objects. Used in IOobjectList. More...
 
virtual bool readHeader (IOobject &, const fileName &, const word &typeName) const
 Read object header from supplied file. More...
 
virtual autoPtr< ISstreamreadStream (regIOobject &, const fileName &, const word &typeName, const bool valid=true) const
 Reads header for regIOobject and returns an ISstream. More...
 
virtual bool read (regIOobject &, const bool masterOnly, const IOstream::streamFormat format, const word &typeName) const
 Top-level read. More...
 
virtual autoPtr< ISstreamNewIFstream (const fileName &) const
 Generate an ISstream that reads a file. More...
 
virtual autoPtr< OstreamNewOFstream (const fileName &pathname, IOstream::streamFormat format=IOstream::ASCII, IOstream::versionNumber version=IOstream::currentVersion, IOstream::compressionType compression=IOstream::UNCOMPRESSED, const bool valid=true) const
 Generate an Ostream that writes a file. More...
 
virtual label addWatch (const fileName &) const
 Add watching of a file. Returns handle. More...
 
virtual bool removeWatch (const label) const
 Remove watch on a file (using handle) More...
 
virtual label findWatch (const labelList &watchIndices, const fileName &) const
 Find index (or -1) of file in list of handles. More...
 
virtual void addWatches (regIOobject &, const fileNameList &) const
 Helper: add watches for list of regIOobjects. More...
 
virtual fileName getFile (const label) const
 Get name of file being watched (using handle) More...
 
virtual void updateStates (const bool masterOnly, const bool syncPar) const
 Update state of all files. More...
 
virtual fileMonitor::fileState getState (const label) const
 Get current state of file (using handle) More...
 
virtual void setUnmodified (const label) const
 Set current state of file (using handle) to unmodified. More...
 
virtual instantList findTimes (const fileName &, const word &) const
 Get sorted list of times. More...
 
virtual void setTime (const Time &) const
 Callback for time change. More...
 
const HashPtrTable< instantList > & times () const
 Return cached times. More...
 
- Public Member Functions inherited from fileOperation
 TypeName ("fileOperation")
 Runtime type information. More...
 
 fileOperation ()
 Construct null. More...
 
 declareRunTimeSelectionTable (autoPtr, fileOperation, word,(const bool verbose),(verbose))
 
virtual ~fileOperation ()
 Destructor. More...
 
virtual fileName filePath (const fileName &) const
 Search for a file or directory. Use IOobject version in. More...
 
virtual label nProcs (const fileName &dir, const fileName &local="") const
 Get number of processor directories/results. Used for e.g. More...
 

Static Public Attributes

static float maxThreadFileBufferSize
 Max size of thread buffer size. This is the overall size of. More...
 
- Static Public Attributes inherited from masterUncollatedFileOperation
static float maxMasterFileBufferSize
 Max size of parallel communications. Switches from non-blocking. More...
 
- Static Public Attributes inherited from fileOperation
static word processorsDir = "processors"
 Return the processors directory name (usually "processors") More...
 
static word defaultFileHandler
 Default fileHandler. More...
 
static autoPtr< fileOperationfileHandlerPtr_
 Static fileOperation. More...
 

Additional Inherited Members

- Public Types inherited from fileOperation
enum  pathType {
  NOTFOUND, ABSOLUTE, OBJECT, PROCESSORSOBJECT,
  PARENTOBJECT, FINDINSTANCE, PROCESSORSFINDINSTANCE
}
 Enumeration for the location of an IOobject. More...
 
- Static Public Member Functions inherited from masterUncollatedFileOperation
static bool uniformFile (const fileNameList &)
 Same file? More...
 
static fileName processorsCasePath (const IOobject &)
 root+casename with any 'processorXXX' replaced by 'processsors' More...
 
static fileName processorsPath (const IOobject &, const word &)
 Like io.path with provided instance and any 'processorXXX'. More...
 
static fileName processorsPath (const fileName &)
 Operating on fileName: replace processorXXX with processors. More...
 
static label splitProcessorPath (const fileName &, fileName &path, fileName &local)
 Split fileName into part before processor and part after. More...
 
- Static Public Member Functions inherited from fileOperation
static autoPtr< fileOperationNew (const word &type, const bool verbose)
 Select type. More...
 
- Protected Member Functions inherited from masterUncollatedFileOperation
template<class Type >
Type scatterList (const UList< Type > &) const
 
template<class Type , class fileOp >
Type masterOp (const fileName &, const fileOp &fop) const
 
template<class Type , class fileOp >
Type masterOp (const fileName &, const fileName &, const fileOp &fop) const
 
fileName filePathInfo (const bool checkGlobal, const bool isFile, const IOobject &, pathType &, word &) const
 Search for object; return info on how it was found. More...
 
- Protected Member Functions inherited from fileOperation
fileMonitormonitor () const
 
- Static Protected Member Functions inherited from masterUncollatedFileOperation
static word findInstancePath (const instantList &timeDirs, const instant &t)
 Equivalent of Time::findInstance. More...
 
static fileName objectPath (const IOobject &, const pathType &, const word &)
 Construct filePath. More...
 
static void readAndSend (const fileName &filePath, const IOstream::compressionType cmp, const labelUList &procs, PstreamBuffers &pBufs)
 Read file contents and send to processors. More...
 
- Static Protected Member Functions inherited from fileOperation
static instantList sortTimes (const fileNameList &, const word &)
 Sort directory entries according to time value. More...
 
static bool isFileOrDir (const bool isFile, const fileName &)
 Helper: check for file (isFile) or directory (!isFile) More...
 
- Protected Attributes inherited from masterUncollatedFileOperation
HashPtrTable< instantListtimes_
 Cached times for a given directory. More...
 
- Protected Attributes inherited from fileOperation
autoPtr< fileMonitormonitorPtr_
 file-change monitor for all registered files More...
 

Detailed Description

Version of masterUncollatedFileOperation that collates regIOobjects into a container in the processors/ subdirectory.

Uses threading if maxThreadFileBufferSize > 0.

See also
masterUncollatedFileOperation
Source files

Definition at line 57 of file collatedFileOperation.H.

Constructor & Destructor Documentation

◆ collatedFileOperation()

collatedFileOperation ( const bool  verbose)

Construct null.

Definition at line 174 of file collatedFileOperation.C.

References Foam::endl(), IOobject::fileModificationChecking, Foam::Info, IOobject::inotifyMaster, IOobject::timeStampMaster, and WarningInFunction.

Here is the call graph for this function:

◆ ~collatedFileOperation()

~collatedFileOperation ( )
virtual

Destructor.

Definition at line 232 of file collatedFileOperation.C.

References collatedFileOperation::objectPath().

Here is the call graph for this function:

Member Function Documentation

◆ TypeName()

TypeName ( "collated"  )

Runtime type information.

◆ objectPath()

Foam::fileName objectPath ( const IOobject io,
const word typeName 
) const
virtual

Generate disk file name for object. Opposite of filePath.

Reimplemented from fileOperation.

Definition at line 239 of file collatedFileOperation.C.

References IOobject::instance(), fileOperation::OBJECT, masterUncollatedFileOperation::objectPath(), TimePaths::processorCase(), fileOperation::PROCESSORSOBJECT, IOobject::time(), and collatedFileOperation::writeObject().

Referenced by collatedFileOperation::~collatedFileOperation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeObject()

bool writeObject ( const regIOobject io,
IOstream::streamFormat  format = IOstream::ASCII,
IOstream::versionNumber  version = IOstream::currentVersion,
IOstream::compressionType  compression = IOstream::UNCOMPRESSED,
const bool  valid = true 
) const
virtual

Member Data Documentation

◆ maxThreadFileBufferSize

float maxThreadFileBufferSize
static

Max size of thread buffer size. This is the overall size of.

all files to be written. Starts blocking if not enough size. Read as float to enable easy specificiation of large sizes.

Definition at line 91 of file collatedFileOperation.H.


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