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 specified communicator. More... | |
| virtual | ~OFstreamCollator () |
| Destructor. More... | |
| bool | write (const word &objectType, const fileName &, const string &data, IOstreamOption streamOpt, IOstreamOption::atomicType atomic, IOstreamOption::appendType 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... | |
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.
Definition at line 281 of file OFstreamCollator.C.
| OFstreamCollator | ( | const off_t | maxBufferSize, |
| const label | comm | ||
| ) |
Construct from buffer size (0 = do not use thread) and specified communicator.
Definition at line 298 of file OFstreamCollator.C.
|
virtual |
Destructor.
Definition at line 319 of file OFstreamCollator.C.
References Foam::ensightOutput::debug, Foam::endl(), UPstream::freeCommunicator(), and Foam::Pout.

| TypeName | ( | "OFstreamCollator" | ) |
| bool write | ( | const word & | objectType, |
| const fileName & | fName, | ||
| const string & | data, | ||
| IOstreamOption | streamOpt, | ||
| IOstreamOption::atomicType | atomic, | ||
| IOstreamOption::appendType | append, | ||
| const bool | useThread = true, |
||
| const dictionary & | headerEntries = dictionary::null |
||
| ) |
Write file with contents.
Blocks until writethread has space available (total file sizes < maxBufferSize)
Definition at line 338 of file OFstreamCollator.C.
References Foam::abort(), append(), Pstream::broadcasts(), UList< T >::cdata(), Foam::ensightOutput::debug, 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(), PtrList< T >::set(), PtrList< T >::setSize(), UList< T >::size(), UPtrList< T >::size(), UList< T >::size_bytes(), UPstream::waitRequests(), UOPstream::write(), and Foam::writeData().
Referenced by threadedCollatedOFstream::~threadedCollatedOFstream().


| void waitAll | ( | ) |
Wait for all thread actions to have finished.
Definition at line 580 of file OFstreamCollator.C.
References Foam::ensightOutput::debug, Foam::endl(), UPstream::master(), and Foam::Pout.

Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.