Loading...
Searching...
No Matches
OFstreamCollator Class Reference

Threaded file writer. More...

#include <OFstreamCollator.H>

Public Member Functions

 TypeName ("OFstreamCollator")
 OFstreamCollator (const off_t maxBufferSize)
 Construct from buffer size (0 = do not use thread) and with worldComm.
 OFstreamCollator (const off_t maxBufferSize, const label comm)
 Construct from buffer size (0 = do not use thread) and specified communicator.
virtual ~OFstreamCollator ()
 Destructor.
bool write (const word &objectType, const fileName &fName, DynamicList< char > &&localData, IOstreamOption streamOpt, IOstreamOption::atomicType atomic, IOstreamOption::appendType append, const bool useThread=true, const dictionary &headerEntries=dictionary::null)
 Write file with contents, possibly taking ownership of the content.
bool write (const word &objectType, const fileName &fName, const std::string &s, IOstreamOption streamOpt, IOstreamOption::atomicType atomic, IOstreamOption::appendType append, const bool useThread=true, const dictionary &headerEntries=dictionary::null)
 Write file with contents.
void waitAll ()
 Wait for all thread actions to have finished.

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 66 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) and with worldComm.

Definition at line 261 of file OFstreamCollator.C.

References OFstreamCollator().

Referenced by OFstreamCollator().

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

◆ 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 267 of file OFstreamCollator.C.

◆ ~OFstreamCollator()

~OFstreamCollator ( )
virtual

Destructor.

Definition at line 282 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" )

References append(), and dictionary::null.

Here is the call graph for this function:

◆ write() [1/2]

bool write ( const word & objectType,
const fileName & fName,
DynamicList< char > && localData,
IOstreamOption streamOpt,
IOstreamOption::atomicType atomic,
IOstreamOption::appendType append,
const bool useThread = true,
const dictionary & headerEntries = dictionary::null )

◆ write() [2/2]

bool write ( const word & objectType,
const fileName & fName,
const std::string & s,
IOstreamOption streamOpt,
IOstreamOption::atomicType atomic,
IOstreamOption::appendType append,
const bool useThread = true,
const dictionary & headerEntries = dictionary::null )
inline

Write file with contents.

Definition at line 256 of file OFstreamCollator.H.

References append(), UList< T >::begin(), DynamicList< T, SizeMin >::resize(), s(), write(), and write().

Here is the call graph for this function:

◆ waitAll()

void waitAll ( )

Wait for all thread actions to have finished.

Definition at line 639 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: