199 static int reserveFreeTag(
const std::string& fullQualifiedMessageName,
int numberOfTags = 1);
234 void barrier(std::function<
void()> waitor = []() ->
void {} );
301 const void *sendbuf,
void *recvbuf,
int count,
302 MPI_Datatype datatype,
304 std::function<
void()> waitor = []() ->
void {}
312 const void *sendbuf,
void *recvbuf,
int count,
313 MPI_Datatype datatype,
315 std::function<
void()> waitor = []() ->
void {}
375 bool init(
int* argc,
char*** argv);
461 const std::string& className,
462 const std::string& methodName,
463 int communicationPartnerRank,
465 int numberOfExpectedMessages = 1,
466 const std::string& comment =
""
484 const std::string& className,
485 const std::string& methodName,
486 int communicationPartnerRank,
488 int numberOfExpectedMessages = 1
537 void setCommunicator( MPI_Comm communicator,
bool recomputeRankAndWorld=
true );
548 static void abort(
int errorCode);
Represents a program instance within a cluster.
void setCommunicator(MPI_Comm communicator, bool recomputeRankAndWorld=true)
Set communicator to be used by Peano.
Rank()
The standard constructor assignes the attributes default values and checks whether the program is com...
Rank(const Rank &node)=delete
You may not copy a singleton.
std::chrono::system_clock::time_point _globalTimeOutDeadlock
void setDeadlockTimeOut(int valueInSeconds)
Set deadlock time out.
static int _tagCounter
Count the tags that have already been handed out.
static int getGlobalMasterRank()
Get the global master.
int getNumberOfRanks() const
bool isInitialised() const
void triggerDeadlockTimeOut(const std::string &className, const std::string &methodName, int communicationPartnerRank, int tag, int numberOfExpectedMessages=1, const std::string &comment="")
Triggers a time out and shuts down the cluster if a timeout is violated.
bool isGlobalMaster() const
Is this node the global master process, i.e.
void setDeadlockWarningTimeStamp()
Memorise global timeout.
bool exceededTimeOutWarningThreshold() const
static int _maxTags
Set by init() and actually stores the number of valid tags.
MPI_Comm _communicator
MPI Communicator this process belongs to.
void writeTimeOutWarning(const std::string &className, const std::string &methodName, int communicationPartnerRank, int tag, int numberOfExpectedMessages=1)
Writes a warning if relevant.
int _numberOfProcessors
Number of processors available.
std::chrono::system_clock::time_point _globalTimeOutWarning
void setDeadlockTimeOutTimeStamp()
void ensureThatMessageQueuesAreEmpty(int fromRank, int tag)
Ensure that there are no messages anymore from the specified rank.
int _rank
Rank (id) of this process.
void reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, std::function< void()> waitor=[]() -> void {})
static Rank & getInstance()
This operation returns the singleton instance.
std::chrono::seconds _deadlockTimeOut
Time to timeout.
bool isMessageInQueue(int tag) const
In older DaStGen version, I tried to find out whether a particular message type is in the MPI queue.
void setTimeOutWarning(int valueInSeconds)
Set time out warning.
bool _areTimeoutsEnabled
Global toggle to enable/disable timeouts.
int getRank() const
Return rank of this node.
void receiveDanglingMessagesFromReceiveBuffers()
Receive any Message Pending in the MPI/Receive Buffers.
bool init(int *argc, char ***argv)
This operation initializes the MPI environment and the program instance.
void allReduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, std::function< void()> waitor=[]() -> void {})
void suspendTimeouts(bool timeoutsDisabled)
static tarch::logging::Log _log
Logging device.
std::chrono::seconds _timeOutWarning
Timeout warning.
void barrier(std::function< void()> waitor=[]() -> void {})
bool _initIsCalled
Is set true if init() is called.
void logStatus() const
Logs the status of the process onto the log device.
static bool validateMaxTagIsSupported()
Just try to find out if a tag is actually supported.
static int reserveFreeTag(const std::string &fullQualifiedMessageName, int numberOfTags=1)
Return a Free Tag.
virtual ~Rank()
The standard destructor calls MPI_Finalize().
static void releaseTag(int tag)
bool exceededDeadlockThreshold() const
void shutdown()
Shuts down the application.
static void abort(int errorCode)
A proper abort in an MPI context has to use MPI_Abort.
MPI_Comm getCommunicator() const
static const int DEADLOCK_EXIT_CODE
std::string MPIStatusToString(const MPI_Status &status)
Returns a string representation of the mpi status.
std::string MPIReturnValueToString(int result)
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.