This class wraps the MPI_Window class with RAII functionality. More...
#include <ginkgo/core/base/mpi.hpp>
Public Types | |
| enum class | create_type { allocate = 1 , create = 2 , dynamic_create = 3 } |
| The create type for the window object. | |
| enum class | lock_type { shared = 1 , exclusive = 2 } |
| The lock type for passive target synchronization of the windows. | |
Public Member Functions | |
| window () | |
| The default constructor. | |
| window (const window &other)=delete | |
| window & | operator= (const window &other)=delete |
| window (window &&other) | |
| The move constructor. | |
| window & | operator= (window &&other) |
| The move assignment operator. | |
| window (std::shared_ptr< const Executor > exec, ValueType *base, int num_elems, const communicator &comm, const int disp_unit=sizeof(ValueType), MPI_Info input_info=MPI_INFO_NULL, create_type c_type=create_type::create) | |
| Create a window object with a given data pointer and type. | |
| MPI_Win | get_window () const |
| Get the underlying window object of MPI_Win type. | |
| void | fence (int assert=0) const |
| The active target synchronization using MPI_Win_fence for the window object. | |
| void | lock (int rank, lock_type lock_t=lock_type::shared, int assert=0) const |
| Create an epoch using MPI_Win_lock for the window object. | |
| void | unlock (int rank) const |
| Close the epoch using MPI_Win_unlock for the window object. | |
| void | lock_all (int assert=0) const |
| Create the epoch on all ranks using MPI_Win_lock_all for the window object. | |
| void | unlock_all () const |
| Close the epoch on all ranks using MPI_Win_unlock_all for the window object. | |
| void | flush (int rank) const |
| Flush the existing RDMA operations on the target rank for the calling process for the window object. | |
| void | flush_local (int rank) const |
| Flush the existing RDMA operations on the calling rank from the target rank for the window object. | |
| void | flush_all () const |
| Flush all the existing RDMA operations for the calling process for the window object. | |
| void | flush_all_local () const |
| Flush all the local existing RDMA operations on the calling rank for the window object. | |
| void | sync () const |
| Synchronize the public and private buffers for the window object. | |
| ~window () | |
| The deleter which calls MPI_Win_free when the window leaves its scope. | |
| template<typename PutType> | |
| void | put (std::shared_ptr< const Executor > exec, const PutType *origin_buffer, const int origin_count, const int target_rank, const unsigned int target_disp, const int target_count) const |
| Put data into the target window. | |
| template<typename PutType> | |
| request | r_put (std::shared_ptr< const Executor > exec, const PutType *origin_buffer, const int origin_count, const int target_rank, const unsigned int target_disp, const int target_count) const |
| Put data into the target window. | |
| template<typename PutType> | |
| void | accumulate (std::shared_ptr< const Executor > exec, const PutType *origin_buffer, const int origin_count, const int target_rank, const unsigned int target_disp, const int target_count, MPI_Op operation) const |
| Accumulate data into the target window. | |
| template<typename PutType> | |
| request | r_accumulate (std::shared_ptr< const Executor > exec, const PutType *origin_buffer, const int origin_count, const int target_rank, const unsigned int target_disp, const int target_count, MPI_Op operation) const |
| (Non-blocking) Accumulate data into the target window. | |
| template<typename GetType> | |
| void | get (std::shared_ptr< const Executor > exec, GetType *origin_buffer, const int origin_count, const int target_rank, const unsigned int target_disp, const int target_count) const |
| Get data from the target window. | |
| template<typename GetType> | |
| request | r_get (std::shared_ptr< const Executor > exec, GetType *origin_buffer, const int origin_count, const int target_rank, const unsigned int target_disp, const int target_count) const |
| Get data (with handle) from the target window. | |
| template<typename GetType> | |
| void | get_accumulate (std::shared_ptr< const Executor > exec, GetType *origin_buffer, const int origin_count, GetType *result_buffer, const int result_count, const int target_rank, const unsigned int target_disp, const int target_count, MPI_Op operation) const |
| Get Accumulate data from the target window. | |
| template<typename GetType> | |
| request | r_get_accumulate (std::shared_ptr< const Executor > exec, GetType *origin_buffer, const int origin_count, GetType *result_buffer, const int result_count, const int target_rank, const unsigned int target_disp, const int target_count, MPI_Op operation) const |
| (Non-blocking) Get Accumulate data (with handle) from the target window. | |
| template<typename GetType> | |
| void | fetch_and_op (std::shared_ptr< const Executor > exec, GetType *origin_buffer, GetType *result_buffer, const int target_rank, const unsigned int target_disp, MPI_Op operation) const |
| Fetch and operate on data from the target window (An optimized version of Get_accumulate). | |
This class wraps the MPI_Window class with RAII functionality.
Different create and lock type methods are setup with enums.
MPI_Window is primarily used for one sided communication and this class provides functionalities to fence, lock, unlock and flush the communication buffers.
|
inline |
The default constructor.
It creates a null window of MPI_WIN_NULL type.
Referenced by operator=(), and window().
|
inline |
The move constructor.
Move the other object and replace it with MPI_WIN_NULL
| other | the window object to be moved. |
References window().
|
inline |
Create a window object with a given data pointer and type.
A collective operation.
| exec | The executor, on which the base pointer is located. |
| base | the base pointer for the window object. |
| num_elems | the num_elems of type ValueType the window points to. |
| comm | the communicator whose ranks will have windows created. |
| disp_unit | the displacement from base for the window object. |
| input_info | the MPI_Info object used to set certain properties. |
| c_type | the type of creation method to use to create the window. |
References gko::experimental::mpi::communicator::get().
|
inline |
Accumulate data into the target window.
| exec | The executor, on which the message buffer is located. |
| origin_buffer | the buffer to send |
| origin_count | the number of elements to put |
| target_rank | the rank to put the data to |
| target_disp | the displacement at the target window |
| target_count | the request handle for the send call |
| operation | the reduce operation. See @MPI_Op |
References get_window().
|
inline |
The active target synchronization using MPI_Win_fence for the window object.
This is called on all associated ranks.
| assert | the optimization level. 0 is always valid. |
|
inline |
Fetch and operate on data from the target window (An optimized version of Get_accumulate).
| exec | The executor, on which the message buffer is located. |
| origin_buffer | the buffer to send |
| target_rank | the rank to get the data from |
| target_disp | the displacement at the target window |
| operation | the reduce operation. See @MPI_Op |
References get_window().
|
inline |
Flush the existing RDMA operations on the target rank for the calling process for the window object.
| rank | the target rank. |
|
inline |
Flush the existing RDMA operations on the calling rank from the target rank for the window object.
| rank | the target rank. |
|
inline |
Get data from the target window.
| exec | The executor, on which the message buffer is located. |
| origin_buffer | the buffer to send |
| origin_count | the number of elements to get |
| target_rank | the rank to get the data from |
| target_disp | the displacement at the target window |
| target_count | the request handle for the send call |
References get_window().
|
inline |
Get Accumulate data from the target window.
| exec | The executor, on which the message buffers are located. |
| origin_buffer | the buffer to send |
| origin_count | the number of elements to get |
| result_buffer | the buffer to receive the target data |
| result_count | the number of elements to get |
| target_rank | the rank to get the data from |
| target_disp | the displacement at the target window |
| target_count | the request handle for the send call |
| operation | the reduce operation. See @MPI_Op |
References get_window().
|
inline |
Get the underlying window object of MPI_Win type.
Referenced by accumulate(), fetch_and_op(), get(), get_accumulate(), put(), r_accumulate(), r_get(), r_get_accumulate(), and r_put().
|
inline |
Create an epoch using MPI_Win_lock for the window object.
| rank | the target rank. |
| lock_t | the type of the lock: shared or exclusive |
| assert | the optimization level. 0 is always valid. |
|
inline |
Create the epoch on all ranks using MPI_Win_lock_all for the window object.
| assert | the optimization level. 0 is always valid. |
|
inline |
The move assignment operator.
Move the other object and replace it with MPI_WIN_NULL
| other | the window object to be moved. |
References window().
|
inline |
Put data into the target window.
| exec | The executor, on which the message buffer is located. |
| origin_buffer | the buffer to send |
| origin_count | the number of elements to put |
| target_rank | the rank to put the data to |
| target_disp | the displacement at the target window |
| target_count | the request handle for the send call |
References get_window().
|
inline |
(Non-blocking) Accumulate data into the target window.
| exec | The executor, on which the message buffer is located. |
| origin_buffer | the buffer to send |
| origin_count | the number of elements to put |
| target_rank | the rank to put the data to |
| target_disp | the displacement at the target window |
| target_count | the request handle for the send call |
| operation | the reduce operation. See @MPI_Op |
References gko::experimental::mpi::request::get(), and get_window().
|
inline |
Get data (with handle) from the target window.
| exec | The executor, on which the message buffer is located. |
| origin_buffer | the buffer to send |
| origin_count | the number of elements to get |
| target_rank | the rank to get the data from |
| target_disp | the displacement at the target window |
| target_count | the request handle for the send call |
References gko::experimental::mpi::request::get(), and get_window().
|
inline |
(Non-blocking) Get Accumulate data (with handle) from the target window.
| exec | The executor, on which the message buffers are located. |
| origin_buffer | the buffer to send |
| origin_count | the number of elements to get |
| result_buffer | the buffer to receive the target data |
| result_count | the number of elements to get |
| target_rank | the rank to get the data from |
| target_disp | the displacement at the target window |
| target_count | the request handle for the send call |
| operation | the reduce operation. See @MPI_Op |
References gko::experimental::mpi::request::get(), and get_window().
|
inline |
Put data into the target window.
| exec | The executor, on which the message buffer is located. |
| origin_buffer | the buffer to send |
| origin_count | the number of elements to put |
| target_rank | the rank to put the data to |
| target_disp | the displacement at the target window |
| target_count | the request handle for the send call |
References gko::experimental::mpi::request::get(), and get_window().
|
inline |
Close the epoch using MPI_Win_unlock for the window object.
| rank | the target rank. |