Go to the documentation of this file.
122 const label myProcID,
131 label
above() const noexcept
189 static bool haveThreads_;
235 static void collectReceives
243 static void allocatePstreamCommunicator
245 const label parentIndex,
250 static void freePstreamCommunicator
316 const bool doPstream =
true
322 const label communicator,
323 const bool doPstream =
true
357 operator label() const noexcept
369 static label
procNo(
const label comm,
const int baseProcID);
376 const label currentComm,
377 const int currentProcID
386 static bool init(
int& argc,
char**& argv,
const bool needsThread);
418 static void freeTag(
const char*,
const int tag);
425 static bool parRun(
const bool on) noexcept
434 static bool&
parRun() noexcept
452 static constexpr
int masterNo() noexcept
564 static void shutdown(
int errNo = 0);
570 static void exit(
int errNo = 1);
588 const char* sendData,
602 const char* sendData,
613 const char* sendData,
624 const char* sendData,
636 const char* sendData,
685 Ostream&
operator<<(Ostream&,
const UPstream::commsStruct&);
689 UPstream::commsStruct&
693 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.
commsTypes commsType() const noexcept
Get the communications type of the stream.
static constexpr int masterNo() noexcept
Process index of the master (always 0)
A class for handling words, derived from Foam::string.
commsStruct()
Default construct. Above == -1.
static int baseProcNo(const label myComm, const int procID)
static void mpiGather(const char *sendData, int sendSize, char *recvData, int recvSize, const label communicator=worldComm)
Receive data from all processors on the master (low-level)
An interval of (signed) integers defined by a start and a size.
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.
commsTypes commsType(const commsTypes ct) noexcept
Set the communications type of the stream.
const labelList & below() const noexcept
UPstream(const commsTypes commsType)
Construct for given communication type.
static bool haveThreads() noexcept
Have support for threads.
#define forAll(list, i)
Loop across all elements in list.
bool operator==(const commsStruct &) const
static const wordList & allWorlds() noexcept
All worlds.
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.
const labelList & allNotBelow() const noexcept
static T listScatterValues(const UList< T > &allValues, const label communicator=worldComm)
Individual values into list locations.
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.
static void mpiScatter(const char *sendData, int sendSize, char *recvData, int recvSize, const label communicator=worldComm)
Send data to all processors from master (low-level)
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 labelList & worldIDs() noexcept
worldID (index in allWorlds) of all processes
static const word & myWorld()
My world.
Structure for communicating between processors.
static List< T > listGatherValues(const T &localValue, const label communicator=worldComm)
Individual values into list locations.
static int nProcsSimpleSum
static constexpr int firstSlave() noexcept
Process index of first sub-process.
A HashTable similar to std::unordered_map.
commsTypes
Types of communications.
static rangeType allProcs(const label communicator=worldComm)
Range of process indices for all processes.
static int & msgType() noexcept
Message tag of standard messages.
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)
static bool & parRun() noexcept
Test if this a parallel run.
T & operator[](const label i)
Return element of UList.
static label procNo(const label comm, const int baseProcID)
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.
const labelList & allBelow() const noexcept
label above() const noexcept
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.
static void exit(int errNo=1)
Shutdown (finalize) MPI as required and exit program with errNo.
static void freeTag(const char *, const int tag)