Go to the documentation of this file.
119 const label myProcID,
189 static bool haveThreads_;
228 static void collectReceives
236 static void allocatePstreamCommunicator
238 const label parentIndex,
243 static void freePstreamCommunicator
308 const bool doPstream =
true
314 const label communicator,
315 const bool doPstream =
true
349 operator label()
const
368 const label currentComm,
369 const int currentProcID
378 static bool init(
int& argc,
char**& argv,
const bool needsThread);
409 static void freeTag(
const char*,
const int tag);
433 static constexpr
int masterNo() noexcept
514 static void exit(
int errnum = 1);
526 const label communicator = 0
535 const char* sendData,
543 const label communicator = 0
549 const char* sendData,
555 const label communicator = 0
561 const char* sendData,
567 const label communicator = 0
572 Ostream&
operator<<(Ostream&,
const UPstream::commsStruct&);
576 UPstream::commsStruct&
580 const UPstream::commsStruct&
static int allocateTag(const char *)
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
static void resetRequests(const label sz)
Truncate number of outstanding requests.
static constexpr int masterNo() noexcept
Process index of the master.
A class for handling words, derived from Foam::string.
commsStruct()
Construct null.
static int baseProcNo(const label myComm, const int procID)
static bool haveThreads()
Have support for threads.
static void exit(int errnum=1)
Exit program.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
combineReduce operator for lists. Used for counting.
friend Ostream & operator<<(Ostream &, const commsStruct &)
static void waitRequests(const label start=0)
Wait until all requests (from start onwards) have finished.
static void abort()
Abort program.
static commsTypes defaultCommsType
Default commsType.
static void allToAll(const labelUList &sendData, labelUList &recvData, const label communicator=0)
Exchange label with all processors (in the communicator).
static void gather(const char *sendData, int sendSize, char *recvData, const UList< int > &recvSizes, const UList< int > &recvOffsets, const label communicator=0)
Receive data from all processors on the master.
UPstream(const commsTypes commsType)
Construct given optional buffer size.
#define forAll(list, i)
Loop across all elements in list.
bool operator==(const commsStruct &) const
const labelList & allBelow() const
static const int mpiBufferSize
MPI buffer-size (bytes)
static label allocateCommunicator(const label parent, const labelList &subRanks, const bool doPstream=true)
Allocate a new communicator.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Inter-processor communications stream.
static int lastSlave(const label communicator=0)
Process index of last slave.
static bool floatTransfer
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static void waitRequest(const label i)
Wait until request i has finished.
commsTypes commsType() const
Get the communications type of the stream.
static void addValidParOptions(HashTable< string > &validParOptions)
static List< int > & procID(label communicator)
Process ID of given process index.
static void freeCommunicator(const label communicator, const bool doPstream=true)
Free a previously allocated communicator.
static const Enum< commsTypes > commsTypeNames
Names of the communication types.
static void scatter(const char *sendData, const UList< int > &sendSizes, const UList< int > &sendOffsets, char *recvData, int recvSize, const label communicator=0)
Send data to all processors from the root of the communicator.
const labelList & allNotBelow() const
Structure for communicating between processors.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static bool master(const label communicator=0)
Am I the master process.
static int nProcsSimpleSum
static constexpr int firstSlave() noexcept
Process index of first slave.
A HashTable similar to std::unordered_map.
static int & msgType()
Message tag of standard messages.
commsTypes
Types of communications.
static label nRequests()
Get number of outstanding requests.
void operator()(T &x, const T &y) const
commsTypes commsType_
Communications type of this stream.
static bool initNull()
Special purpose initialisation function.
static int maxCommsSize
Optional maximum message size (bytes)
static label worldComm
Default communicator (all processors)
T & operator[](const label i)
Return element of UList.
label ListType::const_reference const label start
static label procNo(const label comm, const int baseProcID)
commsTypes commsType(const commsTypes ct)
Set the communications type of the stream.
static bool finishedRequest(const label i)
Non-blocking comms: has request i finished?
static void freeCommunicators(const bool doPstream)
Free all communicators.
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static label parent(const label communicator)
Helper class for allocating/freeing communicators.
static const List< commsStruct > & linearCommunication(const label communicator=0)
Communication schedule for linear all-to-master (proc 0)
static bool init(int &argc, char **&argv, const bool needsThread)
Initialisation function called from main.
bool operator!=(const commsStruct &) const
Ostream & operator<<(Ostream &, const boundaryPatch &)
static int nPollProcInterfaces
Number of polling cycles in processor updates.
const labelList & below() const
static const List< commsStruct > & treeCommunication(const label communicator=0)
Communication schedule for tree all-to-master (proc 0)
static void freeTag(const char *, const int tag)