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
361 static label
procNo(
const label comm,
const int baseProcID);
368 const label currentComm,
369 const int currentProcID
378 static bool init(
int& argc,
char**& argv,
const bool needsThread);
410 static void freeTag(
const char*,
const int tag);
434 static constexpr
int masterNo() noexcept
516 static void shutdown(
int errNo = 0);
522 static void exit(
int errNo = 1);
531 const label communicator = 0
540 const char* sendData,
548 const label communicator = 0
554 const char* sendData,
560 const label communicator = 0
566 const char* sendData,
572 const label communicator = 0
577 Ostream&
operator<<(Ostream&,
const UPstream::commsStruct&);
581 UPstream::commsStruct&
585 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 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()
Call MPI_Abort with no other checks or cleanup.
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
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
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.
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.
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.
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
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 exit(int errNo=1)
Shutdown (finalize) MPI as required and exit program with errNo.
static void freeTag(const char *, const int tag)