#include "modules/NetMPI/include/MPICommunicator.hpp"
Public Member Functions | |
MPICommunicator (MPI_Comm comm=MPI_COMM_WORLD) | |
MPICommunicator (std::shared_ptr< PanNDE::Mesh > mesh, MPI_Comm comm=MPI_COMM_WORLD) | |
~MPICommunicator () | |
void | Init (int &argc, char **&argv) override |
void | Init (int &argc, char **&argv, std::shared_ptr< PanNDE::Mesh > mesh) override |
int | getProcessId () override |
int | getGlobalId () override |
int | getNumberOfProcesses () override |
int | getNumberOfAllProcesses () override |
void | Finalize () override |
void | determineExchangePattern (std::shared_ptr< PanNDE::Mesh > mesh) override |
void | setupDataLinks (std::string keyname, std::shared_ptr< PanNDE::Field > field) override |
void | setupDataLinks (std::shared_ptr< PanNDE::FieldBundle > fields) override |
void | startHaloExchange (std::string keyname) override |
void | waitUntilDone (std::string keyname) override |
void | sendArray (std::shared_ptr< PanNDE::Array< double >> array, int receiver) override |
void | sendArray (double *array, int N, int receiver) override |
std::shared_ptr< PanNDE::Array< double > > | recvArray (std::shared_ptr< PanNDE::ArrayFactory< double >> maker, int sender) override |
void | broadcastArray (std::shared_ptr< PanNDE::Array< double >> &array, int sender=0) override |
void | sendArray (std::shared_ptr< PanNDE::Array< int32_t >> array, int receiver) override |
void | sendArray (int32_t *array, int N, int receiver) override |
std::shared_ptr< PanNDE::Array< int32_t > > | recvArray (std::shared_ptr< PanNDE::ArrayFactory< int32_t >> maker, int sender) override |
void | broadcastArray (std::shared_ptr< PanNDE::Array< int32_t >> &array, int sender=0) override |
void | sendArray (std::shared_ptr< PanNDE::Array< int64_t >> array, int receiver) override |
void | sendArray (int64_t *array, int N, int receiver) override |
std::shared_ptr< PanNDE::Array< int64_t > > | recvArray (std::shared_ptr< PanNDE::ArrayFactory< int64_t >> maker, int sender) override |
void | broadcastArray (std::shared_ptr< PanNDE::Array< int64_t >> &array, int sender=0) override |
void | sendValue (double value, int receiver) override |
void | recvValue (double *value, int sender) override |
void | broadcastValue (double *value, int sender=0) override |
std::shared_ptr< PanNDE::Array< double > > | allGatherValue (double value, std::shared_ptr< PanNDE::ArrayFactory< double >> maker) override |
void | sendValue (int32_t value, int receiver) override |
void | recvValue (int32_t *value, int sender) override |
void | broadcastValue (int32_t *value, int sender=0) override |
std::shared_ptr< PanNDE::Array< int32_t > > | allGatherValue (int32_t value, std::shared_ptr< PanNDE::ArrayFactory< int32_t >> maker) override |
void | sendValue (int64_t value, int receiver) override |
void | recvValue (int64_t *value, int sender) override |
void | broadcastValue (int64_t *value, int sender=0) override |
std::shared_ptr< PanNDE::Array< int64_t > > | allGatherValue (int64_t value, std::shared_ptr< PanNDE::ArrayFactory< int64_t >> maker) override |
void | waitall () override |
void | barrier () override |
![]() | |
virtual void | Init (int &argc, char **&argv, std::shared_ptr< PanNDE::Mesh > mesh)=0 |
virtual void | determineExchangePattern (std::shared_ptr< PanNDE::Mesh > mesh)=0 |
virtual void | setupDataLinks (std::string keyname, std::shared_ptr< PanNDE::Field > field)=0 |
virtual void | setupDataLinks (std::shared_ptr< PanNDE::FieldBundle > fields)=0 |
virtual void | sendArray (std::shared_ptr< PanNDE::Array< double >> array, int receiver)=0 |
virtual std::shared_ptr< PanNDE::Array< double > > | recvArray (std::shared_ptr< PanNDE::ArrayFactory< double >> maker, int sender)=0 |
virtual void | broadcastArray (std::shared_ptr< PanNDE::Array< double >> &array, int sender=0)=0 |
virtual void | sendArray (std::shared_ptr< PanNDE::Array< int32_t >> array, int receiver)=0 |
virtual std::shared_ptr< PanNDE::Array< int32_t > > | recvArray (std::shared_ptr< PanNDE::ArrayFactory< int32_t >> maker, int sender)=0 |
virtual void | broadcastArray (std::shared_ptr< PanNDE::Array< int32_t >> &array, int sender=0)=0 |
virtual void | sendArray (std::shared_ptr< PanNDE::Array< int64_t >> array, int receiver)=0 |
virtual std::shared_ptr< PanNDE::Array< int64_t > > | recvArray (std::shared_ptr< PanNDE::ArrayFactory< int64_t >> maker, int sender)=0 |
virtual void | broadcastArray (std::shared_ptr< PanNDE::Array< int64_t >> &array, int sender=0)=0 |
virtual std::shared_ptr< PanNDE::Array< double > > | allGatherValue (double value, std::shared_ptr< PanNDE::ArrayFactory< double >> maker)=0 |
virtual std::shared_ptr< PanNDE::Array< int32_t > > | allGatherValue (int32_t value, std::shared_ptr< PanNDE::ArrayFactory< int32_t >> maker)=0 |
virtual std::shared_ptr< PanNDE::Array< int64_t > > | allGatherValue (int64_t value, std::shared_ptr< PanNDE::ArrayFactory< int64_t >> maker)=0 |
"MPICommunicator.hpp" implements the data communication among processes. This wraps MPI
|
inline |
constructor
comm | MPI communicator to setup |
|
inline |
constructor
mesh | mesh for comms patterns for halo exchange |
comm | MPI communicator to setup |
|
inline |
destructor
|
inlineoverride |
all broadcast value for placement in array by process index
value | the value to send |
maker | the array factory to build the synthesized array |
|
inlineoverride |
all broadcast value for placement in array by process index
value | the value to send |
maker | the array factory to build the synthesized array |
|
inlineoverride |
all broadcast value for placement in array by process index
value | the value to send |
maker | the array factory to build the synthesized array |
|
inlineoverridevirtual |
wait for all processes to arrive
Implements PanNDE::Communicator.
|
inlineoverride |
broadcast array by process
array | the array to be either populated or sent |
sender | process which broadcasts the array |
|
inlineoverride |
broadcast array by process
array | the array to be either populated or sent |
sender | process which broadcasts the array |
|
inlineoverride |
broadcast array by process
array | the array to be either populated or sent |
sender | process which broadcasts the array |
|
inlineoverridevirtual |
broadcast value to all processes
value | the address to which to write (if receiving) or send (if broadcasting) |
sender | process which sent the value |
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
broadcast value to all processes
value | the address to which to write (if receiving) or send (if broadcasting) |
sender | process which sent the value |
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
broadcast value to all processes
value | the address to which to write (if receiving) or send (if broadcasting) |
sender | process which sent the value |
Implements PanNDE::Communicator.
|
inlineoverride |
use the local mesh to determine the halo exchange pattern. Not recommended approach, but retained for backwards compatibility
mesh | the local mesh from which the communication pattern can be determined |
|
inlineoverridevirtual |
release commmunicator assets
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
get the id number of the process in the global communicator
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
get the number of processes on the global communicator
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
get the number of processes on the local communicator
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
get the id number of the process in the local communicator
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
Initialize a communicator object. As many initializers (e.g. MPI, VTK, etc.) require the arguments to ‘int main()’, they are passed through here.
argc | number of arguments in argv |
argv | the command line arguments provided to int main() |
Implements PanNDE::Communicator.
|
inlineoverride |
Initialize a communicator object. As many initializers (e.g. MPI, VTK, etc.) require the arguments to ‘int main()’, they are passed through here. The data exchange pattern can be determined for final configuration if the mesh is passed in
argc | number of arguments in argv |
argv | the command line arguments provided to int main() |
mesh | the local mesh for simulation |
|
inlineoverride |
Receive array from process
maker | the array factory method required to build the array |
sender | process which sent the array |
|
inlineoverride |
Receive array from process
maker | the array factory method required to build the array |
sender | process which sent the array |
|
inlineoverride |
Receive array from process
maker | the array factory method required to build the array |
sender | process which sent the array |
|
inlineoverridevirtual |
receive value from process
value | the address to which to write |
sender | process which sent the value |
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
receive value from process
value | the address to which to write |
sender | process which sent the value |
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
receive value from process
value | the address to which to write |
sender | process which sent the value |
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
Send array to process
array | the array to send |
N | the length of the array |
receiver | process to receive the array |
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
Send array to process
array | the array to send |
N | the length of the array |
receiver | process to receive the array |
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
Send array to process
array | the array to send |
N | the length of the array |
receiver | process to receive the array |
Implements PanNDE::Communicator.
|
inlineoverride |
Send array to process
array | the array to send |
receiver | process to receive the array |
|
inlineoverride |
Send array to process
array | the array to send |
receiver | process to receive the array |
|
inlineoverride |
Send array to process
array | the array to send |
receiver | process to receive the array |
|
inlineoverridevirtual |
send value to process
value | the value to send |
receiver | process to send value |
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
send value to process
value | the value to send |
receiver | process to send value |
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
send value to process
value | the value to send |
receiver | process to send value |
Implements PanNDE::Communicator.
|
inlineoverride |
Use the field bundle to determine the exchange pattern and register all fields contained for data exchange.
fields | the field bundle to set up for halo exchange |
|
inlineoverride |
after having determined the exchange pattern, use that pattern to configure the halo exchange for the specific field. Not recommended approach, but retained for backwards compatibility
keyname | field name |
field | the field data to be registered for halo exchange |
|
inlineoverridevirtual |
Start asynchronous halo exchange on field by name
keyname | field name |
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
wait for all transmissions/receptions to complete
Implements PanNDE::Communicator.
|
inlineoverridevirtual |
Wait for completion of halo exchange on field by name
keyname | field name |
Implements PanNDE::Communicator.