geopm
3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
|
Implementation of the Comm interface using MPI as the underlying communication mechanism. More...
#include <MPIComm.hpp>
Public Member Functions | |
MPIComm () | |
MPIComm (const MPIComm &other)=delete | |
MPIComm & | operator= (const MPIComm &other)=delete |
MPIComm (MPI_Comm in_comm) | |
MPIComm (const MPIComm *in_comm) | |
MPIComm (const MPIComm *in_comm, std::vector< int > dimension, std::vector< int > periods, bool is_reorder) | |
MPIComm (const MPIComm *in_comm, int color, int key) | |
MPIComm (const MPIComm *in_comm, const std::string &tag, bool &is_ctl) | |
MPIComm (const MPIComm *in_comm, const std::string &tag) | |
MPIComm (const MPIComm *in_comm, const std::string &tag, int split_type) | |
virtual | ~MPIComm () |
virtual std::shared_ptr< Comm > | split () const override |
virtual std::shared_ptr< Comm > | split (int color, int key) const override |
virtual std::shared_ptr< Comm > | split (const std::string &tag, int split_type) const override |
virtual std::shared_ptr< Comm > | split (std::vector< int > dimensions, std::vector< int > periods, bool is_reorder) const override |
virtual std::shared_ptr< Comm > | split_cart (std::vector< int > dimensions) const override |
virtual bool | comm_supported (const std::string &description) const override |
virtual int | cart_rank (const std::vector< int > &coords) const override |
Process rank within Cartesian communicator. More... | |
virtual int | rank (void) const override |
Process rank within communicator. More... | |
virtual int | num_rank (void) const override |
Number of ranks in the communicator. More... | |
virtual void | dimension_create (int num_ranks, std::vector< int > &dimension) const override |
Populate vector of optimal dimensions given the number of ranks the communicator. More... | |
virtual void | alloc_mem (size_t size, void **base) override |
Allocate memory for message passing and RMA. More... | |
virtual void | free_mem (void *base) override |
Free memory that was allocated for message passing and RMA. More... | |
virtual size_t | window_create (size_t size, void *base) override |
Create window for message passing and RMA. More... | |
virtual void | window_destroy (size_t window_id) override |
Destroy window for message passing and RMA. More... | |
virtual void | coordinate (int rank, std::vector< int > &coord) const override |
Coordinate in Cartesian grid for specified rank. More... | |
virtual std::vector< int > | coordinate (int rank) const override |
virtual void | window_lock (size_t window_id, bool is_exclusive, int rank, int assert) const override |
Begin epoch for message passing and RMA. More... | |
virtual void | window_unlock (size_t window_id, int rank) const override |
End epoch for message passing and RMA. More... | |
virtual void | barrier (void) const override |
Barrier for all ranks. More... | |
virtual void | broadcast (void *buffer, size_t size, int root) const override |
Broadcast a message to all ranks. More... | |
virtual bool | test (bool is_true) const override |
Test whether or not all ranks in the communicator present the same input and return true/false accordingly. More... | |
virtual void | reduce_max (double *send_buf, double *recv_buf, size_t count, int root) const override |
Reduce distributed messages across all ranks using specified operation, store result on all ranks. More... | |
virtual void | gather (const void *send_buf, size_t send_size, void *recv_buf, size_t recv_size, int root) const override |
Gather bytes from all processes. More... | |
virtual void | gatherv (const void *send_buf, size_t send_size, void *recv_buf, const std::vector< size_t > &recv_sizes, const std::vector< off_t > &rank_offset, int root) const override |
Gather bytes into specified location from all processes. More... | |
virtual void | window_put (const void *send_buf, size_t send_size, int rank, off_t disp, size_t window_id) const override |
Perform message passing or RMA. More... | |
void | tear_down (void) override |
Clean up resources held by the comm. This allows static global objects to be cleaned up before the destructor is called. More... | |
Public Member Functions inherited from geopm::Comm | |
Comm ()=default | |
Constructor for global communicator. More... | |
Comm (const Comm &other)=default | |
Comm & | operator= (const Comm &other)=default |
virtual | ~Comm ()=default |
Default destructor. More... | |
Static Public Member Functions | |
static std::string | plugin_name (void) |
static std::unique_ptr< Comm > | make_plugin (void) |
static MPIComm & | comm_world (void) |
Static Public Member Functions inherited from geopm::Comm | |
static std::vector< std::string > | comm_names (void) |
static std::unique_ptr< Comm > | make_unique (const std::string &comm_name) |
static std::unique_ptr< Comm > | make_unique (void) |
Protected Member Functions | |
void | check_window (size_t window_id) const |
bool | is_valid () const |
Protected Attributes | |
MPI_Comm | m_comm |
size_t | m_maxdims |
std::set< size_t > | m_windows |
const std::string | m_name |
bool | m_is_torn_down = false |
Additional Inherited Members | |
Public Types inherited from geopm::Comm | |
enum | m_comm_split_type_e { M_COMM_SPLIT_TYPE_PPN1 , M_COMM_SPLIT_TYPE_SHARED , M_NUM_COMM_SPLIT_TYPE } |
enum | m_split_color_e { M_SPLIT_COLOR_UNDEFINED = -16 } |
Static Public Attributes inherited from geopm::Comm | |
static const std::string | M_PLUGIN_PREFIX = "libgeopmcomm_" |
Implementation of the Comm interface using MPI as the underlying communication mechanism.
geopm::MPIComm::MPIComm | ( | ) |
|
delete |
geopm::MPIComm::MPIComm | ( | MPI_Comm | in_comm | ) |
geopm::MPIComm::MPIComm | ( | const MPIComm * | in_comm | ) |
geopm::MPIComm::MPIComm | ( | const MPIComm * | in_comm, |
std::vector< int > | dimension, | ||
std::vector< int > | periods, | ||
bool | is_reorder | ||
) |
geopm::MPIComm::MPIComm | ( | const MPIComm * | in_comm, |
int | color, | ||
int | key | ||
) |
geopm::MPIComm::MPIComm | ( | const MPIComm * | in_comm, |
const std::string & | tag, | ||
bool & | is_ctl | ||
) |
geopm::MPIComm::MPIComm | ( | const MPIComm * | in_comm, |
const std::string & | tag | ||
) |
geopm::MPIComm::MPIComm | ( | const MPIComm * | in_comm, |
const std::string & | tag, | ||
int | split_type | ||
) |
|
virtual |
|
overridevirtual |
Allocate memory for message passing and RMA.
[in] | size | Size of the desired memory allocation. |
[out] | base | Address of allocated memory. |
Implements geopm::Comm.
|
overridevirtual |
Barrier for all ranks.
Implements geopm::Comm.
|
overridevirtual |
Broadcast a message to all ranks.
[in,out] | buffer | Starting address of buffer to be broadcasted. |
[in] | size | Size of the buffer. |
[in] | root | Rank of the broadcast root (target). |
Implements geopm::Comm.
|
overridevirtual |
Process rank within Cartesian communicator.
[in] | coords | Coordinate of Cartesian communicator member whose rank we wish to know. |
Implements geopm::Comm.
|
protected |
|
overridevirtual |
Implements geopm::Comm.
|
static |
|
overridevirtual |
Implements geopm::Comm.
|
overridevirtual |
Coordinate in Cartesian grid for specified rank.
[in] | rank | Rank for which coordinates should be calculated |
[in,out] | coord | Cartesian coordinates of specified rank. The size of this vector should equal the number of dimensions that the Cartesian communicator was created with. |
Implements geopm::Comm.
|
overridevirtual |
Populate vector of optimal dimensions given the number of ranks the communicator.
[in] | num_ranks | Number of ranks that must fit in Cartesian grid. |
[in,out] | dimension | Number of ranks per dimension. The size of this vector dictates the number of dimensions in the grid. Fill indices with 0 for API to fill with suitable value. |
Implements geopm::Comm.
|
overridevirtual |
Free memory that was allocated for message passing and RMA.
[in] | base | Address of memory to be released. |
Implements geopm::Comm.
|
overridevirtual |
Gather bytes from all processes.
[in] | send_buf | Start address of memory buffer to be transmitted. |
[in] | send_size | Size of buffer to be sent. |
[out] | recv_buf | Start address of memory buffer to receive data. |
[in] | recv_size | The size of the buffer to be received. |
[in] | root | Rank of the target for the transmission. |
Implements geopm::Comm.
|
overridevirtual |
Gather bytes into specified location from all processes.
[in] | send_buf | Start address of memory buffer to be transmitted. |
[in] | send_size | Size of buffer to be sent. |
[out] | recv_buf | Start address of memory buffer to receive data. |
[in] | recv_sizes | Vector describing the buffer size per rank to be received. |
[in] | rank_offset | Offset per rank into target buffer for transmitted data. |
[in] | root | Rank of the target for the transmission. |
Implements geopm::Comm.
|
protected |
|
static |
|
overridevirtual |
Number of ranks in the communicator.
Implements geopm::Comm.
|
static |
|
overridevirtual |
Process rank within communicator.
Implements geopm::Comm.
|
overridevirtual |
Reduce distributed messages across all ranks using specified operation, store result on all ranks.
[in] | send_buf | Start address of memory buffer to be transmitted. |
[out] | recv_buf | Start address of memory buffer to receive data. |
[in] | count | Size of buffer in bytes to be transmitted. |
Implements geopm::Comm.
|
overridevirtual |
Implements geopm::Comm.
|
overridevirtual |
Implements geopm::Comm.
|
overridevirtual |
Implements geopm::Comm.
|
overridevirtual |
Implements geopm::Comm.
|
overridevirtual |
Implements geopm::Comm.
|
overridevirtual |
Clean up resources held by the comm. This allows static global objects to be cleaned up before the destructor is called.
Implements geopm::Comm.
|
overridevirtual |
Test whether or not all ranks in the communicator present the same input and return true/false accordingly.
[in] | is_true | Boolean value to be reduced from all ranks. |
Implements geopm::Comm.
|
overridevirtual |
Create window for message passing and RMA.
[in] | size | Size of the memory area backing the RMA window. |
[in] | base | Address of memory that has been allocated for the window. |
Implements geopm::Comm.
|
overridevirtual |
Destroy window for message passing and RMA.
[in] | window_id | The window handle for the target window. |
Implements geopm::Comm.
|
overridevirtual |
Begin epoch for message passing and RMA.
[in] | window_id | The window handle for the target window. |
[in] | is_exclusive | Lock type for the window, true for exclusive lock, false for shared. |
[in] | rank | Rank of the locked window. |
[in] | assert | Used to optimize call. |
Implements geopm::Comm.
|
overridevirtual |
Perform message passing or RMA.
[in] | send_buf | Starting address of buffer to be transmitted via window. |
[in] | send_size | Size in bytes of buffer to be sent. |
[in] | rank | Target rank of the transmission. |
[in] | disp | Displacement from start of window. |
[in] | window_id | The window handle for the target window. |
Implements geopm::Comm.
|
overridevirtual |
End epoch for message passing and RMA.
[in] | window_id | The window handle for the target window. |
[in] | rank | Rank of the locked window. |
Implements geopm::Comm.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |