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. | |
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):
Definition at line 66 of file OFstreamCollator.H.
|
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().


| 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.
|
virtual |
Destructor.
Definition at line 282 of file OFstreamCollator.C.
References Foam::endl(), UPstream::freeCommunicator(), and Foam::Pout.

| TypeName | ( | "OFstreamCollator" | ) |
| 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.
Blocks until write-thread has space available (total file sizes < maxBufferSize)
Definition at line 300 of file OFstreamCollator.C.
References Foam::abort(), append(), UPstream::broadcast, Foam::endl(), Foam::FatalError, FatalErrorInFunction, forAllReverse, UPstream::haveThreads(), UPstream::is_subrank(), UPstream::listGatherValues(), UPstream::master(), UPstream::masterNo(), Foam::max(), UPstream::msgType(), Foam::nl, UPstream::nonBlocking, UPstream::nProcs(), UPstream::nRequests(), UList< T >::null(), Foam::Pout, DynamicList< T, SizeMin >::push_back(), UIPstream::read(), DynamicList< T, SizeMin >::reserve_exact(), List< T >::resize_nocopy(), UList< T >::size(), Foam::sortedOrder(), UPstream::waitRequests(), WarningInFunction, and UOPstream::write().
Referenced by write().


|
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().

| 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.
