Go to the documentation of this file.
122 const label myProcID,
192 static bool haveThreads_;
238 static void collectReceives
246 static void allocatePstreamCommunicator
248 const label parentIndex,
253 static void freePstreamCommunicator
318 const bool doPstream =
true
324 const label communicator,
325 const bool doPstream =
true
359 operator label()
const
371 static label
procNo(
const label comm,
const int baseProcID);
378 const label currentComm,
379 const int currentProcID
388 static bool init(
int& argc,
char**& argv,
const bool needsThread);
420 static void freeTag(
const char*,
const int tag);
427 static bool parRun(
const bool on)
453 static constexpr
int masterNo() noexcept
565 static void shutdown(
int errNo = 0);
571 static void exit(
int errNo = 1);
589 const char* sendData,
603 const char* sendData,
615 const char* sendData,
643 Ostream&
operator<<(Ostream&,
const UPstream::commsStruct&);
647 UPstream::commsStruct&
651 const UPstream::commsStruct&
static int allocateTag(const char *)
static label warnComm
Debugging: warn for use of any communicator differing from warnComm.
static const List< commsStruct > & linearCommunication(const label communicator=worldComm)
Communication schedule for linear all-to-master (proc 0)
static void resetRequests(const label sz)
Truncate number of outstanding requests.
static constexpr int masterNo() noexcept
Process index of the master (always 0)
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.
An interval of (signed) integers defined by a start and a size.
static const labelList & worldIDs()
worldID (index in allWorlds) of all processes
static bool & parRun()
Test if this a parallel run, or allow modify access.
static int lastSlave(const label communicator=worldComm)
Process index of last sub-process.
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 bool master(const label communicator=worldComm)
Am I the master process.
static void abort()
Call MPI_Abort with no other checks or cleanup.
static commsTypes defaultCommsType
Default commsType.
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
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
static rangeType subProcs(const label communicator=worldComm)
Range of process indices for sub-processes.
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.
static label myWorldID()
My worldID.
Inter-processor communications stream.
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 const word & myWorld()
My world.
const labelList & allNotBelow() const
static const wordList & allWorlds()
All worlds.
Structure for communicating between processors.
static int nProcsSimpleSum
static constexpr int firstSlave() noexcept
Process index of first sub-process.
A HashTable similar to std::unordered_map.
static int & msgType()
Message tag of standard messages.
commsTypes
Types of communications.
static rangeType allProcs(const label communicator=worldComm)
Range of process indices for all processes.
static label nRequests()
Get number of outstanding requests.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
void operator()(T &x, const T &y) const
commsTypes commsType_
Communications type of this stream.
static void scatter(const char *sendData, const UList< int > &sendSizes, const UList< int > &sendOffsets, char *recvData, int recvSize, const label communicator=worldComm)
Send data to all processors from the root of the communicator.
IntRange< int > rangeType
Int ranges are used for MPI ranks (processes)
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.
static label procNo(const label comm, const int baseProcID)
commsTypes commsType(const commsTypes ct)
Set the communications type of the stream.
static void shutdown(int errNo=0)
Shutdown (finalize) MPI as required.
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.
static const List< commsStruct > & treeCommunication(const label communicator=worldComm)
Communication schedule for tree all-to-master (proc 0)
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 bool init(int &argc, char **&argv, const bool needsThread)
Initialisation function called from main.
static void allToAll(const labelUList &sendData, labelUList &recvData, const label communicator=worldComm)
Exchange label with all processors (in the communicator).
bool operator!=(const commsStruct &) const
static label nProcs(const label communicator=worldComm)
Number of processes in parallel run, and 1 for serial run.
static void gather(const char *sendData, int sendSize, char *recvData, const UList< int > &recvSizes, const UList< int > &recvOffsets, const label communicator=worldComm)
Receive data from all processors on the master.
static int nPollProcInterfaces
Number of polling cycles in processor updates.
const labelList & below() const
static void exit(int errNo=1)
Shutdown (finalize) MPI as required and exit program with errNo.
static void freeTag(const char *, const int tag)