6 #ifndef MPICOMM_HPP_INCLUDE
7 #define MPICOMM_HPP_INCLUDE
30 MPIComm(
const MPIComm *in_comm, std::vector<int> dimension, std::vector<int> periods,
bool is_reorder);
32 MPIComm(
const MPIComm *in_comm,
const std::string &tag,
bool &is_ctl);
34 MPIComm(
const MPIComm *in_comm,
const std::string &tag,
int split_type);
41 virtual std::shared_ptr<Comm>
split()
const override;
42 virtual std::shared_ptr<Comm>
split(
int color,
int key)
const override;
43 virtual std::shared_ptr<Comm>
split(
const std::string &tag,
int split_type)
const override;
44 virtual std::shared_ptr<Comm>
split(std::vector<int> dimensions, std::vector<int> periods,
bool is_reorder)
const override;
45 virtual std::shared_ptr<Comm>
split_cart(std::vector<int> dimensions)
const override;
47 virtual bool comm_supported(
const std::string &description)
const override;
49 virtual int cart_rank(
const std::vector<int> &coords)
const override;
50 virtual int rank(
void)
const override;
51 virtual int num_rank(
void)
const override;
52 virtual void dimension_create(
int num_ranks, std::vector<int> &dimension)
const override;
53 virtual void alloc_mem(
size_t size,
void **base)
override;
54 virtual void free_mem(
void *base)
override;
55 virtual size_t window_create(
size_t size,
void *base)
override;
57 virtual void coordinate(
int rank, std::vector<int> &coord)
const override;
59 virtual void window_lock(
size_t window_id,
bool is_exclusive,
int rank,
int assert)
const override;
61 virtual void barrier(
void)
const override;
62 virtual void broadcast(
void *buffer,
size_t size,
int root)
const override;
63 virtual bool test(
bool is_true)
const override;
64 virtual void reduce_max(
double *send_buf,
double *recv_buf,
size_t count,
int root)
const override;
65 virtual void gather(
const void *send_buf,
size_t send_size,
void *recv_buf,
66 size_t recv_size,
int root)
const override;
67 virtual void gatherv(
const void *send_buf,
size_t send_size,
void *recv_buf,
68 const std::vector<size_t> &recv_sizes,
const std::vector<off_t> &rank_offset,
int root)
const override;
69 virtual void window_put(
const void *send_buf,
size_t send_size,
int rank, off_t disp,
size_t window_id)
const override;
Abstract base class for interprocess communication in geopm.
Definition: Comm.hpp:20
Implementation of the Comm interface using MPI as the underlying communication mechanism.
Definition: MPIComm.hpp:23
MPIComm(const MPIComm &other)=delete
virtual int rank(void) const override
Process rank within communicator.
Definition: MPIComm.cpp:218
std::set< size_t > m_windows
Definition: MPIComm.hpp:77
virtual std::shared_ptr< Comm > split() const override
Definition: MPIComm.cpp:179
bool is_valid() const
Definition: MPIComm.cpp:250
const std::string m_name
Definition: MPIComm.hpp:78
void tear_down(void) override
Clean up resources held by the comm. This allows static global objects to be cleaned up before the de...
Definition: MPIComm.cpp:166
size_t m_maxdims
Definition: MPIComm.hpp:76
virtual std::shared_ptr< Comm > split_cart(std::vector< int > dimensions) const override
Definition: MPIComm.cpp:199
virtual void window_unlock(size_t window_id, int rank) const override
End epoch for message passing and RMA.
Definition: MPIComm.cpp:288
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.
Definition: MPIComm.cpp:346
bool m_is_torn_down
Definition: MPIComm.hpp:79
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 accord...
Definition: MPIComm.cpp:336
static MPIComm & comm_world(void)
Definition: MPIComm.cpp:51
virtual int num_rank(void) const override
Number of ranks in the communicator.
Definition: MPIComm.cpp:227
MPIComm & operator=(const MPIComm &other)=delete
static std::string plugin_name(void)
Definition: MPIComm.cpp:57
MPIComm(const MPIComm *in_comm, const std::string &tag)
virtual size_t window_create(size_t size, void *base) override
Create window for message passing and RMA.
Definition: MPIComm.cpp:268
static std::unique_ptr< Comm > make_plugin(void)
Definition: MPIComm.cpp:62
virtual void broadcast(void *buffer, size_t size, int root) const override
Broadcast a message to all ranks.
Definition: MPIComm.cpp:321
MPIComm()
Definition: MPIComm.cpp:67
virtual void coordinate(int rank, std::vector< int > &coord) const override
Coordinate in Cartesian grid for specified rank.
Definition: MPIComm.cpp:294
virtual void window_destroy(size_t window_id) override
Destroy window for message passing and RMA.
Definition: MPIComm.cpp:275
MPI_Comm m_comm
Definition: MPIComm.hpp:75
void check_window(size_t window_id) const
Definition: MPIComm.cpp:241
virtual void free_mem(void *base) override
Free memory that was allocated for message passing and RMA.
Definition: MPIComm.cpp:263
virtual bool comm_supported(const std::string &description) const override
Definition: MPIComm.cpp:204
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.
Definition: MPIComm.cpp:354
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.
Definition: MPIComm.cpp:236
virtual void alloc_mem(size_t size, void **base) override
Allocate memory for message passing and RMA.
Definition: MPIComm.cpp:258
virtual void barrier(void) const override
Barrier for all ranks.
Definition: MPIComm.cpp:314
virtual int cart_rank(const std::vector< int > &coords) const override
Process rank within Cartesian communicator.
Definition: MPIComm.cpp:209
virtual ~MPIComm()
Definition: MPIComm.cpp:161
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.
Definition: MPIComm.cpp:379
virtual void window_lock(size_t window_id, bool is_exclusive, int rank, int assert) const override
Begin epoch for message passing and RMA.
Definition: MPIComm.cpp:282
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.
Definition: MPIComm.cpp:329
Definition: Accumulator.cpp:12