27 MPI::Comm::Send(
const void *buf,
int count,
28 const MPI::Datatype & datatype,
int dest,
int tag)
const
30 (void)MPI_Send(const_cast<void *>(buf), count, datatype, dest, tag, mpi_comm);
34 MPI::Comm::Recv(
void *buf,
int count,
const MPI::Datatype & datatype,
35 int source,
int tag, MPI::Status & status)
const
37 (void)MPI_Recv(buf, count, datatype, source, tag, mpi_comm, &status.mpi_status);
41 MPI::Comm::Recv(
void *buf,
int count,
const MPI::Datatype & datatype,
42 int source,
int tag)
const
44 (void)MPI_Recv(buf, count, datatype, source,
45 tag, mpi_comm, MPI_STATUS_IGNORE);
49 MPI::Comm::Bsend(
const void *buf,
int count,
50 const MPI::Datatype & datatype,
int dest,
int tag)
const
52 (void)MPI_Bsend(const_cast<void *>(buf), count, datatype,
57 MPI::Comm::Ssend(
const void *buf,
int count,
58 const MPI::Datatype & datatype,
int dest,
int tag)
const
60 (void)MPI_Ssend(const_cast<void *>(buf), count, datatype, dest,
65 MPI::Comm::Rsend(
const void *buf,
int count,
66 const MPI::Datatype & datatype,
int dest,
int tag)
const
68 (void)MPI_Rsend(const_cast<void *>(buf), count, datatype,
73 MPI::Comm::Isend(
const void *buf,
int count,
74 const MPI::Datatype & datatype,
int dest,
int tag)
const
77 (void)MPI_Isend(const_cast<void *>(buf), count, datatype,
78 dest, tag, mpi_comm, &request);
83 MPI::Comm::Ibsend(
const void *buf,
int count,
84 const MPI::Datatype & datatype,
int dest,
int tag)
const
87 (void)MPI_Ibsend(const_cast<void *>(buf), count, datatype,
88 dest, tag, mpi_comm, &request);
93 MPI::Comm::Issend(
const void *buf,
int count,
94 const MPI::Datatype & datatype,
int dest,
int tag)
const
97 (void)MPI_Issend(const_cast<void *>(buf), count, datatype,
98 dest, tag, mpi_comm, &request);
103 MPI::Comm::Irsend(
const void *buf,
int count,
104 const MPI::Datatype & datatype,
int dest,
int tag)
const
107 (void)MPI_Irsend(const_cast<void *>(buf), count, datatype,
108 dest, tag, mpi_comm, &request);
113 MPI::Comm::Irecv(
void *buf,
int count,
114 const MPI::Datatype & datatype,
int source,
int tag)
const
117 (void)MPI_Irecv(buf, count, datatype, source,
118 tag, mpi_comm, &request);
124 MPI::Comm::Iprobe(
int source,
int tag, MPI::Status & status)
const
127 (void)MPI_Iprobe(source, tag, mpi_comm, &t, &status.mpi_status);
128 return OPAL_INT_TO_BOOL(t);
132 MPI::Comm::Iprobe(
int source,
int tag)
const
135 (void)MPI_Iprobe(source, tag, mpi_comm, &t, MPI_STATUS_IGNORE);
136 return OPAL_INT_TO_BOOL(t);
140 MPI::Comm::Probe(
int source,
int tag, MPI::Status & status)
const
142 (void)MPI_Probe(source, tag, mpi_comm, &status.mpi_status);
146 MPI::Comm::Probe(
int source,
int tag)
const
148 (void)MPI_Probe(source, tag, mpi_comm, MPI_STATUS_IGNORE);
152 MPI::Comm::Send_init(
const void *buf,
int count,
153 const MPI::Datatype & datatype,
int dest,
int tag)
const
156 (void)MPI_Send_init(const_cast<void *>(buf), count, datatype,
157 dest, tag, mpi_comm, &request);
162 MPI::Comm::Bsend_init(
const void *buf,
int count,
163 const MPI::Datatype & datatype,
int dest,
int tag)
const
166 (void)MPI_Bsend_init(const_cast<void *>(buf), count, datatype,
167 dest, tag, mpi_comm, &request);
172 MPI::Comm::Ssend_init(
const void *buf,
int count,
173 const MPI::Datatype & datatype,
int dest,
int tag)
const
176 (void)MPI_Ssend_init(const_cast<void *>(buf), count, datatype,
177 dest, tag, mpi_comm, &request);
182 MPI::Comm::Rsend_init(
const void *buf,
int count,
183 const MPI::Datatype & datatype,
int dest,
int tag)
const
186 (void)MPI_Rsend_init(const_cast<void *>(buf), count, datatype,
187 dest, tag, mpi_comm, &request);
192 MPI::Comm::Recv_init(
void *buf,
int count,
193 const MPI::Datatype & datatype,
int source,
int tag)
const
196 (void)MPI_Recv_init(buf, count, datatype, source,
197 tag, mpi_comm, &request);
202 MPI::Comm::Sendrecv(
const void *sendbuf,
int sendcount,
203 const MPI::Datatype & sendtype,
int dest,
int sendtag,
204 void *recvbuf,
int recvcount,
205 const MPI::Datatype & recvtype,
int source,
206 int recvtag, MPI::Status & status)
const
208 (void)MPI_Sendrecv(const_cast<void *>(sendbuf), sendcount,
210 dest, sendtag, recvbuf, recvcount,
212 source, recvtag, mpi_comm, &status.mpi_status);
216 MPI::Comm::Sendrecv(
const void *sendbuf,
int sendcount,
217 const MPI::Datatype & sendtype,
int dest,
int sendtag,
218 void *recvbuf,
int recvcount,
219 const MPI::Datatype & recvtype,
int source,
222 (void)MPI_Sendrecv(const_cast<void *>(sendbuf), sendcount,
224 dest, sendtag, recvbuf, recvcount,
226 source, recvtag, mpi_comm, MPI_STATUS_IGNORE);
230 MPI::Comm::Sendrecv_replace(
void *buf,
int count,
231 const MPI::Datatype & datatype,
int dest,
232 int sendtag,
int source,
233 int recvtag, MPI::Status & status)
const
235 (void)MPI_Sendrecv_replace(buf, count, datatype, dest,
236 sendtag, source, recvtag, mpi_comm,
241 MPI::Comm::Sendrecv_replace(
void *buf,
int count,
242 const MPI::Datatype & datatype,
int dest,
243 int sendtag,
int source,
246 (void)MPI_Sendrecv_replace(buf, count, datatype, dest,
247 sendtag, source, recvtag, mpi_comm,
256 MPI::Comm::Get_group()
const
259 (void)MPI_Comm_group(mpi_comm, &group);
264 MPI::Comm::Get_size()
const
267 (void)MPI_Comm_size (mpi_comm, &size);
272 MPI::Comm::Get_rank()
const
275 (void)MPI_Comm_rank (mpi_comm, &rank);
280 MPI::Comm::Compare(
const MPI::Comm & comm1,
281 const MPI::Comm & comm2)
284 (void)MPI_Comm_compare(comm1, comm2, &result);
289 MPI::Comm::Free(
void)
291 (void)MPI_Comm_free(&mpi_comm);
295 MPI::Comm::Is_inter()
const
298 (void)MPI_Comm_test_inter(mpi_comm, &t);
299 return OPAL_INT_TO_BOOL(t);
308 MPI::Comm::Barrier()
const
310 (void)MPI_Barrier(mpi_comm);
314 MPI::Comm::Bcast(
void *buffer,
int count,
315 const MPI::Datatype& datatype,
int root)
const
317 (void)MPI_Bcast(buffer, count, datatype, root, mpi_comm);
321 MPI::Comm::Gather(
const void *sendbuf,
int sendcount,
322 const MPI::Datatype & sendtype,
323 void *recvbuf,
int recvcount,
324 const MPI::Datatype & recvtype,
int root)
const
326 (void)MPI_Gather(const_cast<void *>(sendbuf), sendcount, sendtype,
327 recvbuf, recvcount, recvtype, root, mpi_comm);
331 MPI::Comm::Gatherv(
const void *sendbuf,
int sendcount,
332 const MPI::Datatype & sendtype,
void *recvbuf,
333 const int recvcounts[],
const int displs[],
334 const MPI::Datatype & recvtype,
int root)
const
336 (void)MPI_Gatherv(const_cast<void *>(sendbuf), sendcount, sendtype,
337 recvbuf,
const_cast<int *
>(recvcounts),
338 const_cast<int *>(displs),
339 recvtype, root, mpi_comm);
343 MPI::Comm::Scatter(
const void *sendbuf,
int sendcount,
344 const MPI::Datatype & sendtype,
345 void *recvbuf,
int recvcount,
346 const MPI::Datatype & recvtype,
int root)
const
348 (void)MPI_Scatter(const_cast<void *>(sendbuf), sendcount, sendtype,
349 recvbuf, recvcount, recvtype, root, mpi_comm);
353 MPI::Comm::Scatterv(
const void *sendbuf,
const int sendcounts[],
354 const int displs[],
const MPI::Datatype & sendtype,
355 void *recvbuf,
int recvcount,
356 const MPI::Datatype & recvtype,
int root)
const
358 (void)MPI_Scatterv(const_cast<void *>(sendbuf),
359 const_cast<int *
>(sendcounts),
360 const_cast<int *>(displs), sendtype,
361 recvbuf, recvcount, recvtype,
366 MPI::Comm::Allgather(
const void *sendbuf,
int sendcount,
367 const MPI::Datatype & sendtype,
void *recvbuf,
368 int recvcount,
const MPI::Datatype & recvtype)
const
370 (void)MPI_Allgather(const_cast<void *>(sendbuf), sendcount,
371 sendtype, recvbuf, recvcount,
376 MPI::Comm::Allgatherv(
const void *sendbuf,
int sendcount,
377 const MPI::Datatype & sendtype,
void *recvbuf,
378 const int recvcounts[],
const int displs[],
379 const MPI::Datatype & recvtype)
const
381 (void)MPI_Allgatherv(const_cast<void *>(sendbuf), sendcount,
383 const_cast<int *
>(recvcounts),
384 const_cast<int *>(displs),
389 MPI::Comm::Alltoall(
const void *sendbuf,
int sendcount,
390 const MPI::Datatype & sendtype,
void *recvbuf,
391 int recvcount,
const MPI::Datatype & recvtype)
const
393 (void)MPI_Alltoall(const_cast<void *>(sendbuf), sendcount,
394 sendtype, recvbuf, recvcount,
399 MPI::Comm::Alltoallv(
const void *sendbuf,
const int sendcounts[],
400 const int sdispls[],
const MPI::Datatype & sendtype,
401 void *recvbuf,
const int recvcounts[],
403 const MPI::Datatype & recvtype)
const
405 (void)MPI_Alltoallv(const_cast<void *>(sendbuf),
406 const_cast<int *
>(sendcounts),
407 const_cast<int *>(sdispls), sendtype, recvbuf,
408 const_cast<int *
>(recvcounts),
409 const_cast<int *>(rdispls),
414 MPI::Comm::Alltoallw(
const void *sendbuf,
const int sendcounts[],
415 const int sdispls[],
const MPI::Datatype sendtypes[],
416 void *recvbuf,
const int recvcounts[],
418 const MPI::Datatype recvtypes[])
const
420 const int comm_size = Get_size();
425 for (
int i_rank=0; i_rank < comm_size; i_rank++) {
426 data_type_tbl[i_rank] = sendtypes[i_rank];
427 data_type_tbl[i_rank + comm_size] = recvtypes[i_rank];
430 (void)MPI_Alltoallw(const_cast<void *>(sendbuf),
431 const_cast<int *
>(sendcounts),
432 const_cast<int *>(sdispls),
433 data_type_tbl, recvbuf,
434 const_cast<int *
>(recvcounts),
435 const_cast<int *>(rdispls),
436 &data_type_tbl[comm_size], mpi_comm);
438 delete[] data_type_tbl;
442 MPI::Comm::Reduce(
const void *sendbuf,
void *recvbuf,
int count,
443 const MPI::Datatype & datatype,
const MPI::Op& op,
446 (void)MPI_Reduce(const_cast<void *>(sendbuf), recvbuf, count, datatype, op, root, mpi_comm);
450 MPI::Comm::Allreduce(
const void *sendbuf,
void *recvbuf,
int count,
451 const MPI::Datatype & datatype,
const MPI::Op& op)
const
453 (void)MPI_Allreduce (const_cast<void *>(sendbuf), recvbuf, count, datatype, op, mpi_comm);
457 MPI::Comm::Reduce_scatter(
const void *sendbuf,
void *recvbuf,
459 const MPI::Datatype & datatype,
460 const MPI::Op& op)
const
462 (void)MPI_Reduce_scatter(const_cast<void *>(sendbuf), recvbuf, recvcounts,
463 datatype, op, mpi_comm);
471 MPI::Comm::Disconnect()
473 (void) MPI_Comm_disconnect(&mpi_comm);
477 inline MPI::Intercomm
478 MPI::Comm::Get_parent()
481 MPI_Comm_get_parent(&parent);
486 inline MPI::Intercomm
487 MPI::Comm::Join(
const int fd)
490 (void) MPI_Comm_join((
int) fd, &newcomm);
499 MPI::Comm::Get_name(
char* comm_name,
int& resultlen)
const
501 (void) MPI_Comm_get_name(mpi_comm, comm_name, &resultlen);
505 MPI::Comm::Set_name(
const char* comm_name)
507 (void) MPI_Comm_set_name(mpi_comm, const_cast<char *>(comm_name));
515 MPI::Comm::Get_topology()
const
518 (void)MPI_Topo_test(mpi_comm, &status);
527 MPI::Comm::Abort(
int errorcode)
529 (void)MPI_Abort(mpi_comm, errorcode);
538 inline MPI::Errhandler
539 MPI::Comm::Get_errhandler()
const
542 MPI_Comm_get_errhandler(mpi_comm, &errhandler);
547 MPI::Comm::Set_errhandler(
const MPI::Errhandler& errhandler)
549 (void)MPI_Comm_set_errhandler(mpi_comm, errhandler);
553 MPI::Comm::Call_errhandler(
int errorcode)
const
555 (void) MPI_Comm_call_errhandler(mpi_comm, errorcode);
561 MPI::Comm::Create_keyval(MPI::Comm::Copy_attr_function* comm_copy_attr_fn,
562 MPI::Comm::Delete_attr_function* comm_delete_attr_fn,
567 ret = do_create_keyval(NULL, NULL,
568 comm_copy_attr_fn, comm_delete_attr_fn,
569 extra_state, keyval);
570 return (MPI_SUCCESS == ret) ? keyval : ret;
576 MPI::Comm::Create_keyval(MPI_Comm_copy_attr_function* comm_copy_attr_fn,
577 MPI_Comm_delete_attr_function* comm_delete_attr_fn,
582 ret = do_create_keyval(comm_copy_attr_fn, comm_delete_attr_fn,
584 extra_state, keyval);
585 return (MPI_SUCCESS == ret) ? keyval : ret;
591 MPI::Comm::Create_keyval(MPI::Comm::Copy_attr_function* comm_copy_attr_fn,
592 MPI_Comm_delete_attr_function* comm_delete_attr_fn,
597 ret = do_create_keyval(NULL, comm_delete_attr_fn,
598 comm_copy_attr_fn, NULL,
599 extra_state, keyval);
600 return (MPI_SUCCESS == ret) ? keyval : ret;
606 MPI::Comm::Create_keyval(MPI_Comm_copy_attr_function* comm_copy_attr_fn,
607 MPI::Comm::Delete_attr_function* comm_delete_attr_fn,
612 ret = do_create_keyval(comm_copy_attr_fn, NULL,
613 NULL, comm_delete_attr_fn,
614 extra_state, keyval);
615 return (MPI_SUCCESS == ret) ? keyval : ret;
619 MPI::Comm::Free_keyval(
int& comm_keyval)
621 (void) MPI_Comm_free_keyval(&comm_keyval);
625 MPI::Comm::Set_attr(
int comm_keyval,
const void* attribute_val)
const
627 (void)MPI_Comm_set_attr(mpi_comm, comm_keyval, const_cast<void*>(attribute_val));
631 MPI::Comm::Get_attr(
int comm_keyval,
void* attribute_val)
const
634 (void)MPI_Comm_get_attr(mpi_comm, comm_keyval, attribute_val, &flag);
635 return OPAL_INT_TO_BOOL(flag);
639 MPI::Comm::Delete_attr(
int comm_keyval)
641 (void)MPI_Comm_delete_attr(mpi_comm, comm_keyval);
648 MPI::Comm::NULL_COPY_FN(
const MPI::Comm& ,
660 MPI::Comm::DUP_FN(
const MPI::Comm& oldcomm,
int comm_keyval,
661 void* extra_state,
void* attribute_val_in,
662 void* attribute_val_out,
bool& flag)
664 if (
sizeof(
bool) !=
sizeof(
int)) {
667 ret = MPI_COMM_DUP_FN(oldcomm, comm_keyval, extra_state,
668 attribute_val_in, attribute_val_out, &f);
669 flag = OPAL_INT_TO_BOOL(f);
672 return MPI_COMM_DUP_FN(oldcomm, comm_keyval, extra_state,
673 attribute_val_in, attribute_val_out,
682 MPI::Comm::NULL_DELETE_FN(MPI::Comm& ,
Definition: ompi_datatype.h:68
Back-end type for MPI_Errorhandler.
Definition: errhandler.h:108
Group structure Currently we have four formats for storing the process pointers that are members of t...
Definition: group.h:79
Definition: communicator.h:118
Main top-level request struct definition.
Definition: request.h:100