31 #define MAX_BUFFER_DIM 8 // this value should be twice dimension.
41 const std::valarray<int>& offset,
42 const std::valarray<int>& datasize)
45 assert(destid.size() == Ntask);
46 assert(offset.size() == Ntask);
47 for (
int itask = 0; itask < Ntask; itask++) {
67 assert(ipm == 1 || ipm == -1);
78 printf(
"%s: allocate channel failed.\n", __func__);
104 assert(ipm == 1 || ipm == -1);
114 printf(
"%s: allocate channel failed.\n", __func__);
146 vout.
crucial(vl,
"%s: too large value of tag.\n", __func__);
154 vout.
general(vl,
"%s: buffer size reset: ibuf = %d count = %d.\n",
155 __func__, tag, count);
158 BGNET_SetSendBuffer((
void *)&
m_buf[
m_ibuf][0], tag,
162 vout.
paranoiac(vl,
"%s: buffer size unchanged: ibuf = %d count = %d.\n",
166 }
else if (mode ==
RECV) {
170 vout.
general(vl,
"%s: buffer size reset: ibuf = %d count = %d.\n",
171 __func__, tag, count);
173 BGNET_SetRecvBuffer((
void *)&
m_buf[
m_ibuf][0], tag,
177 vout.
paranoiac(vl,
"%s: buffer size unchanged: ibuf = %d count = %d.\n",
182 vout.
crucial(vl,
"%s: irrelevant input mode.\n", __func__);
270 ret = BGNET_WaitForRecv(itask,
std::valarray< bgnet_IDs > m_bgnet_ids_thread
static const int max_dimension
void set_thread(int, const std::valarray< int > &, const std::valarray< int > &, const std::valarray< int > &)
void general(const char *format,...)
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.