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... | |
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):
Operation determine
Definition at line 69 of file OFstreamCollator.H.
OFstreamCollator | ( | const off_t | maxBufferSize | ) |
Construct from buffer size. 0 = do not use thread.
Definition at line 295 of file OFstreamCollator.C.
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.
|
virtual |
Destructor.
Definition at line 333 of file OFstreamCollator.C.
References Foam::endl(), UPstream::freeCommunicator(), and Foam::Pout.
TypeName | ( | "OFstreamCollator" | ) |
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 |
||
) |
Write file with contents. Blocks until writethread has space.
available (total file sizes < maxBufferSize)
Definition at line 354 of file OFstreamCollator.C.
References Foam::abort(), UList< T >::begin(), UList< T >::byteSize(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, decomposedBlockData::gather(), UPstream::haveThreads(), UPstream::master(), Foam::max(), UPstream::msgType(), UPstream::nonBlocking, UPstream::nRequests(), string::null, Foam::Pout, autoPtr< T >::ptr(), UIPstream::read(), Pstream::scatter(), PtrList< T >::set(), PtrList< T >::setSize(), UPtrList< T >::size(), List< T >::size(), UPstream::waitRequests(), UOPstream::write(), and writeData().
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.