Go to the documentation of this file.
32 const label localSize,
38 offsets_(Pstream::nProcs(comm)+1)
40 labelList localSizes(Pstream::nProcs(comm), 0);
41 localSizes[Pstream::myProcNo(comm)] = localSize;
44 Pstream::gatherList(localSizes, tag, comm);
45 Pstream::scatterList(localSizes, tag, comm);
50 for (
label procI = 0; procI < Pstream::nProcs(comm); procI++)
52 label oldOffset = offset;
53 offset += localSizes[procI];
55 if (offset < oldOffset)
58 <<
"Overflow : sum of sizes " << localSizes
59 <<
" exceeds capability of label (" <<
labelMax
60 <<
"). Please recompile with larger datatype for label."
63 offsets_[procI+1] = offset;
82 offset += localSizes[procI];
87 <<
"Overflow : sum of sizes " << localSizes
88 <<
" exceeds capability of label (" <<
labelMax
89 <<
"). Please recompile with larger datatype for label."
globalIndex()
Construct null.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static const label labelMax
static label nProcs(const label communicator=0)
Number of processes in parallel run.
label localSize() const
My local size.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
label offset(const label procI) const
Start of procI data.
Ostream & operator<<(Ostream &, const edgeMesh &)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
errorManipArg< error, int > exit(error &err, const int errNo=1)
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static int & msgType()
Message tag of standard messages.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
Inter-processor communications stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Istream & operator>>(Istream &, edgeMesh &)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
labelList offsets_
Start of procI. Size is nProcs()+1. (so like CompactListList)