Accelerated Computation Engine
|
#include <ace_qmpi.h>
Public Slots | |
void | sendData (int toRank, const QByteArray &data) |
void | sendLocalData (int toRank, const QByteArray &data) |
Signals | |
void | dataReceived (const QByteArray &data, int fromRank) |
void | localDataReceived (const QByteArray &data, int fromRank) |
Public Member Functions | |
bool | isMaster () const |
int | size () const |
int | rank () const |
int | localSize () const |
int | localRank () const |
void | start () |
void | stop () |
Static Public Member Functions | |
static QMPI & | instance () |
static void | shutdown () |
Protected Member Functions | |
virtual void | timerEvent (QTimerEvent *event) override final |
This is a wrapper to the MPI interface. It provides support for basic MPI functionality including initializing MPI, getting rank and size for world and local, and sending and receiving data for world and local. This provides sending and receiving of data by using Qt slots and signals to allow for event handling through Qt's event handling system. This is a singleton class which only has a single instance you can access through a special static function. This singleton class is however special in it has to be shutdown before exiting the program and cannot be initialized more than once. This requirement is due to how MPI works.
Listening for incoming MPI messages can also be enabled or disabled, and is disabled by default.
|
signal |
Signals that new data has been received from the world MPI comm.
data | The data received from the world comm. |
fromRank | The rank of the node that sent this data. |
|
static |
This returns a reference to the singleton instance of this class if shutdown of another instance has not occurred. If MPI was already initialized it simply returns a reference to the instance.
bool QMPI::isMaster | ( | ) | const |
Tests if this process is the master node (rank 0).
|
signal |
Signals that new data has been received from the local shared resource MPI comm.
data | The data received from the local comm. |
fromRank | The local rank of the node that sent this data. |
int QMPI::localRank | ( | ) | const |
Returns the local rank of this node to identify it within the number of other nodes that share its local resources.
int QMPI::localSize | ( | ) | const |
Returns the local size representing the number of nodes that share local resources.
int QMPI::rank | ( | ) | const |
Returns the world rank of this node.
|
slot |
Called to send data to another node using the world MPI comm. This is asynchronous and returns immediately.
toRank | The rank of the node to send this data to. |
data | The data that is sent to the node with the given rank. |
|
slot |
Called to send data to another node using the local MPI comm. This is asynchronous and returns immediately.
toRank | The rank of the process to send this data to. |
data | Stores the raw data that will be sent to the given process. |
|
static |
This deletes the singleton instance of this class thereby shutting down the MPI system. After calling this another instance cannot be initialized or referenced.
int QMPI::size | ( | ) | const |
Returns world node size.
void QMPI::start | ( | ) |
Enables listening to incoming MPI messages and emitting signals when they are received.
void QMPI::stop | ( | ) |
Disables listening to incoming MPI messages, leaving any pending messages until it is enabled.
|
finaloverrideprotectedvirtual |
Implements the QObject interface that is called whenever the timer event is fired. This function is used to poll for new data from the MPI system without blocking and firing signals for any new data received.
event | Ignored Qt event data since this class only has a single timer event active. |