29 assert(ipm == 1 || ipm == -1);
35 printf(
"%s: allocate channel failed.\n", __func__);
45 if (retv != MPI_SUCCESS) {
64 assert(ipm == 1 || ipm == -1);
70 printf(
"%s: allocate channel failed.\n", __func__);
80 if (retv != MPI_SUCCESS) {
133 return MPI_ERR_BUFFER;
static const int max_dimension
MPI_Status m_status
handler to MPI status information
int start()
collective start
static int m_ndim
number of dimensions.
int append(Channel *const p)
append channel to the set. there is no way to remove a channel.
Channel class for asynchronous communication.
MPI_Request m_request
handler to MPI persistent communication
static int m_comm
instead of MPI_Comm m_comm;
unsigned int m_nreq
number of channels to hold.
int wait()
collective wait
std::valarray< MPI_Request > m_array
a collection of MPI request held in channels.
static int * m_ipe_up
rank of upward neighbour in directions.
static std::vector< container_type > m_buf
static Channel * recv_init(int count, int idir, int ipm)
static Channel * send_init(int count, int idir, int ipm)
async communication
static int * m_ipe_dn
rank of downward neighbour in directions.
ChannelSet(int nchannel=8)
constructor. default number of channels is 8 for upward and downward in 4 dimensions.