window< ValueType > Class Template Reference#
|
Reference API
|
#include <ginkgo/core/base/mpi.hpp>
Public Types | |
| enum class | create_type { allocate = 1 , create = 2 , dynamic_create = 3 } |
| enum class | lock_type { shared = 1 , exclusive = 2 } |
Public Member Functions | |
| window () | |
| window (const window &other)=delete | |
| window & | operator= (const window &other)=delete |
| window (window &&other) | |
| window & | operator= (window &&other) |
| 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) | |
| MPI_Win | get_window () const |
| void | fence (int assert=0) const |
| void | lock (int rank, lock_type lock_t=lock_type::shared, int assert=0) const |
| void | unlock (int rank) const |
| void | lock_all (int assert=0) const |
| void | unlock_all () const |
| void | flush (int rank) const |
| void | flush_local (int rank) const |
| void | flush_all () const |
| void | flush_all_local () const |
| void | sync () const |
| ~window () | |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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 |
Detailed Description
class gko::experimental::mpi::window< ValueType >
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.
Member Enumeration Documentation
◆ create_type
|
strong |
The create type for the window object.
◆ lock_type
|
strong |
The lock type for passive target synchronization of the windows.
Constructor & Destructor Documentation
◆ window() [1/3]
|
inline |
The default constructor. It creates a null window of MPI_WIN_NULL type.
◆ window() [2/3]
|
inline |
The move constructor. Move the other object and replace it with MPI_WIN_NULL
- Parameters
-
other the window object to be moved.
◆ window() [3/3]
|
inline |
Create a window object with a given data pointer and type. A collective operation.
- Parameters
-
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().
◆ ~window()
|
inline |
The deleter which calls MPI_Win_free when the window leaves its scope.
Member Function Documentation
◆ accumulate()
|
inline |
Accumulate data into the target window.
- Parameters
-
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::window< ValueType >::get_window().
◆ fence()
|
inline |
The active target synchronization using MPI_Win_fence for the window object. This is called on all associated ranks.
- Parameters
-
assert the optimization level. 0 is always valid.
◆ fetch_and_op()
|
inline |
Fetch and operate on data from the target window (An optimized version of Get_accumulate).
- Parameters
-
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 gko::experimental::mpi::window< ValueType >::get_window().
◆ flush()
|
inline |
Flush the existing RDMA operations on the target rank for the calling process for the window object.
- Parameters
-
rank the target rank.
◆ flush_all()
|
inline |
Flush all the existing RDMA operations for the calling process for the window object.
◆ flush_all_local()
|
inline |
Flush all the local existing RDMA operations on the calling rank for the window object.
◆ flush_local()
|
inline |
Flush the existing RDMA operations on the calling rank from the target rank for the window object.
- Parameters
-
rank the target rank.
◆ get()
|
inline |
Get data from the target window.
- Parameters
-
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::window< ValueType >::get_window().
◆ get_accumulate()
|
inline |
Get Accumulate data from the target window.
- Parameters
-
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::window< ValueType >::get_window().
◆ get_window()
|
inline |
Get the underlying window object of MPI_Win type.
- Returns
- the underlying window object.
Referenced by gko::experimental::mpi::window< ValueType >::accumulate(), gko::experimental::mpi::window< ValueType >::fetch_and_op(), gko::experimental::mpi::window< ValueType >::get(), gko::experimental::mpi::window< ValueType >::get_accumulate(), gko::experimental::mpi::window< ValueType >::put(), gko::experimental::mpi::window< ValueType >::r_accumulate(), gko::experimental::mpi::window< ValueType >::r_get(), gko::experimental::mpi::window< ValueType >::r_get_accumulate(), and gko::experimental::mpi::window< ValueType >::r_put().
◆ lock()
|
inline |
Create an epoch using MPI_Win_lock for the window object.
- Parameters
-
rank the target rank. lock_t the type of the lock: shared or exclusive assert the optimization level. 0 is always valid.
◆ lock_all()
|
inline |
Create the epoch on all ranks using MPI_Win_lock_all for the window object.
- Parameters
-
assert the optimization level. 0 is always valid.
◆ operator=()
|
inline |
The move assignment operator. Move the other object and replace it with MPI_WIN_NULL
- Parameters
-
other the window object to be moved.
◆ put()
|
inline |
Put data into the target window.
- Parameters
-
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::window< ValueType >::get_window().
◆ r_accumulate()
|
inline |
(Non-blocking) Accumulate data into the target window.
- Parameters
-
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
- Returns
- the request handle for the send call
References gko::experimental::mpi::request::get(), and gko::experimental::mpi::window< ValueType >::get_window().
◆ r_get()
|
inline |
Get data (with handle) from the target window.
- Parameters
-
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
- Returns
- the request handle for the send call
References gko::experimental::mpi::request::get(), and gko::experimental::mpi::window< ValueType >::get_window().
◆ r_get_accumulate()
|
inline |
(Non-blocking) Get Accumulate data (with handle) from the target window.
- Parameters
-
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
- Returns
- the request handle for the send call
References gko::experimental::mpi::request::get(), and gko::experimental::mpi::window< ValueType >::get_window().
◆ r_put()
|
inline |
Put data into the target window.
- Parameters
-
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
- Returns
- the request handle for the send call
References gko::experimental::mpi::request::get(), and gko::experimental::mpi::window< ValueType >::get_window().
◆ sync()
|
inline |
Synchronize the public and private buffers for the window object
◆ unlock()
|
inline |
Close the epoch using MPI_Win_unlock for the window object.
- Parameters
-
rank the target rank.
◆ unlock_all()
|
inline |
Close the epoch on all ranks using MPI_Win_unlock_all for the window object.
The documentation for this class was generated from the following file:
- ginkgo/core/base/mpi.hpp
Generated by