OFstreamCollator Class Reference

Threaded file writer. More...

Public Member Functions

 TypeName ("OFstreamCollator")
 
 OFstreamCollator (const off_t maxBufferSize)
 Construct from buffer size. 0 = do not use thread. More...
 
 OFstreamCollator (const off_t maxBufferSize, const label comm)
 Construct from buffer size (0 = do not use thread) and local. More...
 
virtual ~OFstreamCollator ()
 Destructor. More...
 
bool write (const word &typeName, const fileName &, const string &data, IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool append, const bool useThread=true)
 Write file with contents. Blocks until writethread has space. More...
 
void waitAll ()
 Wait for all thread actions to have finished. More...
 

Detailed Description

Threaded file writer.

Collects all data from all processors and writes as single 'decomposedBlockData' file. The operation is determined by the buffer size (maxThreadFileBufferSize setting):

  • local size of data is larger than buffer: receive and write processor by processor (i.e. 'scheduled'). Does not use a thread, no file size limit.
  • total size of data is larger than buffer (but local is not): thread does all the collecting and writing of the processors. No file size limit.
  • total size of data is less than buffer: collecting is done locally; the thread only does the writing (since the data has already been collected)

Operation determine

Source files

Definition at line 69 of file OFstreamCollator.H.

Constructor & Destructor Documentation

◆ OFstreamCollator() [1/2]

OFstreamCollator ( const off_t  maxBufferSize)

Construct from buffer size. 0 = do not use thread.

Definition at line 295 of file OFstreamCollator.C.

◆ OFstreamCollator() [2/2]

OFstreamCollator ( const off_t  maxBufferSize,
const label  comm 
)

Construct from buffer size (0 = do not use thread) and local.

thread

Definition at line 311 of file OFstreamCollator.C.

◆ ~OFstreamCollator()

~OFstreamCollator ( )
virtual

Destructor.

Definition at line 333 of file OFstreamCollator.C.

References Foam::endl(), UPstream::freeCommunicator(), and Foam::Pout.

Here is the call graph for this function:

Member Function Documentation

◆ TypeName()

TypeName ( "OFstreamCollator"  )

◆ write()

bool write ( const word typeName,
const fileName fName,
const string data,
IOstream::streamFormat  fmt,
IOstream::versionNumber  ver,
IOstream::compressionType  cmp,
const bool  append,
const bool  useThread = true 
)

◆ waitAll()

void waitAll ( )

Wait for all thread actions to have finished.

Definition at line 598 of file OFstreamCollator.C.

References Foam::endl(), UPstream::master(), and Foam::Pout.

Here is the call graph for this function:

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