From: Arnaud Giersch Date: Wed, 4 Oct 2017 14:45:38 +0000 (+0200) Subject: Cannot have comm == MPI_COMM_NULL here. X-Git-Tag: v3_17~28 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/be2f3c5737ba2f409e6621cd30295fa59fce0b85 Cannot have comm == MPI_COMM_NULL here. --- diff --git a/src/smpi/bindings/smpi_pmpi_coll.cpp b/src/smpi/bindings/smpi_pmpi_coll.cpp index 26c85d3d8d..29c9db411b 100644 --- a/src/smpi/bindings/smpi_pmpi_coll.cpp +++ b/src/smpi/bindings/smpi_pmpi_coll.cpp @@ -27,7 +27,7 @@ int PMPI_Bcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm c } else if (not datatype->is_valid()) { retval = MPI_ERR_ARG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int root_traced = comm->group()->index(root); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); @@ -59,7 +59,7 @@ int PMPI_Barrier(MPI_Comm comm) if (comm == MPI_COMM_NULL) { retval = MPI_ERR_COMM; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_BARRIER; TRACE_smpi_collective_in(rank, __FUNCTION__, extra); @@ -101,7 +101,7 @@ int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbu sendtmpcount=0; sendtmptype=recvtype; } - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int root_traced = comm->group()->index(root); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_GATHER; @@ -155,7 +155,7 @@ int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recv sendtmptype=recvtype; } - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int root_traced = comm->group()->index(root); int size = comm->size(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); @@ -208,7 +208,7 @@ int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, sendcount=recvcount; sendtype=recvtype; } - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_ALLGATHER; int known = 0; @@ -255,7 +255,7 @@ int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, sendcount=recvcounts[comm->rank()]; sendtype=recvtype; } - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int i = 0; int size = comm->size(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); @@ -307,7 +307,7 @@ int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, recvtype = sendtype; recvcount = sendcount; } - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int root_traced = comm->group()->index(root); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_SCATTER; @@ -353,7 +353,7 @@ int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, recvtype = sendtype; recvcount = sendcounts[comm->rank()]; } - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int root_traced = comm->group()->index(root); int size = comm->size(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); @@ -397,7 +397,7 @@ int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, } else if (not datatype->is_valid() || op == MPI_OP_NULL) { retval = MPI_ERR_ARG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int root_traced = comm->group()->index(root); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_REDUCE; @@ -454,7 +454,7 @@ int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp sendtmpbuf = static_cast(xbt_malloc(count*datatype->get_extent())); simgrid::smpi::Datatype::copy(recvbuf, count, datatype,sendtmpbuf, count, datatype); } - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_ALLREDUCE; int known = 0; @@ -492,7 +492,7 @@ int PMPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MP } else if (op == MPI_OP_NULL) { retval = MPI_ERR_OP; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_SCAN; int known = 0; @@ -525,7 +525,7 @@ int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, } else if (op == MPI_OP_NULL) { retval = MPI_ERR_OP; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_EXSCAN; int known = 0; @@ -566,7 +566,7 @@ int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datat } else if (recvcounts == nullptr) { retval = MPI_ERR_ARG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int i = 0; int size = comm->size(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); @@ -621,7 +621,7 @@ int PMPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount, } else { int count = comm->size(); - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_REDUCE_SCATTER; extra->num_processes = count; @@ -670,7 +670,7 @@ int PMPI_Alltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* rec } else if ((sendbuf != MPI_IN_PLACE && sendtype == MPI_DATATYPE_NULL) || recvtype == MPI_DATATYPE_NULL) { retval = MPI_ERR_TYPE; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_ALLTOALL; @@ -725,7 +725,7 @@ int PMPI_Alltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype recvdisps == nullptr) { retval = MPI_ERR_ARG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int i = 0; int size = comm->size(); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index 39683f8459..a8969916e8 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -157,7 +157,7 @@ int PMPI_Irecv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MP retval = MPI_ERR_TAG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int src_traced = comm->group()->index(src); instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); @@ -206,7 +206,7 @@ int PMPI_Isend(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MP } else if(tag<0 && tag != MPI_ANY_TAG){ retval = MPI_ERR_TAG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int dst_traced = comm->group()->index(dst); instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); extra->type = TRACING_ISEND; @@ -254,7 +254,7 @@ int PMPI_Issend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, M } else if(tag<0 && tag != MPI_ANY_TAG){ retval = MPI_ERR_TAG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int dst_traced = comm->group()->index(dst); instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); extra->type = TRACING_ISSEND; @@ -301,7 +301,7 @@ int PMPI_Recv(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI } else if(tag<0 && tag != MPI_ANY_TAG){ retval = MPI_ERR_TAG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int src_traced = comm->group()->index(src); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1); extra->type = TRACING_RECV; @@ -351,7 +351,7 @@ int PMPI_Send(void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI } else if(tag < 0 && tag != MPI_ANY_TAG){ retval = MPI_ERR_TAG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int dst_traced = comm->group()->index(dst); instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); extra->type = TRACING_SEND; @@ -397,7 +397,7 @@ int PMPI_Ssend(void* buf, int count, MPI_Datatype datatype, int dst, int tag, MP } else if(tag<0 && tag != MPI_ANY_TAG){ retval = MPI_ERR_TAG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int dst_traced = comm->group()->index(dst); instr_extra_data extra = xbt_new0(s_instr_extra_data_t,1); extra->type = TRACING_SSEND; @@ -448,7 +448,7 @@ int PMPI_Sendrecv(void* sendbuf, int sendcount, MPI_Datatype sendtype, int dst, retval = MPI_ERR_TAG; } else { - int rank = comm != MPI_COMM_NULL ? smpi_process()->index() : -1; + int rank = smpi_process()->index(); int dst_traced = comm->group()->index(dst); int src_traced = comm->group()->index(src); instr_extra_data extra = xbt_new0(s_instr_extra_data_t, 1);