26 static const char rcsid[]
27 =
"$Id: communicator.cpp 1145 2014-09-16 09:27:22Z namekawa $";
67 return Communicator_impl::is_primary_master();
86 #ifdef ENABLE_MULTI_INSTANCE
87 int Communicator::self_global()
89 return Communicator_impl::self_global();
95 #ifdef ENABLE_MULTI_INSTANCE
96 int Communicator::world_id()
98 return Communicator_impl::world_id();
146 #ifdef ENABLE_MULTI_INSTANCE
147 int Communicator::sync_global()
149 return Communicator_impl::sync_global();
184 double *recv_buf,
double *send_buf,
185 int idir,
int ipm,
int itag)
188 (
void *)recv_buf, (
void *)send_buf, idir, ipm, itag);
194 int *recv_buf,
int *send_buf,
195 int idir,
int ipm,
int itag)
198 (
void *)recv_buf, (
void *)send_buf, idir, ipm, itag);
204 double *recv_buf,
double *send_buf,
205 int send_to,
int recv_from,
int tag)
208 (
void *)recv_buf, (
void *)send_buf, send_to, recv_from, tag);
214 int *recv_buf,
int *send_buf,
215 int send_to,
int recv_from,
int tag)
218 (
void *)recv_buf, (
void *)send_buf,
219 send_to, recv_from, tag);
225 double *send_buf,
int pattern)
228 (
void *)recv_buf, (
void *)send_buf,
229 BGNET_COLLECTIVE_DOUBLE, BGNET_COLLECTIVE_ADD, pattern);
235 int *send_buf,
int pattern)
238 (
void *)recv_buf, (
void *)send_buf,
239 BGNET_COLLECTIVE_INT32, BGNET_COLLECTIVE_ADD, pattern);
245 double *send_buf,
int pattern)
248 (
void *)recv_buf, (
void *)send_buf,
249 BGNET_COLLECTIVE_DOUBLE, BGNET_COLLECTIVE_MAX, pattern);
255 int *send_buf,
int pattern)
258 (
void *)recv_buf, (
void *)send_buf,
259 BGNET_COLLECTIVE_INT32, BGNET_COLLECTIVE_MAX, pattern);
265 double *send_buf,
int pattern)
268 (
void *)recv_buf, (
void *)send_buf,
269 BGNET_COLLECTIVE_DOUBLE, BGNET_COLLECTIVE_MIN, pattern);
275 int *send_buf,
int pattern)
278 (
void *)recv_buf, (
void *)send_buf,
279 BGNET_COLLECTIVE_INT32, BGNET_COLLECTIVE_MIN, pattern);
286 double ar = double();
297 double ar = double();
307 double ar = double();
static const char rcsid[]
static int send_1to1(size_t size, void *recv_buf, void *send_buf, int send_to, int recv_from, int tag)
static int broadcast(size_t size, void *data, int sender)
static int npe(const int dir)
logical grid extent
static int reduce_max(int count, double *recv_buf, double *send_buf, int pattern=0)
find a global maximum of an array of double over the communicator. pattern specifies the dimensions t...
static void abort()
terminate communicator
static int self()
rank within small world.
static int broadcast_double(int count, double *data, int sender)
static bool is_primary_master()
check if the present node is primary in global communicator.
static int init(int *pargc, char ***pargv)
initialize communicator
static int grid_coord(int *gcoord, const int rank)
static int grid_coord(int *grid_coord, const int rank)
find grid coordinate from rank number.
static int sync()
synchronize within small world.
static int reduce_min(int count, double *recv_buf, double *send_buf, int pattern=0)
find a global minimum of an array of double over the communicator. pattern specifies the dimensions t...
static int setup(int ninstance=1)
static Channel * recv_init(int count, int idir, int ipm)
static int status()
for debug
static int broadcast(size_t size, void *data, int sender)
static int broadcast_int(int count, int *data, int sender)
static int ipe(const int dir)
logical coordinate of current proc.
static int grid_rank(int *rank, const int *gcoord)
static bool is_primary()
info about rank
static int npe(const int idir)
Channel class for asynchronous communication.
static int reduce(int count, void *recv_buf, void *send_buf, int type, int op, int pattern)
static int finalize()
finalize communicator
static int init(int *pargc, char ***pargv)
static int send_1to1(int count, double *recv_buf, double *send_buf, int p_to, int p_from, int tag)
send array of double from rank p_from to rank p_to. communication distinguished by tag...
static int grid_dims(int *gdims)
static int grid_dims(int *grid_dims)
find grid dimensions.
static int broadcast_string(int count, string &data, int sender)
for specific datatypes
static double get_time()
for getting time interval using clock count.
static int exchange(int count, double *recv_buf, double *send_buf, int idir, int ipm, int tag)
receive array of double from upstream specified by idir and ipm, and send array to downstream...
static int grid_rank(int *rank, const int *grid_coord)
find rank number from grid coordinate.
static int setup(int ninstance=1)
setup communicator
static int ipe(const int idir)
static Channel * recv_init(int count, int idir, int ipm)
static Channel * send_init(int count, int idir, int ipm)
async communication
static int size()
size of small world.
static double get_time()
obtain a wall-clock time.
static Channel * send_init(int count, int idir, int ipm)
static int reduce_sum(int count, double *recv_buf, double *send_buf, int pattern=0)
make a global sum of an array of double over the communicator. pattern specifies the dimensions to be...
static int sync()
synchronize within small world.
static int broadcast(int count, double *data, int sender)
broadcast array of double from sender.
static bool is_primary()
check if the present node is primary in small communicator.
static int exchange(size_t size, void *recv_buf, void *send_buf, int idir, int ipm, int tag)