29 #define MAX_BUFFER_DIM 8 // this value should be twice dimension.
39 const std::vector<int>& offset,
40 const std::vector<int>& datasize)
43 assert(destid.size() == Ntask);
44 assert(offset.size() == Ntask);
45 for (
int itask = 0; itask < Ntask; itask++) {
65 assert(ipm == 1 || ipm == -1);
76 printf(
"%s: allocate channel failed.\n", __func__);
102 assert(ipm == 1 || ipm == -1);
112 printf(
"%s: allocate channel failed.\n", __func__);
144 vout.
crucial(vl,
"%s: too large value of tag.\n", __func__);
152 vout.
general(vl,
"%s: buffer size reset: ibuf = %d count = %d.\n",
153 __func__, tag, count);
156 BGNET_SetSendBuffer((
void *)&
m_buf[
m_ibuf][0], tag,
160 vout.
paranoiac(vl,
"%s: buffer size unchanged: ibuf = %d count = %d.\n",
164 }
else if (mode ==
RECV) {
168 vout.
general(vl,
"%s: buffer size reset: ibuf = %d count = %d.\n",
169 __func__, tag, count);
171 BGNET_SetRecvBuffer((
void *)&
m_buf[
m_ibuf][0], tag,
175 vout.
paranoiac(vl,
"%s: buffer size unchanged: ibuf = %d count = %d.\n",
180 vout.
crucial(vl,
"%s: irrelevant input mode.\n", __func__);
268 ret = BGNET_WaitForRecv(itask,
static const int max_dimension
void general(const char *format,...)
void set_thread(int, const std::vector< int > &, const std::vector< int > &, const std::vector< int > &)
static int m_ndim
number of dimensions.
static Bridge::VerboseLevel Vlevel()
Channel class for asynchronous communication.
static int * m_ipe_up
rank of upward neighbour in directions.
static std::vector< container_type > m_buf
void paranoiac(const char *format,...)
void crucial(const char *format,...)
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.
static int m_set_id
identifies set of channels.
static int sync()
synchronize within small world.
std::vector< bgnet_IDs > m_bgnet_ids_thread