MPI_CALL(XBT_PUBLIC int, MPI_Bcast, (void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm));
MPI_CALL(XBT_PUBLIC int, MPI_Barrier, (MPI_Comm comm));
MPI_CALL(XBT_PUBLIC int, MPI_Ibarrier, (MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Ibcast, (void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Igather, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+ MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Igatherv, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+ int* recvcounts, int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Iallgather, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+ int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Iallgatherv, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+ int* recvcounts, int* displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Iscatter, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+ int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Iscatterv, (void* sendbuf, int* sendcounts, int* displs, MPI_Datatype sendtype,
+ void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Ireduce,
+ (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Iallreduce,
+ (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Iscan,
+ (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Iexscan,
+ (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Ireduce_scatter,
+ (void* sendbuf, void* recvbuf, int* recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Ireduce_scatter_block,
+ (void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Ialltoall, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+ int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request));
+MPI_CALL(XBT_PUBLIC int, MPI_Ialltoallv,
+ (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
+ int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request));
+
MPI_CALL(XBT_PUBLIC int, MPI_Gather, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, int root, MPI_Comm comm));
MPI_CALL(XBT_PUBLIC int, MPI_Gatherv, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
WRAPPED_PMPI_CALL(int,MPI_Group_translate_ranks,(MPI_Group group1, int n, int *ranks1, MPI_Group group2, int *ranks2),(group1, n, ranks1, group2, ranks2))
WRAPPED_PMPI_CALL(int,MPI_Group_union,(MPI_Group group1, MPI_Group group2, MPI_Group * newgroup),(group1, group2, newgroup))
WRAPPED_PMPI_CALL(int,MPI_Ibarrier,(MPI_Comm comm, MPI_Request *request),(comm,request))
+WRAPPED_PMPI_CALL(int,MPI_Ibcast,(void* buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request *request),(buf, count, datatype, root, comm, request))
+
+WRAPPED_PMPI_CALL(int,MPI_Iallgather,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request))
+WRAPPED_PMPI_CALL(int,MPI_Iallgatherv,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request))
+WRAPPED_PMPI_CALL(int,MPI_Iallreduce,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, comm, request))
+WRAPPED_PMPI_CALL(int,MPI_Ialltoall,(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount,MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request))
+WRAPPED_PMPI_CALL(int,MPI_Ialltoallv,(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm, request))
+WRAPPED_PMPI_CALL(int,MPI_Igather,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request))
+WRAPPED_PMPI_CALL(int,MPI_Igatherv,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, request))
+//WRAPPED_PMPI_CALL(int,MPI_Ireduce_scatter_block,(void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op,MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, recvcount, datatype, op, comm, request))
+//WRAPPED_PMPI_CALL(int,MPI_Ireduce_scatter,(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, recvcounts, datatype, op, comm, request))
+//WRAPPED_PMPI_CALL(int,MPI_Ireduce,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, root, comm, request))
+//WRAPPED_PMPI_CALL(int,MPI_Iexscan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, comm, request))
+//WRAPPED_PMPI_CALL(int,MPI_Iscan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request),(sendbuf, recvbuf, count, datatype, op, comm, request))
+WRAPPED_PMPI_CALL(int,MPI_Iscatter,(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request))
+WRAPPED_PMPI_CALL(int,MPI_Iscatterv,(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request),(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request))
+
WRAPPED_PMPI_CALL(int,MPI_Info_create,( MPI_Info *info),( info))
WRAPPED_PMPI_CALL(int,MPI_Info_delete,(MPI_Info info, char *key),(info, key))
WRAPPED_PMPI_CALL(int,MPI_Info_dup,(MPI_Info info, MPI_Info *newinfo),(info, newinfo))
int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
{
- int retval = 0;
-
- smpi_bench_end();
-
- if (comm == MPI_COMM_NULL) {
- retval = MPI_ERR_COMM;
- } else if (not datatype->is_valid()) {
- retval = MPI_ERR_ARG;
- } else {
- int rank = simgrid::s4u::this_actor::get_pid();
- TRACE_smpi_comm_in(rank, __func__,
- new simgrid::instr::CollTIData("bcast", root, -1.0,
- datatype->is_replayable() ? count : count * datatype->size(), -1,
- simgrid::smpi::Datatype::encode(datatype), ""));
- if (comm->size() > 1)
- simgrid::smpi::Colls::bcast(buf, count, datatype, root, comm);
- retval = MPI_SUCCESS;
-
- TRACE_smpi_comm_out(rank);
- }
- smpi_bench_begin();
- return retval;
+ return PMPI_Ibcast(buf, count, datatype, root, comm, MPI_REQUEST_IGNORED);
}
int PMPI_Barrier(MPI_Comm comm)
{
- int retval = 0;
+ return PMPI_Ibarrier(comm, MPI_REQUEST_IGNORED);
+}
+int PMPI_Ibarrier(MPI_Comm comm, MPI_Request *request)
+{
+ int retval = 0;
smpi_bench_end();
-
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else {
+ } else if(request == nullptr){
+ retval = MPI_ERR_ARG;
+ }else{
int rank = simgrid::s4u::this_actor::get_pid();
- TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData("barrier"));
-
- simgrid::smpi::Colls::barrier(comm);
-
- //Barrier can be used to synchronize RMA calls. Finish all requests from comm before.
- comm->finish_rma_calls();
-
- retval = MPI_SUCCESS;
-
+ TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData(request==MPI_REQUEST_IGNORED? "barrier" : "ibarrier"));
+ if(request==MPI_REQUEST_IGNORED){
+ simgrid::smpi::Colls::barrier(comm);
+ //Barrier can be used to synchronize RMA calls. Finish all requests from comm before.
+ comm->finish_rma_calls();
+ } else
+ simgrid::smpi::Colls::ibarrier(comm, request);
TRACE_smpi_comm_out(rank);
- }
-
+ }
smpi_bench_begin();
return retval;
}
-int PMPI_Ibarrier(MPI_Comm comm, MPI_Request *request)
+int PMPI_Ibcast(void *buf, int count, MPI_Datatype datatype,
+ int root, MPI_Comm comm, MPI_Request* request)
{
int retval = 0;
smpi_bench_end();
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
+ } else if (not datatype->is_valid()) {
+ retval = MPI_ERR_ARG;
} else if(request == nullptr){
retval = MPI_ERR_ARG;
- }else{
+ } else {
int rank = simgrid::s4u::this_actor::get_pid();
- TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData("ibarrier"));
- simgrid::smpi::Colls::Ibarrier(comm, request);
+ TRACE_smpi_comm_in(rank, __func__,
+ new simgrid::instr::CollTIData(request==MPI_REQUEST_IGNORED?"bcast":"ibcast", root, -1.0,
+ datatype->is_replayable() ? count : count * datatype->size(), -1,
+ simgrid::smpi::Datatype::encode(datatype), ""));
+ if (comm->size() > 1){
+ if(request==MPI_REQUEST_IGNORED)
+ simgrid::smpi::Colls::bcast(buf, count, datatype, root, comm);
+ else
+ simgrid::smpi::Colls::ibcast(buf, count, datatype, root, comm, request);
+ }
+ retval = MPI_SUCCESS;
+
TRACE_smpi_comm_out(rank);
- }
+ }
smpi_bench_begin();
return retval;
}
int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,
- int root, MPI_Comm comm)
+ int root, MPI_Comm comm){
+ return PMPI_Igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Igather(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,
+ int root, MPI_Comm comm, MPI_Request *request)
{
int retval = 0;
retval = MPI_ERR_TYPE;
} else if ((( sendbuf != MPI_IN_PLACE) && (sendcount <0)) || ((comm->rank() == root) && (recvcount <0))){
retval = MPI_ERR_COUNT;
- } else {
+ } else if (request == nullptr){
+ retval = MPI_ERR_ARG;
+ } else {
char* sendtmpbuf = static_cast<char*>(sendbuf);
int sendtmpcount = sendcount;
TRACE_smpi_comm_in(
rank, __func__,
new simgrid::instr::CollTIData(
- "gather", root, -1.0, sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
+ request==MPI_REQUEST_IGNORED ? "gather":"igather", root, -1.0, sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
(comm->rank() != root || recvtype->is_replayable()) ? recvcount : recvcount * recvtype->size(),
simgrid::smpi::Datatype::encode(sendtmptype), simgrid::smpi::Datatype::encode(recvtype)));
-
- simgrid::smpi::Colls::gather(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, root, comm);
+ if(request == MPI_REQUEST_IGNORED)
+ simgrid::smpi::Colls::gather(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, root, comm);
+ else
+ simgrid::smpi::Colls::igather(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, root, comm, request);
retval = MPI_SUCCESS;
TRACE_smpi_comm_out(rank);
}
int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,
- MPI_Datatype recvtype, int root, MPI_Comm comm)
+ MPI_Datatype recvtype, int root, MPI_Comm comm){
+ return PMPI_Igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Igatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,
+ MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)
{
int retval = 0;
retval = MPI_ERR_COUNT;
} else if ((comm->rank() == root) && (recvcounts == nullptr || displs == nullptr)) {
retval = MPI_ERR_ARG;
- } else {
+ } else if (request == nullptr){
+ retval = MPI_ERR_ARG;
+ } else {
char* sendtmpbuf = static_cast<char*>(sendbuf);
int sendtmpcount = sendcount;
MPI_Datatype sendtmptype = sendtype;
TRACE_smpi_comm_in(rank, __func__,
new simgrid::instr::VarCollTIData(
- "gatherv", root,
+ request==MPI_REQUEST_IGNORED ? "gatherv":"igatherv", root,
sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(), nullptr,
dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtmptype),
simgrid::smpi::Datatype::encode(recvtype)));
-
- retval = simgrid::smpi::Colls::gatherv(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcounts, displs, recvtype, root, comm);
+ if(request == MPI_REQUEST_IGNORED)
+ retval = simgrid::smpi::Colls::gatherv(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcounts, displs, recvtype, root, comm);
+ else
+ retval = simgrid::smpi::Colls::igatherv(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcounts, displs, recvtype, root, comm, request);
TRACE_smpi_comm_out(rank);
}
}
int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
- void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
+ void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm){
+ return PMPI_Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Iallgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+ void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
{
int retval = MPI_SUCCESS;
} else if ((( sendbuf != MPI_IN_PLACE) && (sendcount <0)) ||
(recvcount <0)){
retval = MPI_ERR_COUNT;
- } else {
+ } else if (request == nullptr){
+ retval = MPI_ERR_ARG;
+ } else {
if(sendbuf == MPI_IN_PLACE) {
sendbuf=static_cast<char*>(recvbuf)+recvtype->get_extent()*recvcount*comm->rank();
sendcount=recvcount;
TRACE_smpi_comm_in(rank, __func__,
new simgrid::instr::CollTIData(
- "allgather", -1, -1.0, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
+ request==MPI_REQUEST_IGNORED ? "allgather" : "iallgather", -1, -1.0, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
-
- simgrid::smpi::Colls::allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
+ if(request == MPI_REQUEST_IGNORED)
+ simgrid::smpi::Colls::allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
+ else
+ simgrid::smpi::Colls::iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, request);
TRACE_smpi_comm_out(rank);
}
smpi_bench_begin();
}
int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
- void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm)
+ void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm){
+ return PMPI_Iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Iallgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+ void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
{
int retval = 0;
retval = MPI_ERR_COUNT;
} else if (recvcounts == nullptr || displs == nullptr) {
retval = MPI_ERR_ARG;
- } else {
+ } else if (request == nullptr){
+ retval = MPI_ERR_ARG;
+ } else {
if(sendbuf == MPI_IN_PLACE) {
sendbuf=static_cast<char*>(recvbuf)+recvtype->get_extent()*displs[comm->rank()];
TRACE_smpi_comm_in(rank, __func__,
new simgrid::instr::VarCollTIData(
- "allgatherv", -1, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
+ request==MPI_REQUEST_IGNORED ? "allgatherv" : "iallgatherv", -1, sendtype->is_replayable() ? sendcount : sendcount * sendtype->size(),
nullptr, dt_size_recv, trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
simgrid::smpi::Datatype::encode(recvtype)));
-
- simgrid::smpi::Colls::allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
+ if(request == MPI_REQUEST_IGNORED)
+ simgrid::smpi::Colls::allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm);
+ else
+ simgrid::smpi::Colls::iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, request);
retval = MPI_SUCCESS;
TRACE_smpi_comm_out(rank);
}
}
int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
- void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
+ void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm){
+ return PMPI_Iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Iscatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+ void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
{
int retval = 0;
TRACE_smpi_comm_in(
rank, __func__,
new simgrid::instr::CollTIData(
- "scatter", root, -1.0,
+ request==MPI_REQUEST_IGNORED ? "scatter" : "iscatter", root, -1.0,
(comm->rank() != root || sendtype->is_replayable()) ? sendcount : sendcount * sendtype->size(),
recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
-
- simgrid::smpi::Colls::scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
+ if(request == MPI_REQUEST_IGNORED)
+ simgrid::smpi::Colls::scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
+ else
+ simgrid::smpi::Colls::iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, request);
retval = MPI_SUCCESS;
TRACE_smpi_comm_out(rank);
}
}
int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs,
- MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
+ MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm){
+ return PMPI_Iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Iscatterv(void *sendbuf, int *sendcounts, int *displs,
+ MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)
{
int retval = 0;
} else if (((comm->rank() == root) && (sendtype == MPI_DATATYPE_NULL)) ||
((recvbuf != MPI_IN_PLACE) && (recvtype == MPI_DATATYPE_NULL))) {
retval = MPI_ERR_TYPE;
+ } else if (request == nullptr){
+ retval = MPI_ERR_ARG;
} else {
if (recvbuf == MPI_IN_PLACE) {
recvtype = sendtype;
TRACE_smpi_comm_in(rank, __func__,
new simgrid::instr::VarCollTIData(
- "scatterv", root, dt_size_send, trace_sendcounts,
+ request==MPI_REQUEST_IGNORED ? "scatterv":"iscatterv", root, dt_size_send, trace_sendcounts,
recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(), nullptr,
simgrid::smpi::Datatype::encode(sendtype), simgrid::smpi::Datatype::encode(recvtype)));
-
- retval = simgrid::smpi::Colls::scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm);
+ if(request == MPI_REQUEST_IGNORED)
+ retval = simgrid::smpi::Colls::scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm);
+ else
+ retval = simgrid::smpi::Colls::iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, request);
TRACE_smpi_comm_out(rank);
}
}
int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+ return PMPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request)
{
int retval = 0;
retval = MPI_ERR_TYPE;
} else if (op == MPI_OP_NULL) {
retval = MPI_ERR_OP;
+ } else if (request != MPI_REQUEST_IGNORED) {
+ xbt_die("Iallreduce is not yet implemented. WIP");
+ retval = MPI_ERR_ARG;
} else {
char* sendtmpbuf = static_cast<char*>(sendbuf);
int rank = simgrid::s4u::this_actor::get_pid();
TRACE_smpi_comm_in(rank, __func__,
- new simgrid::instr::CollTIData("allreduce", -1, 0,
+ new simgrid::instr::CollTIData(request==MPI_REQUEST_IGNORED ? "allreduce":"iallreduce", -1, 0,
datatype->is_replayable() ? count : count * datatype->size(), -1,
simgrid::smpi::Datatype::encode(datatype), ""));
- simgrid::smpi::Colls::allreduce(sendtmpbuf, recvbuf, count, datatype, op, comm);
+// if(request == MPI_REQUEST_IGNORED)
+ simgrid::smpi::Colls::allreduce(sendtmpbuf, recvbuf, count, datatype, op, comm);
+// else
+// simgrid::smpi::Colls::iallreduce(sendtmpbuf, recvbuf, count, datatype, op, comm, request);
if( sendbuf == MPI_IN_PLACE )
xbt_free(sendtmpbuf);
smpi_bench_begin();
return retval;
}
-
int PMPI_Alltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
- MPI_Datatype recvtype, MPI_Comm comm)
+ MPI_Datatype recvtype, MPI_Comm comm){
+ return PMPI_Ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+ MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request)
{
int retval = 0;
smpi_bench_end();
retval = MPI_ERR_COMM;
} else if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL) || recvtype == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
+ } else if (request == nullptr){
+ retval = MPI_ERR_ARG;
} else {
int rank = simgrid::s4u::this_actor::get_pid();
void* sendtmpbuf = static_cast<char*>(sendbuf);
TRACE_smpi_comm_in(rank, __func__,
new simgrid::instr::CollTIData(
- "alltoall", -1, -1.0,
+ request==MPI_REQUEST_IGNORED ? "alltoall" : "ialltoall", -1, -1.0,
sendtmptype->is_replayable() ? sendtmpcount : sendtmpcount * sendtmptype->size(),
recvtype->is_replayable() ? recvcount : recvcount * recvtype->size(),
simgrid::smpi::Datatype::encode(sendtmptype), simgrid::smpi::Datatype::encode(recvtype)));
-
- retval = simgrid::smpi::Colls::alltoall(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, comm);
+ if(request == MPI_REQUEST_IGNORED)
+ retval = simgrid::smpi::Colls::alltoall(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, comm);
+ else
+ retval = simgrid::smpi::Colls::ialltoall(sendtmpbuf, sendtmpcount, sendtmptype, recvbuf, recvcount, recvtype, comm, request);
TRACE_smpi_comm_out(rank);
int PMPI_Alltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf,
int* recvcounts, int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
+{
+ return PMPI_Ialltoallv(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm, MPI_REQUEST_IGNORED);
+}
+
+int PMPI_Ialltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf,
+ int* recvcounts, int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request)
{
int retval = 0;
if (comm == MPI_COMM_NULL) {
retval = MPI_ERR_COMM;
- } else if (sendtype == MPI_DATATYPE_NULL || recvtype == MPI_DATATYPE_NULL) {
+ } else if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL) || recvtype == MPI_DATATYPE_NULL) {
retval = MPI_ERR_TYPE;
} else if ((sendbuf != MPI_IN_PLACE && (sendcounts == nullptr || senddisps == nullptr)) || recvcounts == nullptr ||
recvdisps == nullptr) {
retval = MPI_ERR_ARG;
- } else {
+ } else if (request == nullptr){
+ retval = MPI_ERR_ARG;
+ } else {
int rank = simgrid::s4u::this_actor::get_pid();
int size = comm->size();
int send_size = 0;
}
TRACE_smpi_comm_in(rank, __func__,
- new simgrid::instr::VarCollTIData("alltoallv", -1, send_size, trace_sendcounts, recv_size,
+ new simgrid::instr::VarCollTIData(request==MPI_REQUEST_IGNORED ? "alltoallv":"ialltoallv", -1, send_size, trace_sendcounts, recv_size,
trace_recvcounts, simgrid::smpi::Datatype::encode(sendtype),
simgrid::smpi::Datatype::encode(recvtype)));
- retval = simgrid::smpi::Colls::alltoallv(sendtmpbuf, sendtmpcounts, sendtmpdisps, sendtmptype, recvbuf, recvcounts,
+ if(request == MPI_REQUEST_IGNORED)
+ retval = simgrid::smpi::Colls::alltoallv(sendtmpbuf, sendtmpcounts, sendtmpdisps, sendtmptype, recvbuf, recvcounts,
recvdisps, recvtype, comm);
+ else
+ retval = simgrid::smpi::Colls::ialltoallv(sendtmpbuf, sendtmpcounts, sendtmpdisps, sendtmptype, recvbuf, recvcounts,
+ recvdisps, recvtype, comm, request);
TRACE_smpi_comm_out(rank);
if (sendbuf == MPI_IN_PLACE) {
int Coll_alltoall_basic_linear::alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
{
- int system_tag = 888;
+ int system_tag = COLL_TAG_ALLTOALL;
int i;
int count;
MPI_Aint lb = 0, sendext = 0, recvext = 0;
int Colls::gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, int root, MPI_Comm comm)
{
- int system_tag = COLL_TAG_GATHERV;
- MPI_Aint lb = 0;
- MPI_Aint recvext = 0;
-
- int rank = comm->rank();
- int size = comm->size();
- if (rank != root) {
- // Send buffer to root
- Request::send(sendbuf, sendcount, sendtype, root, system_tag, comm);
- } else {
- recvtype->extent(&lb, &recvext);
- // Local copy from root
- Datatype::copy(sendbuf, sendcount, sendtype, static_cast<char*>(recvbuf) + displs[root] * recvext,
- recvcounts[root], recvtype);
- // Receive buffers from senders
- MPI_Request *requests = xbt_new(MPI_Request, size - 1);
- int index = 0;
- for (int src = 0; src < size; src++) {
- if(src != root) {
- requests[index] = Request::irecv_init(static_cast<char*>(recvbuf) + displs[src] * recvext,
- recvcounts[src], recvtype, src, system_tag, comm);
- index++;
- }
- }
- // Wait for completion of irecv's.
- Request::startall(size - 1, requests);
- Request::waitall(size - 1, requests, MPI_STATUS_IGNORE);
- for (int src = 0; src < size-1; src++) {
- Request::unref(&requests[src]);
- }
- xbt_free(requests);
+ MPI_Request request;
+ Colls::igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, &request);
+ MPI_Request* requests = request->get_nbc_requests();
+ int count = request->get_nbc_requests_size();
+ Request::waitall(count, requests, MPI_STATUS_IGNORE);
+ for (int i = 0; i < count; i++) {
+ if(requests[i]!=MPI_REQUEST_NULL)
+ Request::unref(&requests[i]);
}
+ delete[] requests;
+ Request::unref(&request);
return MPI_SUCCESS;
}
int Colls::scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,
MPI_Datatype recvtype, int root, MPI_Comm comm)
{
- int system_tag = COLL_TAG_SCATTERV;
- MPI_Aint lb = 0;
- MPI_Aint sendext = 0;
-
- int rank = comm->rank();
- int size = comm->size();
- if(rank != root) {
- // Recv buffer from root
- Request::recv(recvbuf, recvcount, recvtype, root, system_tag, comm, MPI_STATUS_IGNORE);
- } else {
- sendtype->extent(&lb, &sendext);
- // Local copy from root
- if(recvbuf!=MPI_IN_PLACE){
- Datatype::copy(static_cast<char *>(sendbuf) + displs[root] * sendext, sendcounts[root],
- sendtype, recvbuf, recvcount, recvtype);
- }
- // Send buffers to receivers
- MPI_Request *requests = xbt_new(MPI_Request, size - 1);
- int index = 0;
- for (int dst = 0; dst < size; dst++) {
- if (dst != root) {
- requests[index] = Request::isend_init(static_cast<char *>(sendbuf) + displs[dst] * sendext, sendcounts[dst],
- sendtype, dst, system_tag, comm);
- index++;
- }
- }
- // Wait for completion of isend's.
- Request::startall(size - 1, requests);
- Request::waitall(size - 1, requests, MPI_STATUS_IGNORE);
- for (int dst = 0; dst < size-1; dst++) {
+ MPI_Request request;
+ Colls::iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, &request);
+ MPI_Request* requests = request->get_nbc_requests();
+ int count = request->get_nbc_requests_size();
+ Request::waitall(count, requests, MPI_STATUS_IGNORE);
+ for (int dst = 0; dst < count; dst++) {
+ if(requests[dst]!=MPI_REQUEST_NULL)
Request::unref(&requests[dst]);
- }
- xbt_free(requests);
}
+ delete[] requests;
+ Request::unref(&request);
return MPI_SUCCESS;
}
int Coll_gather_default::gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
{
- const int system_tag = COLL_TAG_GATHER;
- MPI_Aint lb = 0;
- MPI_Aint recvext = 0;
-
- int rank = comm->rank();
- int size = comm->size();
- if(rank != root) {
- // Send buffer to root
- Request::send(sendbuf, sendcount, sendtype, root, system_tag, comm);
- } else {
- recvtype->extent(&lb, &recvext);
- // Local copy from root
- Datatype::copy(sendbuf, sendcount, sendtype, static_cast<char*>(recvbuf) + root * recvcount * recvext,
- recvcount, recvtype);
- // Receive buffers from senders
- MPI_Request *requests = xbt_new(MPI_Request, size - 1);
- int index = 0;
- for (int src = 0; src < size; src++) {
- if(src != root) {
- requests[index] = Request::irecv_init(static_cast<char*>(recvbuf) + src * recvcount * recvext, recvcount, recvtype,
- src, system_tag, comm);
- index++;
- }
- }
- // Wait for completion of irecv's.
- Request::startall(size - 1, requests);
- Request::waitall(size - 1, requests, MPI_STATUS_IGNORE);
- for (int src = 0; src < size-1; src++) {
- Request::unref(&requests[src]);
- }
- xbt_free(requests);
+ MPI_Request request;
+ Colls::igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, &request);
+ MPI_Request* requests = request->get_nbc_requests();
+ int count = request->get_nbc_requests_size();
+ Request::waitall(count, requests, MPI_STATUS_IGNORE);
+ for (int i = 0; i < count; i++) {
+ if(requests[i]!=MPI_REQUEST_NULL)
+ Request::unref(&requests[i]);
}
+ delete[] requests;
+ Request::unref(&request);
return MPI_SUCCESS;
}
int Coll_allgather_default::allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf,int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
{
- const int system_tag = COLL_TAG_ALLGATHER;
- MPI_Aint lb = 0;
- MPI_Aint recvext = 0;
- MPI_Request *requests;
-
- int rank = comm->rank();
- int size = comm->size();
- // FIXME: check for errors
- recvtype->extent(&lb, &recvext);
- // Local copy from self
- Datatype::copy(sendbuf, sendcount, sendtype, static_cast<char *>(recvbuf) + rank * recvcount * recvext, recvcount,
- recvtype);
- // Send/Recv buffers to/from others;
- requests = xbt_new(MPI_Request, 2 * (size - 1));
- int index = 0;
- for (int other = 0; other < size; other++) {
- if(other != rank) {
- requests[index] = Request::isend_init(sendbuf, sendcount, sendtype, other, system_tag,comm);
- index++;
- requests[index] = Request::irecv_init(static_cast<char *>(recvbuf) + other * recvcount * recvext, recvcount, recvtype,
- other, system_tag, comm);
- index++;
- }
- }
- // Wait for completion of all comms.
- Request::startall(2 * (size - 1), requests);
- Request::waitall(2 * (size - 1), requests, MPI_STATUS_IGNORE);
- for (int other = 0; other < 2*(size-1); other++) {
+ MPI_Request request;
+ Colls::iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, &request);
+ MPI_Request* requests = request->get_nbc_requests();
+ int count = request->get_nbc_requests_size();
+ Request::waitall(count, requests, MPI_STATUS_IGNORE);
+ for (int other = 0; other < count; other++) {
Request::unref(&requests[other]);
}
- xbt_free(requests);
+ delete[] requests;
+ Request::unref(&request);
return MPI_SUCCESS;
}
int Coll_allgatherv_default::allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm)
{
- const int system_tag = COLL_TAG_ALLGATHERV;
- MPI_Aint lb = 0;
- MPI_Aint recvext = 0;
-
- int rank = comm->rank();
- int size = comm->size();
- recvtype->extent(&lb, &recvext);
- // Local copy from self
- Datatype::copy(sendbuf, sendcount, sendtype,
- static_cast<char *>(recvbuf) + displs[rank] * recvext,recvcounts[rank], recvtype);
- // Send buffers to others;
- MPI_Request *requests = xbt_new(MPI_Request, 2 * (size - 1));
- int index = 0;
- for (int other = 0; other < size; other++) {
- if(other != rank) {
- requests[index] =
- Request::isend_init(sendbuf, sendcount, sendtype, other, system_tag, comm);
- index++;
- requests[index] = Request::irecv_init(static_cast<char *>(recvbuf) + displs[other] * recvext, recvcounts[other],
- recvtype, other, system_tag, comm);
- index++;
- }
- }
- // Wait for completion of all comms.
- Request::startall(2 * (size - 1), requests);
- Request::waitall(2 * (size - 1), requests, MPI_STATUS_IGNORE);
- for (int other = 0; other < 2*(size-1); other++) {
+ MPI_Request request;
+ Colls::iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, &request);
+ MPI_Request* requests = request->get_nbc_requests();
+ int count = request->get_nbc_requests_size();
+ Request::waitall(count, requests, MPI_STATUS_IGNORE);
+ for (int other = 0; other < count; other++) {
Request::unref(&requests[other]);
}
- xbt_free(requests);
+ delete[] requests;
+ Request::unref(&request);
return MPI_SUCCESS;
}
int Coll_scatter_default::scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
{
- const int system_tag = COLL_TAG_SCATTER;
- MPI_Aint lb = 0;
- MPI_Aint sendext = 0;
- MPI_Request *requests;
-
- int rank = comm->rank();
- int size = comm->size();
- if(rank != root) {
- // Recv buffer from root
- Request::recv(recvbuf, recvcount, recvtype, root, system_tag, comm, MPI_STATUS_IGNORE);
- } else {
- sendtype->extent(&lb, &sendext);
- // Local copy from root
- if(recvbuf!=MPI_IN_PLACE){
- Datatype::copy(static_cast<char *>(sendbuf) + root * sendcount * sendext,
- sendcount, sendtype, recvbuf, recvcount, recvtype);
- }
- // Send buffers to receivers
- requests = xbt_new(MPI_Request, size - 1);
- int index = 0;
- for(int dst = 0; dst < size; dst++) {
- if(dst != root) {
- requests[index] = Request::isend_init(static_cast<char *>(sendbuf) + dst * sendcount * sendext, sendcount, sendtype,
- dst, system_tag, comm);
- index++;
- }
- }
- // Wait for completion of isend's.
- Request::startall(size - 1, requests);
- Request::waitall(size - 1, requests, MPI_STATUS_IGNORE);
- for (int dst = 0; dst < size-1; dst++) {
+ MPI_Request request;
+ Colls::iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, &request);
+ MPI_Request* requests = request->get_nbc_requests();
+ int count = request->get_nbc_requests_size();
+ Request::waitall(count, requests, MPI_STATUS_IGNORE);
+ for (int dst = 0; dst < count; dst++) {
+ if(requests[dst]!=MPI_REQUEST_NULL)
Request::unref(&requests[dst]);
- }
- xbt_free(requests);
}
+ delete[] requests;
+ Request::unref(&request);
return MPI_SUCCESS;
}
int Coll_alltoallv_default::alltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype,
void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm)
{
- const int system_tag = 889;
- MPI_Aint lb = 0;
- MPI_Aint sendext = 0;
- MPI_Aint recvext = 0;
- MPI_Request *requests;
-
- /* Initialize. */
- int rank = comm->rank();
- int size = comm->size();
- XBT_DEBUG("<%d> algorithm basic_alltoallv() called.", rank);
- sendtype->extent(&lb, &sendext);
- recvtype->extent(&lb, &recvext);
- /* Local copy from self */
- int err = Datatype::copy(static_cast<char *>(sendbuf) + senddisps[rank] * sendext, sendcounts[rank], sendtype,
- static_cast<char *>(recvbuf) + recvdisps[rank] * recvext, recvcounts[rank], recvtype);
- if (err == MPI_SUCCESS && size > 1) {
- /* Initiate all send/recv to/from others. */
- requests = xbt_new(MPI_Request, 2 * (size - 1));
- int count = 0;
- /* Create all receives that will be posted first */
- for (int i = 0; i < size; ++i) {
- if (i != rank && recvcounts[i] != 0) {
- requests[count] = Request::irecv_init(static_cast<char *>(recvbuf) + recvdisps[i] * recvext,
- recvcounts[i], recvtype, i, system_tag, comm);
- count++;
- }else{
- XBT_DEBUG("<%d> skip request creation [src = %d, recvcounts[src] = %d]", rank, i, recvcounts[i]);
- }
- }
- /* Now create all sends */
- for (int i = 0; i < size; ++i) {
- if (i != rank && sendcounts[i] != 0) {
- requests[count] = Request::isend_init(static_cast<char *>(sendbuf) + senddisps[i] * sendext,
- sendcounts[i], sendtype, i, system_tag, comm);
- count++;
- }else{
- XBT_DEBUG("<%d> skip request creation [dst = %d, sendcounts[dst] = %d]", rank, i, sendcounts[i]);
- }
- }
- /* Wait for them all. */
- Request::startall(count, requests);
- XBT_DEBUG("<%d> wait for %d requests", rank, count);
- Request::waitall(count, requests, MPI_STATUS_IGNORE);
- for (int i = 0; i < count; i++) {
- if(requests[i]!=MPI_REQUEST_NULL)
- Request::unref(&requests[i]);
- }
- xbt_free(requests);
+ MPI_Request request;
+ int err = Colls::ialltoallv(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm, &request);
+ MPI_Request* requests = request->get_nbc_requests();
+ int count = request->get_nbc_requests_size();
+ XBT_DEBUG("<%d> wait for %d requests", comm->rank(), count);
+ Request::waitall(count, requests, MPI_STATUS_IGNORE);
+ for (int i = 0; i < count; i++) {
+ if(requests[i]!=MPI_REQUEST_NULL)
+ Request::unref(&requests[i]);
}
+ delete[] requests;
+ Request::unref(&request);
return err;
}
namespace smpi{
-int Colls::Ibarrier(MPI_Comm comm, MPI_Request* request)
+int Colls::ibarrier(MPI_Comm comm, MPI_Request* request)
{
int i;
int size = comm->size();
int rank = comm->rank();
MPI_Request* requests;
(*request) = new Request( nullptr, 0, MPI_BYTE,
- rank,rank, COLL_TAG_BARRIER, comm, MPI_REQ_NON_PERSISTENT);
- (*request)->ref();
+ rank,rank, COLL_TAG_BARRIER, comm, MPI_REQ_PERSISTENT);
if (rank > 0) {
requests = new MPI_Request[2];
requests[0] = Request::isend (nullptr, 0, MPI_BYTE, 0,
return MPI_SUCCESS;
}
+int Colls::ibcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm, MPI_Request* request)
+{
+ int i;
+ int size = comm->size();
+ int rank = comm->rank();
+ MPI_Request* requests;
+ (*request) = new Request( nullptr, 0, MPI_BYTE,
+ rank,rank, COLL_TAG_BARRIER, comm, MPI_REQ_PERSISTENT);
+ if (rank != root) {
+ requests = new MPI_Request[1];
+ requests[0] = Request::irecv (buf, count, datatype, root,
+ COLL_TAG_BCAST,
+ comm);
+ (*request)->set_nbc_requests(requests, 1);
+ }
+ else {
+ requests = new MPI_Request[size-1];
+ int n = 0;
+ for (i = 0; i < size; i++) {
+ if(i!=root){
+ requests[n] = Request::isend(buf, count, datatype, i,
+ COLL_TAG_BCAST,
+ comm
+ );
+ n++;
+ }
+ }
+ (*request)->set_nbc_requests(requests, size-1);
+ }
+ return MPI_SUCCESS;
+}
+
+int Colls::iallgather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+ void *recvbuf,int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
+{
+
+ const int system_tag = COLL_TAG_ALLGATHER;
+ MPI_Aint lb = 0;
+ MPI_Aint recvext = 0;
+ MPI_Request *requests;
+
+ int rank = comm->rank();
+ int size = comm->size();
+ (*request) = new Request( nullptr, 0, MPI_BYTE,
+ rank,rank, COLL_TAG_BARRIER, comm, MPI_REQ_PERSISTENT);
+ // FIXME: check for errors
+ recvtype->extent(&lb, &recvext);
+ // Local copy from self
+ Datatype::copy(sendbuf, sendcount, sendtype, static_cast<char *>(recvbuf) + rank * recvcount * recvext, recvcount,
+ recvtype);
+ // Send/Recv buffers to/from others;
+ requests = new MPI_Request[2 * (size - 1)];
+ int index = 0;
+ for (int other = 0; other < size; other++) {
+ if(other != rank) {
+ requests[index] = Request::isend_init(sendbuf, sendcount, sendtype, other, system_tag,comm);
+ index++;
+ requests[index] = Request::irecv_init(static_cast<char *>(recvbuf) + other * recvcount * recvext, recvcount, recvtype,
+ other, system_tag, comm);
+ index++;
+ }
+ }
+ Request::startall(2 * (size - 1), requests);
+ (*request)->set_nbc_requests(requests, 2 * (size - 1));
+ return MPI_SUCCESS;
+}
+
+int Colls::iscatter(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+ void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request)
+{
+ const int system_tag = COLL_TAG_SCATTER;
+ MPI_Aint lb = 0;
+ MPI_Aint sendext = 0;
+ MPI_Request *requests;
+
+ int rank = comm->rank();
+ int size = comm->size();
+ (*request) = new Request( nullptr, 0, MPI_BYTE,
+ rank,rank, COLL_TAG_BARRIER, comm, MPI_REQ_PERSISTENT);
+ if(rank != root) {
+ requests = new MPI_Request[1];
+ // Recv buffer from root
+ requests[0] = Request::irecv(recvbuf, recvcount, recvtype, root, system_tag, comm);
+ (*request)->set_nbc_requests(requests, 1);
+ } else {
+ sendtype->extent(&lb, &sendext);
+ // Local copy from root
+ if(recvbuf!=MPI_IN_PLACE){
+ Datatype::copy(static_cast<char *>(sendbuf) + root * sendcount * sendext,
+ sendcount, sendtype, recvbuf, recvcount, recvtype);
+ }
+ // Send buffers to receivers
+ requests = new MPI_Request[size - 1];
+ int index = 0;
+ for(int dst = 0; dst < size; dst++) {
+ if(dst != root) {
+ requests[index] = Request::isend_init(static_cast<char *>(sendbuf) + dst * sendcount * sendext, sendcount, sendtype,
+ dst, system_tag, comm);
+ index++;
+ }
+ }
+ // Wait for completion of isend's.
+ Request::startall(size - 1, requests);
+ (*request)->set_nbc_requests(requests, size - 1);
+ }
+ return MPI_SUCCESS;
+}
+
+int Colls::iallgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,
+ int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request)
+{
+ const int system_tag = COLL_TAG_ALLGATHERV;
+ MPI_Aint lb = 0;
+ MPI_Aint recvext = 0;
+
+ int rank = comm->rank();
+ int size = comm->size();
+ (*request) = new Request( nullptr, 0, MPI_BYTE,
+ rank,rank, COLL_TAG_BARRIER, comm, MPI_REQ_PERSISTENT);
+ recvtype->extent(&lb, &recvext);
+ // Local copy from self
+ Datatype::copy(sendbuf, sendcount, sendtype,
+ static_cast<char *>(recvbuf) + displs[rank] * recvext,recvcounts[rank], recvtype);
+ // Send buffers to others;
+ MPI_Request *requests = new MPI_Request[2 * (size - 1)];
+ int index = 0;
+ for (int other = 0; other < size; other++) {
+ if(other != rank) {
+ requests[index] =
+ Request::isend_init(sendbuf, sendcount, sendtype, other, system_tag, comm);
+ index++;
+ requests[index] = Request::irecv_init(static_cast<char *>(recvbuf) + displs[other] * recvext, recvcounts[other],
+ recvtype, other, system_tag, comm);
+ index++;
+ }
+ }
+ // Wait for completion of all comms.
+ Request::startall(2 * (size - 1), requests);
+ (*request)->set_nbc_requests(requests, 2 * (size - 1));
+ return MPI_SUCCESS;
+}
+
+int Colls::ialltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request){
+int system_tag = COLL_TAG_ALLTOALL;
+ int i;
+ int count;
+ MPI_Aint lb = 0, sendext = 0, recvext = 0;
+ MPI_Request *requests;
+
+ /* Initialize. */
+ int rank = comm->rank();
+ int size = comm->size();
+ (*request) = new Request( nullptr, 0, MPI_BYTE,
+ rank,rank, COLL_TAG_ALLTOALL, comm, MPI_REQ_PERSISTENT);
+ sendtype->extent(&lb, &sendext);
+ recvtype->extent(&lb, &recvext);
+ /* simple optimization */
+ int err = Datatype::copy(static_cast<char *>(sendbuf) + rank * sendcount * sendext, sendcount, sendtype,
+ static_cast<char *>(recvbuf) + rank * recvcount * recvext, recvcount, recvtype);
+ if (err == MPI_SUCCESS && size > 1) {
+ /* Initiate all send/recv to/from others. */
+ requests = new MPI_Request[2 * (size - 1)];
+ /* Post all receives first -- a simple optimization */
+ count = 0;
+ for (i = (rank + 1) % size; i != rank; i = (i + 1) % size) {
+ requests[count] = Request::irecv_init(static_cast<char *>(recvbuf) + i * recvcount * recvext, recvcount,
+ recvtype, i, system_tag, comm);
+ count++;
+ }
+ /* Now post all sends in reverse order
+ * - We would like to minimize the search time through message queue
+ * when messages actually arrive in the order in which they were posted.
+ * TODO: check the previous assertion
+ */
+ for (i = (rank + size - 1) % size; i != rank; i = (i + size - 1) % size) {
+ requests[count] = Request::isend_init(static_cast<char *>(sendbuf) + i * sendcount * sendext, sendcount,
+ sendtype, i, system_tag, comm);
+ count++;
+ }
+ /* Wait for them all. */
+ Request::startall(count, requests);
+ (*request)->set_nbc_requests(requests, count);
+ }
+ return MPI_SUCCESS;
+}
+
+int Colls::ialltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype,
+ void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request){
+ const int system_tag = COLL_TAG_ALLTOALLV;
+ MPI_Aint lb = 0;
+ MPI_Aint sendext = 0;
+ MPI_Aint recvext = 0;
+ MPI_Request *requests;
+
+ /* Initialize. */
+ int rank = comm->rank();
+ int size = comm->size();
+ (*request) = new Request( nullptr, 0, MPI_BYTE,
+ rank,rank, COLL_TAG_ALLTOALLV, comm, MPI_REQ_PERSISTENT);
+ sendtype->extent(&lb, &sendext);
+ recvtype->extent(&lb, &recvext);
+ /* Local copy from self */
+ int err = Datatype::copy(static_cast<char *>(sendbuf) + senddisps[rank] * sendext, sendcounts[rank], sendtype,
+ static_cast<char *>(recvbuf) + recvdisps[rank] * recvext, recvcounts[rank], recvtype);
+ if (err == MPI_SUCCESS && size > 1) {
+ /* Initiate all send/recv to/from others. */
+ requests = new MPI_Request[2 * (size - 1)];
+ int count = 0;
+ /* Create all receives that will be posted first */
+ for (int i = 0; i < size; ++i) {
+ if (i != rank && recvcounts[i] != 0) {
+ requests[count] = Request::irecv_init(static_cast<char *>(recvbuf) + recvdisps[i] * recvext,
+ recvcounts[i], recvtype, i, system_tag, comm);
+ count++;
+ }else{
+ XBT_DEBUG("<%d> skip request creation [src = %d, recvcounts[src] = %d]", rank, i, recvcounts[i]);
+ }
+ }
+ /* Now create all sends */
+ for (int i = 0; i < size; ++i) {
+ if (i != rank && sendcounts[i] != 0) {
+ requests[count] = Request::isend_init(static_cast<char *>(sendbuf) + senddisps[i] * sendext,
+ sendcounts[i], sendtype, i, system_tag, comm);
+ count++;
+ }else{
+ XBT_DEBUG("<%d> skip request creation [dst = %d, sendcounts[dst] = %d]", rank, i, sendcounts[i]);
+ }
+ }
+ /* Wait for them all. */
+ Request::startall(count, requests);
+ (*request)->set_nbc_requests(requests, count);
+ }
+ return err;
+}
+
+int Colls::igather(void *sendbuf, int sendcount, MPI_Datatype sendtype,
+ void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)
+{
+ const int system_tag = COLL_TAG_GATHER;
+ MPI_Aint lb = 0;
+ MPI_Aint recvext = 0;
+ MPI_Request *requests;
+
+ int rank = comm->rank();
+ int size = comm->size();
+ (*request) = new Request( nullptr, 0, MPI_BYTE,
+ rank,rank, COLL_TAG_GATHER, comm, MPI_REQ_PERSISTENT);
+ if(rank != root) {
+ // Send buffer to root
+ requests = new MPI_Request[1];
+ requests[0]=Request::isend(sendbuf, sendcount, sendtype, root, system_tag, comm);
+ (*request)->set_nbc_requests(requests, 1);
+ } else {
+ recvtype->extent(&lb, &recvext);
+ // Local copy from root
+ Datatype::copy(sendbuf, sendcount, sendtype, static_cast<char*>(recvbuf) + root * recvcount * recvext,
+ recvcount, recvtype);
+ // Receive buffers from senders
+ requests = new MPI_Request[size - 1];
+ int index = 0;
+ for (int src = 0; src < size; src++) {
+ if(src != root) {
+ requests[index] = Request::irecv_init(static_cast<char*>(recvbuf) + src * recvcount * recvext, recvcount, recvtype,
+ src, system_tag, comm);
+ index++;
+ }
+ }
+ // Wait for completion of irecv's.
+ Request::startall(size - 1, requests);
+ (*request)->set_nbc_requests(requests, size - 1);
+ }
+ return MPI_SUCCESS;
+}
+
+int Colls::igatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,
+ MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)
+{
+ int system_tag = COLL_TAG_GATHERV;
+ MPI_Aint lb = 0;
+ MPI_Aint recvext = 0;
+ MPI_Request *requests;
+
+ int rank = comm->rank();
+ int size = comm->size();
+ (*request) = new Request( nullptr, 0, MPI_BYTE,
+ rank,rank, COLL_TAG_GATHERV, comm, MPI_REQ_PERSISTENT);
+ if (rank != root) {
+ // Send buffer to root
+ requests = new MPI_Request[1];
+ requests[0]=Request::isend(sendbuf, sendcount, sendtype, root, system_tag, comm);
+ (*request)->set_nbc_requests(requests, 1);
+ } else {
+ recvtype->extent(&lb, &recvext);
+ // Local copy from root
+ Datatype::copy(sendbuf, sendcount, sendtype, static_cast<char*>(recvbuf) + displs[root] * recvext,
+ recvcounts[root], recvtype);
+ // Receive buffers from senders
+ requests = new MPI_Request[size - 1];
+ int index = 0;
+ for (int src = 0; src < size; src++) {
+ if(src != root) {
+ requests[index] = Request::irecv_init(static_cast<char*>(recvbuf) + displs[src] * recvext,
+ recvcounts[src], recvtype, src, system_tag, comm);
+ index++;
+ }
+ }
+ // Wait for completion of irecv's.
+ Request::startall(size - 1, requests);
+ (*request)->set_nbc_requests(requests, size - 1);
+ }
+ return MPI_SUCCESS;
+}
+int Colls::iscatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,
+ MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)
+{
+ int system_tag = COLL_TAG_SCATTERV;
+ MPI_Aint lb = 0;
+ MPI_Aint sendext = 0;
+ MPI_Request* requests;
+
+ int rank = comm->rank();
+ int size = comm->size();
+ (*request) = new Request( nullptr, 0, MPI_BYTE,
+ rank,rank, COLL_TAG_SCATTERV, comm, MPI_REQ_PERSISTENT);
+ if(rank != root) {
+ // Recv buffer from root
+ requests = new MPI_Request[1];
+ requests[0]=Request::irecv(recvbuf, recvcount, recvtype, root, system_tag, comm);
+ (*request)->set_nbc_requests(requests, 1);
+ } else {
+ sendtype->extent(&lb, &sendext);
+ // Local copy from root
+ if(recvbuf!=MPI_IN_PLACE){
+ Datatype::copy(static_cast<char *>(sendbuf) + displs[root] * sendext, sendcounts[root],
+ sendtype, recvbuf, recvcount, recvtype);
+ }
+ // Send buffers to receivers
+ MPI_Request *requests = new MPI_Request[size - 1];
+ int index = 0;
+ for (int dst = 0; dst < size; dst++) {
+ if (dst != root) {
+ requests[index] = Request::isend_init(static_cast<char *>(sendbuf) + displs[dst] * sendext, sendcounts[dst],
+ sendtype, dst, system_tag, comm);
+ index++;
+ }
+ }
+ // Wait for completion of isend's.
+ Request::startall(size - 1, requests);
+ (*request)->set_nbc_requests(requests, size - 1);
+ }
+ return MPI_SUCCESS;
+}
}
}
// SMPI_RMA_TAG has to be the smallest one, as it will be decremented for accumulate ordering.
constexpr int SMPI_RMA_TAG = -6666;
+#define MPI_REQUEST_IGNORED ((MPI_Request*)-100)
+
/* Convert between Fortran and C */
#define FORT_BOTTOM(addr) ((*(int*)addr) == -200 ? MPI_BOTTOM : (void*)addr)
static int exscan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
//async collectives
- static int Ibarrier(MPI_Comm comm, MPI_Request* request);
+ static int ibarrier(MPI_Comm comm, MPI_Request* request);
+ static int ibcast(void *buf, int count, MPI_Datatype datatype,
+ int root, MPI_Comm comm, MPI_Request* request);
+ static int igather (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
+ MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request);
+ static int igatherv (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+ int* recvcounts, int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request);
+ static int iallgather (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+ int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request);
+ static int iallgatherv (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+ int* recvcounts, int* displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request);
+ static int iscatter (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+ int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request);
+ static int iscatterv (void* sendbuf, int* sendcounts, int* displs, MPI_Datatype sendtype,
+ void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request);
+ static int ireduce
+ (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request *request);
+ static int iallreduce
+ (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
+ static int iscan
+ (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
+ static int iexscan
+ (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
+ static int ireduce_scatter
+ (void* sendbuf, void* recvbuf, int* recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
+ static int ireduce_scatter_block
+ (void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request);
+ static int ialltoall (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf,
+ int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request);
+ static int ialltoallv
+ (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf, int* recvcounts,
+ int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request);
+
static void (*smpi_coll_cleanup_callback)();
};
void cancel();
void ref();
void set_nbc_requests(MPI_Request* reqs, int size);
+ int get_nbc_requests_size();
+ MPI_Request* get_nbc_requests();
static void finish_wait(MPI_Request* request, MPI_Status* status);
static void unref(MPI_Request* request);
static int wait(MPI_Request* req, MPI_Status* status);
static int nsleeps = 1;
int ret = MPI_SUCCESS;
- // are we testing a request meant for non blocking comms ?
+ // Are we testing a request meant for non blocking collectives ?
// If so, test all the subrequests.
if ((*request)->nbc_requests_size_>0){
ret = testall((*request)->nbc_requests_size_, (*request)->nbc_requests_, flag, MPI_STATUSES_IGNORE);
int Request::wait(MPI_Request * request, MPI_Status * status)
{
int ret=MPI_SUCCESS;
+ // Are we waiting on a request meant for non blocking collectives ?
+ // If so, wait for all the subrequests.
+ if ((*request)->nbc_requests_size_>0){
+ ret = waitall((*request)->nbc_requests_size_, (*request)->nbc_requests_, MPI_STATUSES_IGNORE);
+ for (int i = 0; i < (*request)->nbc_requests_size_; i++) {
+ if((*request)->nbc_requests_[i]!=MPI_REQUEST_NULL)
+ Request::unref(&((*request)->nbc_requests_[i]));
+ }
+ delete[] (*request)->nbc_requests_;
+ (*request)->nbc_requests_size_=0;
+ unref(request);
+ return ret;
+ }
+
(*request)->print_request("Waiting");
if ((*request)->flags_ & MPI_REQ_PREPARED) {
Status::empty(status);
nbc_requests_size_=size;
}
+int Request::get_nbc_requests_size(){
+ return nbc_requests_size_;
+}
+
+MPI_Request* Request::get_nbc_requests(){
+ return nbc_requests_;
+}
+
}
}
coll2 coll3 coll4 coll5 coll6 coll7 coll8 coll9 coll10 coll11 coll12 coll13
exscan exscan2
gather gather2 gather_big
- ibarrier
+ ibarrier nonblocking
# iallred icallgather icallgatherv icallreduce
# icalltoall icalltoallv icalltoallw icbarrier icbcast
# icgather icgatherv icreduce icscatter icscatterv
longuser
- # nonblocking2 nonblocking3 nonblocking
+ # nonblocking2 nonblocking3
# opband opbor opbxor opland oplor oplxor opmax opmaxloc
# opmin opminloc opprod opsum
op_commutative
comm, &req);
MPI_Wait(&req, MPI_STATUS_IGNORE);
- MPI_Ialltoallw(sbuf, scounts, sdispls, types, rbuf, rcounts, rdispls, types, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Ialltoallw(sbuf, scounts, sdispls, types, rbuf, rcounts, rdispls, types, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Ialltoallw(MPI_IN_PLACE, NULL, NULL, NULL, rbuf, rcounts, rdispls, types, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Ialltoallw(MPI_IN_PLACE, NULL, NULL, NULL, rbuf, rcounts, rdispls, types, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Ireduce(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, 0, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Ireduce(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, 0, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- if (0 == rank)
- MPI_Ireduce(MPI_IN_PLACE, rbuf, NUM_INTS, MPI_INT, MPI_SUM, 0, comm, &req);
- else
- MPI_Ireduce(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, 0, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* if (0 == rank)*/
+/* MPI_Ireduce(MPI_IN_PLACE, rbuf, NUM_INTS, MPI_INT, MPI_SUM, 0, comm, &req);*/
+/* else*/
+/* MPI_Ireduce(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, 0, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Iallreduce(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Iallreduce(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Iallreduce(MPI_IN_PLACE, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Iallreduce(MPI_IN_PLACE, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Ireduce_scatter(sbuf, rbuf, rcounts, MPI_INT, MPI_SUM, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Ireduce_scatter(sbuf, rbuf, rcounts, MPI_INT, MPI_SUM, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Ireduce_scatter(MPI_IN_PLACE, rbuf, rcounts, MPI_INT, MPI_SUM, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Ireduce_scatter(MPI_IN_PLACE, rbuf, rcounts, MPI_INT, MPI_SUM, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Ireduce_scatter_block(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Ireduce_scatter_block(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Ireduce_scatter_block(MPI_IN_PLACE, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Ireduce_scatter_block(MPI_IN_PLACE, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Iscan(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Iscan(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Iscan(MPI_IN_PLACE, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Iscan(MPI_IN_PLACE, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Iexscan(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Iexscan(sbuf, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
- MPI_Iexscan(MPI_IN_PLACE, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);
- MPI_Wait(&req, MPI_STATUS_IGNORE);
+/* MPI_Iexscan(MPI_IN_PLACE, rbuf, NUM_INTS, MPI_INT, MPI_SUM, comm, &req);*/
+/* MPI_Wait(&req, MPI_STATUS_IGNORE);*/
if (sbuf)
free(sbuf);
#uoplong 4
#uoplong 11
#uoplong 16
-nonblocking 4 mpiversion=3.0
-nonblocking 5 mpiversion=3.0
-nonblocking 10 mpiversion=3.0
+nonblocking 4
+nonblocking 5
+nonblocking 10
nonblocking2 1 mpiversion=3.0
nonblocking2 4 mpiversion=3.0
nonblocking2 5 mpiversion=3.0