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)
 
virtual ~OFstreamCollator ()
 Destructor. More...
 
bool write (const word &objectType, const fileName &, const string &data, IOstreamOption streamOpt, const bool append, const bool useThread=true, const dictionary &headerEntries=dictionary::null)
 Write file with contents. 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)
Source files

Definition at line 70 of file OFstreamCollator.H.

Constructor & Destructor Documentation

◆ OFstreamCollator() [1/2]

OFstreamCollator ( const off_t  maxBufferSize)
explicit

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

Definition at line 286 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 specified communicator

Definition at line 302 of file OFstreamCollator.C.

◆ ~OFstreamCollator()

~OFstreamCollator ( )
virtual

Destructor.

Definition at line 324 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 objectType,
const fileName fName,
const string data,
IOstreamOption  streamOpt,
const bool  append,
const bool  useThread = true,
const dictionary headerEntries = dictionary::null 
)

◆ waitAll()

void waitAll ( )

Wait for all thread actions to have finished.

Definition at line 584 of file OFstreamCollator.C.

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

Here is the call graph for this function:

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