35 #ifndef decomposedBlockData_H
36 #define decomposedBlockData_H
74 const off_t maxBufferSize,
76 const label startProci
201 const label startProc,
223 const bool syncReturnState =
true
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
string & note()
Return non-constant access to the optional note.
const word & name() const
Return name.
streamFormat
Enumeration for the format of data in the stream.
compressionType
Enumeration for the format of data in the stream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
A List obtained as a section of another List.
T * data()
Return a pointer to the first data element,.
commsTypes
Types of communications.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
decomposedBlockData is a List<char> with IO on the master processor only.
static bool writeBlocks(const label comm, autoPtr< OSstream > &osPtr, List< std::streamoff > &start, const UList< char > &masterData, const labelUList &recvSizes, const PtrList< SubList< char >> &slaveData, const UPstream::commsTypes, const bool syncReturnState=true)
Write *this. Ostream only valid on master. Returns starts of.
static void gatherSlaveData(const label comm, const UList< char > &data, const labelUList &recvSizes, const label startProc, const label nProcs, List< int > &recvOffsets, List< char > &recvData)
Helper: gather data from (subset of) slaves. Returns.
virtual bool writeData(Ostream &) const
Write separated content. Assumes content is the serialised data.
static bool readMasterHeader(IOobject &, Istream &)
Read header. Call only on master.
TypeName("decomposedBlockData")
virtual bool writeObject(IOstream::streamFormat, IOstream::versionNumber, IOstream::compressionType, const bool write) const
Write using given format, version and compression.
const label comm_
Communicator for all parallel comms.
static void gather(const label comm, const label data, labelList &datas)
Helper: gather single label. Note: using native Pstream.
static label numBlocks(const fileName &)
Detect number of blocks in a file.
static void writeHeader(Ostream &os, const IOstream::versionNumber version, const IOstream::streamFormat format, const word &type, const string ¬e, const fileName &location, const word &name)
Helper: write FoamFile IOobject header.
decomposedBlockData(const label comm, const IOobject &, const UPstream::commsTypes=UPstream::commsTypes::scheduled)
Construct given an IOobject.
static bool readBlocks(const label comm, autoPtr< ISstream > &isPtr, List< char > &data, const UPstream::commsTypes commsType)
Read data into *this. ISstream is only valid on master.
static autoPtr< ISstream > readBlock(const label blocki, Istream &is, IOobject &headerIO)
Read selected block (non-seeking) + header information.
static label calcNumProcs(const label comm, const off_t maxBufferSize, const labelUList &recvSizes, const label startProci)
Helper: determine number of processors whose recvSizes fits.
virtual bool read()
Read object.
const UPstream::commsTypes commsType_
Type to use for gather.
virtual ~decomposedBlockData()
Destructor.
A class for handling file names.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
virtual bool write(const bool write=true) const
Write using setting from DB.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
word format(conversionProperties.lookup("format"))