From 488dda0c43d26f0a770e1d5b47f73148e153949b Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Fri, 26 Apr 2019 16:13:56 +0200 Subject: [PATCH] (painfully) constify colls. --- include/smpi/smpi.h | 78 ++++----- src/smpi/bindings/smpi_mpi.cpp | 62 +++---- src/smpi/bindings/smpi_pmpi_coll.cpp | 162 +++++++++--------- src/smpi/colls/allgather/allgather-2dmesh.cpp | 2 +- src/smpi/colls/allgather/allgather-3dmesh.cpp | 2 +- src/smpi/colls/allgather/allgather-GB.cpp | 2 +- .../colls/allgather/allgather-NTSLR-NB.cpp | 2 +- src/smpi/colls/allgather/allgather-NTSLR.cpp | 2 +- .../colls/allgather/allgather-SMP-NTS.cpp | 2 +- src/smpi/colls/allgather/allgather-bruck.cpp | 2 +- .../colls/allgather/allgather-loosely-lr.cpp | 2 +- .../colls/allgather/allgather-mvapich-smp.cpp | 2 +- .../allgather-ompi-neighborexchange.cpp | 2 +- src/smpi/colls/allgather/allgather-pair.cpp | 2 +- src/smpi/colls/allgather/allgather-rdb.cpp | 2 +- src/smpi/colls/allgather/allgather-rhv.cpp | 2 +- src/smpi/colls/allgather/allgather-ring.cpp | 2 +- .../colls/allgather/allgather-smp-simple.cpp | 2 +- .../allgather/allgather-spreading-simple.cpp | 2 +- src/smpi/colls/allgatherv/allgatherv-GB.cpp | 4 +- .../colls/allgatherv/allgatherv-mpich-rdb.cpp | 6 +- .../allgatherv/allgatherv-mpich-ring.cpp | 4 +- .../allgatherv/allgatherv-ompi-bruck.cpp | 6 +- .../allgatherv-ompi-neighborexchange.cpp | 4 +- src/smpi/colls/allgatherv/allgatherv-pair.cpp | 4 +- src/smpi/colls/allgatherv/allgatherv-ring.cpp | 4 +- src/smpi/colls/allreduce/allreduce-lr.cpp | 2 +- .../colls/allreduce/allreduce-mvapich-rs.cpp | 2 +- .../allreduce/allreduce-mvapich-two-level.cpp | 10 +- .../allreduce-ompi-ring-segmented.cpp | 2 +- .../colls/allreduce/allreduce-rab-rdb.cpp | 2 +- src/smpi/colls/allreduce/allreduce-rab1.cpp | 2 +- src/smpi/colls/allreduce/allreduce-rab2.cpp | 4 +- src/smpi/colls/allreduce/allreduce-rdb.cpp | 2 +- .../colls/allreduce/allreduce-redbcast.cpp | 2 +- .../allreduce-smp-binomial-pipeline.cpp | 2 +- .../allreduce/allreduce-smp-binomial.cpp | 2 +- .../colls/allreduce/allreduce-smp-rdb.cpp | 2 +- .../colls/allreduce/allreduce-smp-rsag-lr.cpp | 2 +- .../allreduce/allreduce-smp-rsag-rab.cpp | 2 +- .../colls/allreduce/allreduce-smp-rsag.cpp | 2 +- src/smpi/colls/alltoall/alltoall-2dmesh.cpp | 2 +- src/smpi/colls/alltoall/alltoall-3dmesh.cpp | 2 +- .../colls/alltoall/alltoall-basic-linear.cpp | 6 +- src/smpi/colls/alltoall/alltoall-bruck.cpp | 2 +- .../alltoall-mvapich-scatter-dest.cpp | 2 +- .../alltoall/alltoall-pair-light-barrier.cpp | 2 +- .../alltoall/alltoall-pair-mpi-barrier.cpp | 2 +- .../alltoall/alltoall-pair-one-barrier.cpp | 2 +- src/smpi/colls/alltoall/alltoall-pair.cpp | 4 +- src/smpi/colls/alltoall/alltoall-rdb.cpp | 2 +- .../alltoall/alltoall-ring-light-barrier.cpp | 2 +- .../alltoall/alltoall-ring-mpi-barrier.cpp | 2 +- .../alltoall/alltoall-ring-one-barrier.cpp | 2 +- src/smpi/colls/alltoall/alltoall-ring.cpp | 2 +- src/smpi/colls/alltoallv/alltoallv-bruck.cpp | 4 +- .../alltoallv/alltoallv-ompi-basic-linear.cpp | 4 +- .../alltoallv-pair-light-barrier.cpp | 4 +- .../alltoallv/alltoallv-pair-mpi-barrier.cpp | 4 +- .../alltoallv/alltoallv-pair-one-barrier.cpp | 4 +- src/smpi/colls/alltoallv/alltoallv-pair.cpp | 4 +- .../alltoallv-ring-light-barrier.cpp | 4 +- .../alltoallv/alltoallv-ring-mpi-barrier.cpp | 4 +- .../alltoallv/alltoallv-ring-one-barrier.cpp | 4 +- src/smpi/colls/alltoallv/alltoallv-ring.cpp | 4 +- src/smpi/colls/gather/gather-mvapich.cpp | 6 +- src/smpi/colls/gather/gather-ompi.cpp | 8 +- src/smpi/colls/reduce/reduce-NTSL.cpp | 2 +- .../reduce/reduce-arrival-pattern-aware.cpp | 2 +- src/smpi/colls/reduce/reduce-binomial.cpp | 2 +- src/smpi/colls/reduce/reduce-flat-tree.cpp | 6 +- .../colls/reduce/reduce-mvapich-knomial.cpp | 2 +- .../colls/reduce/reduce-mvapich-two-level.cpp | 8 +- src/smpi/colls/reduce/reduce-ompi.cpp | 18 +- src/smpi/colls/reduce/reduce-rab.cpp | 6 +- .../colls/reduce/reduce-scatter-gather.cpp | 2 +- .../reduce_scatter/reduce_scatter-mpich.cpp | 14 +- .../reduce_scatter/reduce_scatter-ompi.cpp | 10 +- .../scatter/scatter-mvapich-two-level.cpp | 6 +- src/smpi/colls/scatter/scatter-ompi.cpp | 4 +- src/smpi/colls/smpi_coll.cpp | 14 +- src/smpi/colls/smpi_default_selector.cpp | 22 +-- src/smpi/colls/smpi_intel_mpi_selector.cpp | 34 ++-- src/smpi/colls/smpi_mpich_selector.cpp | 28 +-- src/smpi/colls/smpi_mvapich2_selector.cpp | 22 +-- .../colls/smpi_mvapich2_selector_stampede.hpp | 58 +++---- src/smpi/colls/smpi_nbc_impl.cpp | 62 +++---- src/smpi/colls/smpi_openmpi_selector.cpp | 28 +-- src/smpi/include/smpi_coll.hpp | 72 ++++---- 89 files changed, 458 insertions(+), 458 deletions(-) diff --git a/include/smpi/smpi.h b/include/smpi/smpi.h index 637a9ce9b1..fb6259b880 100644 --- a/include/smpi/smpi.h +++ b/include/smpi/smpi.h @@ -570,71 +570,71 @@ MPI_CALL(XBT_PUBLIC int, MPI_Bcast, (void* buf, int count, MPI_Datatype datatype 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_CALL(XBT_PUBLIC int, MPI_Igather, (const 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, +MPI_CALL(XBT_PUBLIC int, MPI_Igatherv, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request)); +MPI_CALL(XBT_PUBLIC int, MPI_Iallgather, (const 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, +MPI_CALL(XBT_PUBLIC int, MPI_Iallgatherv, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request)); +MPI_CALL(XBT_PUBLIC int, MPI_Iscatter, (const 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, +MPI_CALL(XBT_PUBLIC int, MPI_Iscatterv, (const void* sendbuf, const int* sendcounts, const 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)); + (const 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)); + (const 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)); + (const 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)); + (const 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)); + (const void* sendbuf, void* recvbuf, const 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, + (const 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, (const 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)); + (const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, + const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request)); MPI_CALL(XBT_PUBLIC int, MPI_Ialltoallw, - (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype* sendtypes, void* recvbuf, int* recvcounts, - int* recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request)); -MPI_CALL(XBT_PUBLIC int, MPI_Gather, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + (const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts, + const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request)); +MPI_CALL(XBT_PUBLIC int, MPI_Gather, (const 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, - int* recvcounts, int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm)); -MPI_CALL(XBT_PUBLIC int, MPI_Allgather, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, +MPI_CALL(XBT_PUBLIC int, MPI_Gatherv, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm)); +MPI_CALL(XBT_PUBLIC int, MPI_Allgather, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)); -MPI_CALL(XBT_PUBLIC int, MPI_Allgatherv, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, - int* recvcounts, int* displs, MPI_Datatype recvtype, MPI_Comm comm)); -MPI_CALL(XBT_PUBLIC int, MPI_Scatter, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, +MPI_CALL(XBT_PUBLIC int, MPI_Allgatherv, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm)); +MPI_CALL(XBT_PUBLIC int, MPI_Scatter, (const 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_Scatterv, (void* sendbuf, int* sendcounts, int* displs, MPI_Datatype sendtype, +MPI_CALL(XBT_PUBLIC int, MPI_Scatterv, (const void* sendbuf, const int* sendcounts, const int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)); MPI_CALL(XBT_PUBLIC int, MPI_Reduce, - (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)); + (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)); MPI_CALL(XBT_PUBLIC int, MPI_Allreduce, - (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)); + (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)); MPI_CALL(XBT_PUBLIC int, MPI_Scan, - (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)); + (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)); MPI_CALL(XBT_PUBLIC int, MPI_Exscan, - (void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)); + (const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)); MPI_CALL(XBT_PUBLIC int, MPI_Reduce_scatter, - (void* sendbuf, void* recvbuf, int* recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)); + (const void* sendbuf, void* recvbuf, const int* recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)); MPI_CALL(XBT_PUBLIC int, MPI_Reduce_scatter_block, - (void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)); -MPI_CALL(XBT_PUBLIC int, MPI_Alltoall, (void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + (const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)); +MPI_CALL(XBT_PUBLIC int, MPI_Alltoall, (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)); MPI_CALL(XBT_PUBLIC int, MPI_Alltoallv, - (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf, int* recvcounts, - int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm)); + (const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, + const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm)); MPI_CALL(XBT_PUBLIC int, MPI_Alltoallw, - (void* sendbuf, int* sendcnts, int* sdispls, MPI_Datatype* sendtypes, void* recvbuf, int* recvcnts, - int* rdispls, MPI_Datatype* recvtypes, MPI_Comm comm)); -MPI_CALL(XBT_PUBLIC int, MPI_Reduce_local, (void* inbuf, void* inoutbuf, int count, MPI_Datatype datatype, MPI_Op op)); + (const void* sendbuf, const int* sendcnts, const int* sdispls, const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcnts, + const int* rdispls, const MPI_Datatype* recvtypes, MPI_Comm comm)); +MPI_CALL(XBT_PUBLIC int, MPI_Reduce_local, (const void* inbuf, void* inoutbuf, int count, MPI_Datatype datatype, MPI_Op op)); MPI_CALL(XBT_PUBLIC int, MPI_Info_create, (MPI_Info * info)); MPI_CALL(XBT_PUBLIC int, MPI_Info_set, (MPI_Info info, const char* key, const char* value)); diff --git a/src/smpi/bindings/smpi_mpi.cpp b/src/smpi/bindings/smpi_mpi.cpp index c054d7d7e6..958060da6b 100644 --- a/src/smpi/bindings/smpi_mpi.cpp +++ b/src/smpi/bindings/smpi_mpi.cpp @@ -74,13 +74,13 @@ WRAPPED_PMPI_CALL_NORETURN(double, MPI_Wtime,(void),()) WRAPPED_PMPI_CALL(int,MPI_Abort,(MPI_Comm comm, int errorcode),(comm, errorcode)) WRAPPED_PMPI_CALL(int,MPI_Accumulate,(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win),( origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype,op, win)) WRAPPED_PMPI_CALL(int,MPI_Address,(void *location, MPI_Aint * address),(location, address)) -WRAPPED_PMPI_CALL(int,MPI_Allgather,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm)) -WRAPPED_PMPI_CALL(int,MPI_Allgatherv,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm)) +WRAPPED_PMPI_CALL(int,MPI_Allgather,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm)) +WRAPPED_PMPI_CALL(int,MPI_Allgatherv,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs,MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm)) WRAPPED_PMPI_CALL(int,MPI_Alloc_mem,(MPI_Aint size, MPI_Info info, void *baseptr),(size, info, baseptr)) -WRAPPED_PMPI_CALL(int,MPI_Allreduce,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm)) -WRAPPED_PMPI_CALL(int,MPI_Alltoall,(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount,MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm)) -WRAPPED_PMPI_CALL(int,MPI_Alltoallv,(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm)) -WRAPPED_PMPI_CALL(int,MPI_Alltoallw,( void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype *sendtypes, void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype *recvtypes, MPI_Comm comm),( sendbuf, sendcnts, sdispls, sendtypes, recvbuf, recvcnts, rdispls, recvtypes, comm)) +WRAPPED_PMPI_CALL(int,MPI_Allreduce,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm)) +WRAPPED_PMPI_CALL(int,MPI_Alltoall,(const void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount,MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm)) +WRAPPED_PMPI_CALL(int,MPI_Alltoallv,(const void *sendbuf, const int *sendcounts, const int *senddisps, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm),(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm)) +WRAPPED_PMPI_CALL(int,MPI_Alltoallw,(const void *sendbuf, const int *sendcnts, const int *sdispls, const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcnts, const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm),( sendbuf, sendcnts, sdispls, sendtypes, recvbuf, recvcnts, rdispls, recvtypes, comm)) WRAPPED_PMPI_CALL(int,MPI_Attr_delete,(MPI_Comm comm, int keyval) ,(comm, keyval)) WRAPPED_PMPI_CALL(int,MPI_Attr_get,(MPI_Comm comm, int keyval, void* attr_value, int* flag) ,(comm, keyval, attr_value, flag)) WRAPPED_PMPI_CALL(int,MPI_Attr_put,(MPI_Comm comm, int keyval, void* attr_value) ,(comm, keyval, attr_value)) @@ -118,12 +118,12 @@ WRAPPED_PMPI_CALL(int,MPI_Compare_and_swap,(const void *origin_addr, void *compa WRAPPED_PMPI_CALL(int,MPI_Dims_create,(int nnodes, int ndims, int* dims) ,(nnodes, ndims, dims)) WRAPPED_PMPI_CALL(int,MPI_Error_class,(int errorcode, int* errorclass) ,(errorcode, errorclass)) WRAPPED_PMPI_CALL_NORETURN(int,MPI_Error_string,(int errorcode, char* string, int* resultlen) ,(errorcode, string, resultlen)) -WRAPPED_PMPI_CALL(int,MPI_Exscan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm)) +WRAPPED_PMPI_CALL(int,MPI_Exscan,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm)) WRAPPED_PMPI_CALL(int,MPI_Finalized,(int * flag),(flag)) WRAPPED_PMPI_CALL(int,MPI_Finalize,(void),()) WRAPPED_PMPI_CALL(int,MPI_Free_mem,(void *baseptr),(baseptr)) -WRAPPED_PMPI_CALL(int,MPI_Gather,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm)) -WRAPPED_PMPI_CALL(int,MPI_Gatherv,(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs,MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm)) +WRAPPED_PMPI_CALL(int,MPI_Gather,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm)) +WRAPPED_PMPI_CALL(int,MPI_Gatherv,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs,MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm)) WRAPPED_PMPI_CALL(int,MPI_Get_address,(void *location, MPI_Aint * address),(location, address)) WRAPPED_PMPI_CALL(int,MPI_Get_count,(MPI_Status * status, MPI_Datatype datatype, int *count),(status, datatype, count)) WRAPPED_PMPI_CALL(int,MPI_Get_library_version ,(char *version,int *len),(version,len)) @@ -147,21 +147,21 @@ WRAPPED_PMPI_CALL(int,MPI_Group_union,(MPI_Group group1, MPI_Group group2, MPI_G 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_Ialltoallw,( void *sendbuf, int *sendcnts, int *sdispls, MPI_Datatype *sendtypes, void *recvbuf, int *recvcnts, int *rdispls, MPI_Datatype *recvtypes, MPI_Comm comm, MPI_Request *request),( sendbuf, sendcnts, sdispls, sendtypes, recvbuf, recvcnts, rdispls, recvtypes, 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_Iallgather,(const 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,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const 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,(const 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,(const 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,(const void *sendbuf, const int *sendcounts, const int *senddisps, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const 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_Ialltoallw,(const void *sendbuf, const int *sendcnts, const int *sdispls, const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcnts, const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm, MPI_Request *request),( sendbuf, sendcnts, sdispls, sendtypes, recvbuf, recvcnts, rdispls, recvtypes, comm, request)) +WRAPPED_PMPI_CALL(int,MPI_Igather,(const 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,(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const 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,(const 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,(const void *sendbuf, void *recvbuf, const 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,(const 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,(const 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,(const 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,(const 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,(const void *sendbuf, const int *sendcounts, const 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, const char *key),(info, key)) @@ -193,17 +193,17 @@ WRAPPED_PMPI_CALL(int,MPI_Query_thread,(int *provided),(provided)) WRAPPED_PMPI_CALL(int,MPI_Raccumulate,(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request* request),( origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype,op, win, request)) WRAPPED_PMPI_CALL(int,MPI_Recv_init,(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Request * request),(buf, count, datatype, src, tag, comm, request)) WRAPPED_PMPI_CALL(int,MPI_Recv,(void *buf, int count, MPI_Datatype datatype, int src, int tag, MPI_Comm comm, MPI_Status * status),(buf, count, datatype, src, tag, comm, status)) -WRAPPED_PMPI_CALL(int,MPI_Reduce_local,(void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op),(inbuf, inoutbuf, count, datatype, op)) -WRAPPED_PMPI_CALL(int,MPI_Reduce_scatter_block,(void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op,MPI_Comm comm),(sendbuf, recvbuf, recvcount, datatype, op, comm)) -WRAPPED_PMPI_CALL(int,MPI_Reduce_scatter,(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, recvcounts, datatype, op, comm)) -WRAPPED_PMPI_CALL(int,MPI_Reduce,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, root, comm)) +WRAPPED_PMPI_CALL(int,MPI_Reduce_local,(const void *inbuf, void *inoutbuf, int count, MPI_Datatype datatype, MPI_Op op),(inbuf, inoutbuf, count, datatype, op)) +WRAPPED_PMPI_CALL(int,MPI_Reduce_scatter_block,(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op,MPI_Comm comm),(sendbuf, recvbuf, recvcount, datatype, op, comm)) +WRAPPED_PMPI_CALL(int,MPI_Reduce_scatter,(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, recvcounts, datatype, op, comm)) +WRAPPED_PMPI_CALL(int,MPI_Reduce,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, root, comm)) WRAPPED_PMPI_CALL(int,MPI_Request_free,(MPI_Request * request),(request)) WRAPPED_PMPI_CALL(int,MPI_Rget,(void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank,MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win, MPI_Request* request),(origin_addr,origin_count, origin_datatype,target_rank, target_disp, target_count,target_datatype,win, request)) WRAPPED_PMPI_CALL(int,MPI_Rget_accumulate, (const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, void *result_addr, int result_count, MPI_Datatype result_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Op op, MPI_Win win, MPI_Request* request),(origin_addr, origin_count, origin_datatype, result_addr, result_count, result_datatype, target_rank, target_disp, target_count, target_datatype, op, win, request)) WRAPPED_PMPI_CALL(int,MPI_Rput,(const void *origin_addr, int origin_count, MPI_Datatype origin_datatype, int target_rank, MPI_Aint target_disp, int target_count, MPI_Datatype target_datatype, MPI_Win win, MPI_Request* request),(origin_addr,origin_count, origin_datatype,target_rank,target_disp, target_count,target_datatype, win, request)) -WRAPPED_PMPI_CALL(int,MPI_Scan,(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm)) -WRAPPED_PMPI_CALL(int,MPI_Scatter,(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm)) -WRAPPED_PMPI_CALL(int,MPI_Scatterv,(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm)) +WRAPPED_PMPI_CALL(int,MPI_Scan,(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm),(sendbuf, recvbuf, count, datatype, op, comm)) +WRAPPED_PMPI_CALL(int,MPI_Scatter,(const void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype,int root, MPI_Comm comm),(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm)) +WRAPPED_PMPI_CALL(int,MPI_Scatterv,(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount,MPI_Datatype recvtype, int root, MPI_Comm comm),(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm)) WRAPPED_PMPI_CALL(int,MPI_Send_init,(const void *buf, int count, MPI_Datatype datatype, int dst, int tag, MPI_Comm comm, MPI_Request * request),(buf, count, datatype, dst, tag, comm, request)) WRAPPED_PMPI_CALL(int,MPI_Sendrecv_replace,(void *buf, int count, MPI_Datatype datatype, int dst, int sendtag, int src, int recvtag,MPI_Comm comm, MPI_Status * status),(buf, count, datatype, dst, sendtag, src, recvtag, comm, status)) WRAPPED_PMPI_CALL(int,MPI_Sendrecv,(const void *sendbuf, int sendcount, MPI_Datatype sendtype,int dst, int sendtag, void *recvbuf, int recvcount,MPI_Datatype recvtype, int src, int recvtag, MPI_Comm comm, MPI_Status * status),(sendbuf, sendcount, sendtype, dst, sendtag, recvbuf, recvcount, recvtype, src, recvtag,comm, status)) diff --git a/src/smpi/bindings/smpi_pmpi_coll.cpp b/src/smpi/bindings/smpi_pmpi_coll.cpp index bd7205b115..7ae768c4ce 100644 --- a/src/smpi/bindings/smpi_pmpi_coll.cpp +++ b/src/smpi/bindings/smpi_pmpi_coll.cpp @@ -85,12 +85,12 @@ int PMPI_Ibcast(void *buf, int count, MPI_Datatype datatype, return MPI_SUCCESS; } -int PMPI_Gather(void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype, +int PMPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,void *recvbuf, int recvcount, MPI_Datatype recvtype, 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, +int PMPI_Igather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) @@ -108,7 +108,7 @@ int PMPI_Igather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recv return MPI_ERR_ARG; smpi_bench_end(); - char* sendtmpbuf = static_cast(sendbuf); + const char* sendtmpbuf = static_cast(sendbuf); int sendtmpcount = sendcount; MPI_Datatype sendtmptype = sendtype; if ((comm->rank() == root) && (sendbuf == MPI_IN_PLACE)) { @@ -134,12 +134,12 @@ int PMPI_Igather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recv return MPI_SUCCESS; } -int PMPI_Gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, +int PMPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, 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, +int PMPI_Igatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) @@ -164,7 +164,7 @@ int PMPI_Igatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* rec } smpi_bench_end(); - char* sendtmpbuf = static_cast(sendbuf); + const char* sendtmpbuf = static_cast(sendbuf); int sendtmpcount = sendcount; MPI_Datatype sendtmptype = sendtype; if ((comm->rank() == root) && (sendbuf == MPI_IN_PLACE)) { @@ -199,12 +199,12 @@ int PMPI_Igatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* rec return MPI_SUCCESS; } -int PMPI_Allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +int PMPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, 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, +int PMPI_Iallgather(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) @@ -242,12 +242,12 @@ int PMPI_Iallgather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* r return MPI_SUCCESS; } -int PMPI_Allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm){ +int PMPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, const int *recvcounts, const 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, +int PMPI_Iallgatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) @@ -299,12 +299,12 @@ int PMPI_Iallgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* return MPI_SUCCESS; } -int PMPI_Scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, +int PMPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, 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, +int PMPI_Iscatter(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) @@ -345,12 +345,12 @@ int PMPI_Iscatter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* rec return MPI_SUCCESS; } -int PMPI_Scatterv(void *sendbuf, int *sendcounts, int *displs, +int PMPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs, 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, +int PMPI_Iscatterv(const void* sendbuf, const int* sendcounts, const int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) @@ -407,12 +407,12 @@ int PMPI_Iscatterv(void* sendbuf, int* sendcounts, int* displs, MPI_Datatype sen return MPI_SUCCESS; } -int PMPI_Reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) +int PMPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) { return PMPI_Ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, MPI_REQUEST_IGNORED); } -int PMPI_Ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request* request) +int PMPI_Ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) return MPI_ERR_COMM; @@ -446,7 +446,7 @@ int PMPI_Ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, return MPI_SUCCESS; } -int PMPI_Reduce_local(void* inbuf, void* inoutbuf, int count, MPI_Datatype datatype, MPI_Op op) +int PMPI_Reduce_local(const void* inbuf, void* inoutbuf, int count, MPI_Datatype datatype, MPI_Op op) { if (datatype == MPI_DATATYPE_NULL || not datatype->is_valid()) return MPI_ERR_TYPE; @@ -461,12 +461,12 @@ int PMPI_Reduce_local(void* inbuf, void* inoutbuf, int count, MPI_Datatype datat return MPI_SUCCESS; } -int PMPI_Allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int PMPI_Allreduce(const 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 PMPI_Iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) { if (comm == MPI_COMM_NULL) return MPI_ERR_COMM; @@ -482,10 +482,10 @@ int PMPI_Iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty return MPI_ERR_ARG; smpi_bench_end(); - char* sendtmpbuf = static_cast(sendbuf); + const char* sendtmpbuf = static_cast(sendbuf); if (sendbuf == MPI_IN_PLACE) { sendtmpbuf = static_cast(xbt_malloc(count * datatype->get_extent())); - simgrid::smpi::Datatype::copy(recvbuf, count, datatype, sendtmpbuf, count, datatype); + simgrid::smpi::Datatype::copy(recvbuf, count, datatype, const_cast(sendtmpbuf), count, datatype); } int rank = simgrid::s4u::this_actor::get_pid(); @@ -500,19 +500,19 @@ int PMPI_Iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype dataty simgrid::smpi::Colls::iallreduce(sendtmpbuf, recvbuf, count, datatype, op, comm, request); if (sendbuf == MPI_IN_PLACE) - xbt_free(sendtmpbuf); + xbt_free(const_cast(sendtmpbuf)); TRACE_smpi_comm_out(rank); smpi_bench_begin(); return MPI_SUCCESS; } -int PMPI_Scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int PMPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { return PMPI_Iscan(sendbuf, recvbuf, count, datatype, op, comm, MPI_REQUEST_IGNORED); } -int PMPI_Iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request) +int PMPI_Iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) return MPI_ERR_COMM; @@ -529,10 +529,10 @@ int PMPI_Iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, M smpi_bench_end(); int rank = simgrid::s4u::this_actor::get_pid(); - void* sendtmpbuf = sendbuf; + const void* sendtmpbuf = sendbuf; if (sendbuf == MPI_IN_PLACE) { - sendtmpbuf = static_cast(xbt_malloc(count * datatype->size())); - memcpy(sendtmpbuf, recvbuf, count * datatype->size()); + sendtmpbuf = static_cast(xbt_malloc(count * datatype->size())); + memcpy(const_cast(sendtmpbuf), recvbuf, count * datatype->size()); } TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Scan" : "PMPI_Iscan", new simgrid::instr::Pt2PtTIData(request == MPI_REQUEST_IGNORED ? "scan" : "iscan", -1, @@ -547,17 +547,17 @@ int PMPI_Iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, M TRACE_smpi_comm_out(rank); if (sendbuf == MPI_IN_PLACE) - xbt_free(sendtmpbuf); + xbt_free(const_cast(sendtmpbuf)); smpi_bench_begin(); return retval; } -int PMPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int PMPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { return PMPI_Iexscan(sendbuf, recvbuf, count, datatype, op, comm, MPI_REQUEST_IGNORED); } -int PMPI_Iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request){ +int PMPI_Iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request){ if (comm == MPI_COMM_NULL) return MPI_ERR_COMM; if (not datatype->is_valid()) @@ -573,10 +573,10 @@ int PMPI_Iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, smpi_bench_end(); int rank = simgrid::s4u::this_actor::get_pid(); - void* sendtmpbuf = sendbuf; + const void* sendtmpbuf = sendbuf; if (sendbuf == MPI_IN_PLACE) { - sendtmpbuf = static_cast(xbt_malloc(count * datatype->size())); - memcpy(sendtmpbuf, recvbuf, count * datatype->size()); + sendtmpbuf = static_cast(xbt_malloc(count * datatype->size())); + memcpy(const_cast(sendtmpbuf), recvbuf, count * datatype->size()); } TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Exscan" : "PMPI_Iexscan", @@ -592,17 +592,17 @@ int PMPI_Iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, TRACE_smpi_comm_out(rank); if (sendbuf == MPI_IN_PLACE) - xbt_free(sendtmpbuf); + xbt_free(const_cast(sendtmpbuf)); smpi_bench_begin(); return retval; } -int PMPI_Reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int PMPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { return PMPI_Ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm, MPI_REQUEST_IGNORED); } -int PMPI_Ireduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) +int PMPI_Ireduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request) { if (comm == MPI_COMM_NULL) return MPI_ERR_COMM; @@ -633,10 +633,10 @@ int PMPI_Ireduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Data totalcount += recvcounts[i]; } - void* sendtmpbuf = sendbuf; + const void* sendtmpbuf = sendbuf; if (sendbuf == MPI_IN_PLACE) { - sendtmpbuf = static_cast(xbt_malloc(totalcount * datatype->size())); - memcpy(sendtmpbuf, recvbuf, totalcount * datatype->size()); + sendtmpbuf = static_cast(xbt_malloc(totalcount * datatype->size())); + memcpy(const_cast(sendtmpbuf), recvbuf, totalcount * datatype->size()); } TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce_scatter" : "PMPI_Ireduce_scatter", @@ -651,18 +651,18 @@ int PMPI_Ireduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Data TRACE_smpi_comm_out(rank); if (sendbuf == MPI_IN_PLACE) - xbt_free(sendtmpbuf); + xbt_free(const_cast(sendtmpbuf)); smpi_bench_begin(); return MPI_SUCCESS; } -int PMPI_Reduce_scatter_block(void *sendbuf, void *recvbuf, int recvcount, +int PMPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { return PMPI_Ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm, MPI_REQUEST_IGNORED); } -int PMPI_Ireduce_scatter_block(void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, +int PMPI_Ireduce_scatter_block(const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) @@ -683,10 +683,10 @@ int PMPI_Ireduce_scatter_block(void* sendbuf, void* recvbuf, int recvcount, MPI_ int dt_send_size = datatype->is_replayable() ? 1 : datatype->size(); std::vector* trace_recvcounts = new std::vector(recvcount * dt_send_size); // copy data to avoid bad free - void* sendtmpbuf = sendbuf; + const void* sendtmpbuf = sendbuf; if (sendbuf == MPI_IN_PLACE) { - sendtmpbuf = static_cast(xbt_malloc(recvcount * count * datatype->size())); - memcpy(sendtmpbuf, recvbuf, recvcount * count * datatype->size()); + sendtmpbuf = static_cast(xbt_malloc(recvcount * count * datatype->size())); + memcpy(const_cast(sendtmpbuf), recvbuf, recvcount * count * datatype->size()); } TRACE_smpi_comm_in( @@ -705,17 +705,17 @@ int PMPI_Ireduce_scatter_block(void* sendbuf, void* recvbuf, int recvcount, MPI_ TRACE_smpi_comm_out(rank); if (sendbuf == MPI_IN_PLACE) - xbt_free(sendtmpbuf); + xbt_free(const_cast(sendtmpbuf)); smpi_bench_begin(); return MPI_SUCCESS; } -int PMPI_Alltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, +int PMPI_Alltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, 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, +int PMPI_Ialltoall(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) @@ -731,14 +731,14 @@ int PMPI_Ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* re smpi_bench_end(); int rank = simgrid::s4u::this_actor::get_pid(); - void* sendtmpbuf = static_cast(sendbuf); + const void* sendtmpbuf = static_cast(sendbuf); int sendtmpcount = sendcount; MPI_Datatype sendtmptype = sendtype; if (sendbuf == MPI_IN_PLACE) { sendtmpbuf = static_cast(xbt_malloc(recvcount * comm->size() * recvtype->size())); // memcpy(??,nullptr,0) is actually undefined behavor, even if harmless. if (recvbuf != nullptr) - memcpy(sendtmpbuf, recvbuf, recvcount * comm->size() * recvtype->size()); + memcpy(const_cast(sendtmpbuf), recvbuf, recvcount * comm->size() * recvtype->size()); sendtmpcount = recvcount; sendtmptype = recvtype; } @@ -758,19 +758,19 @@ int PMPI_Ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* re TRACE_smpi_comm_out(rank); if (sendbuf == MPI_IN_PLACE) - xbt_free(sendtmpbuf); + xbt_free(const_cast(sendtmpbuf)); smpi_bench_begin(); return retval; } -int PMPI_Alltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype sendtype, void* recvbuf, - int* recvcounts, int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm) +int PMPI_Alltoallv(const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf, + const int* recvcounts, const 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 PMPI_Ialltoallv(const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf, + const int* recvcounts, const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) return MPI_ERR_COMM; @@ -798,9 +798,9 @@ int PMPI_Ialltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype std::vector* trace_recvcounts = new std::vector; int dt_size_recv = recvtype->size(); - void* sendtmpbuf = static_cast(sendbuf); - int* sendtmpcounts = sendcounts; - int* sendtmpdisps = senddisps; + const void* sendtmpbuf = static_cast(sendbuf); + const int* sendtmpcounts = sendcounts; + const int* sendtmpdisps = senddisps; MPI_Datatype sendtmptype = sendtype; int maxsize = 0; for (int i = 0; i < size; i++) { // copy data to avoid bad free @@ -812,11 +812,11 @@ int PMPI_Ialltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype if (sendbuf == MPI_IN_PLACE) { sendtmpbuf = static_cast(xbt_malloc(maxsize)); - memcpy(sendtmpbuf, recvbuf, maxsize); + memcpy(const_cast(sendtmpbuf), recvbuf, maxsize); sendtmpcounts = static_cast(xbt_malloc(size * sizeof(int))); - memcpy(sendtmpcounts, recvcounts, size * sizeof(int)); + memcpy(const_cast(sendtmpcounts), recvcounts, size * sizeof(int)); sendtmpdisps = static_cast(xbt_malloc(size * sizeof(int))); - memcpy(sendtmpdisps, recvdisps, size * sizeof(int)); + memcpy(const_cast(sendtmpdisps), recvdisps, size * sizeof(int)); sendtmptype = recvtype; } @@ -843,22 +843,22 @@ int PMPI_Ialltoallv(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype TRACE_smpi_comm_out(rank); if (sendbuf == MPI_IN_PLACE) { - xbt_free(sendtmpbuf); - xbt_free(sendtmpcounts); - xbt_free(sendtmpdisps); + xbt_free(const_cast(sendtmpbuf)); + xbt_free(const_cast(sendtmpcounts)); + xbt_free(const_cast(sendtmpdisps)); } smpi_bench_begin(); return retval; } -int PMPI_Alltoallw(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype* sendtypes, void* recvbuf, - int* recvcounts, int* recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm) +int PMPI_Alltoallw(const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf, + const int* recvcounts, const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm) { return PMPI_Ialltoallw(sendbuf, sendcounts, senddisps, sendtypes, recvbuf, recvcounts, recvdisps, recvtypes, comm, MPI_REQUEST_IGNORED); } -int PMPI_Ialltoallw(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype* sendtypes, void* recvbuf, - int* recvcounts, int* recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request* request) +int PMPI_Ialltoallw(const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf, + const int* recvcounts, const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request* request) { if (comm == MPI_COMM_NULL) return MPI_ERR_COMM; @@ -884,10 +884,10 @@ int PMPI_Ialltoallw(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype std::vector* trace_sendcounts = new std::vector; std::vector* trace_recvcounts = new std::vector; - void* sendtmpbuf = static_cast(sendbuf); - int* sendtmpcounts = sendcounts; - int* sendtmpdisps = senddisps; - MPI_Datatype* sendtmptypes = sendtypes; + const void* sendtmpbuf = static_cast(sendbuf); + const int* sendtmpcounts = sendcounts; + const int* sendtmpdisps = senddisps; + const MPI_Datatype* sendtmptypes = sendtypes; unsigned long maxsize = 0; for (int i = 0; i < size; i++) { // copy data to avoid bad free if (recvtypes[i] == MPI_DATATYPE_NULL) { @@ -903,13 +903,13 @@ int PMPI_Ialltoallw(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype if (sendbuf == MPI_IN_PLACE) { sendtmpbuf = static_cast(xbt_malloc(maxsize)); - memcpy(sendtmpbuf, recvbuf, maxsize); + memcpy(const_cast(sendtmpbuf), recvbuf, maxsize); sendtmpcounts = static_cast(xbt_malloc(size * sizeof(int))); - memcpy(sendtmpcounts, recvcounts, size * sizeof(int)); + memcpy(const_cast(sendtmpcounts), recvcounts, size * sizeof(int)); sendtmpdisps = static_cast(xbt_malloc(size * sizeof(int))); - memcpy(sendtmpdisps, recvdisps, size * sizeof(int)); + memcpy(const_cast(sendtmpdisps), recvdisps, size * sizeof(int)); sendtmptypes = static_cast(xbt_malloc(size * sizeof(MPI_Datatype))); - memcpy(sendtmptypes, recvtypes, size * sizeof(MPI_Datatype)); + memcpy(const_cast(sendtmptypes), recvtypes, size * sizeof(MPI_Datatype)); } for (int i = 0; i < size; i++) { // copy data to avoid bad free @@ -933,10 +933,10 @@ int PMPI_Ialltoallw(void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype TRACE_smpi_comm_out(rank); if (sendbuf == MPI_IN_PLACE) { - xbt_free(sendtmpbuf); - xbt_free(sendtmpcounts); - xbt_free(sendtmpdisps); - xbt_free(sendtmptypes); + xbt_free(const_cast(sendtmpbuf)); + xbt_free(const_cast(sendtmpcounts)); + xbt_free(const_cast(sendtmpdisps)); + xbt_free(const_cast(sendtmptypes)); } smpi_bench_begin(); return retval; diff --git a/src/smpi/colls/allgather/allgather-2dmesh.cpp b/src/smpi/colls/allgather/allgather-2dmesh.cpp index 2b49ff3769..02bd09be0b 100644 --- a/src/smpi/colls/allgather/allgather-2dmesh.cpp +++ b/src/smpi/colls/allgather/allgather-2dmesh.cpp @@ -111,7 +111,7 @@ namespace smpi{ int -Coll_allgather_2dmesh::allgather(void *send_buff, int send_count, MPI_Datatype +Coll_allgather_2dmesh::allgather(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) { diff --git a/src/smpi/colls/allgather/allgather-3dmesh.cpp b/src/smpi/colls/allgather/allgather-3dmesh.cpp index e27aa4b154..38ef2b05ea 100644 --- a/src/smpi/colls/allgather/allgather-3dmesh.cpp +++ b/src/smpi/colls/allgather/allgather-3dmesh.cpp @@ -96,7 +96,7 @@ namespace simgrid{ namespace smpi{ -int Coll_allgather_3dmesh::allgather(void *send_buff, int send_count, +int Coll_allgather_3dmesh::allgather(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/allgather/allgather-GB.cpp b/src/smpi/colls/allgather/allgather-GB.cpp index ee859c663c..26ded0b233 100644 --- a/src/smpi/colls/allgather/allgather-GB.cpp +++ b/src/smpi/colls/allgather/allgather-GB.cpp @@ -9,7 +9,7 @@ namespace simgrid{ namespace smpi{ // Allgather - gather/bcast algorithm -int Coll_allgather_GB::allgather(void *send_buff, int send_count, +int Coll_allgather_GB::allgather(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/allgather/allgather-NTSLR-NB.cpp b/src/smpi/colls/allgather/allgather-NTSLR-NB.cpp index a636040451..608e02658b 100644 --- a/src/smpi/colls/allgather/allgather-NTSLR-NB.cpp +++ b/src/smpi/colls/allgather/allgather-NTSLR-NB.cpp @@ -12,7 +12,7 @@ namespace smpi{ // Allgather-Non-Topoloty-Scecific-Logical-Ring algorithm int -Coll_allgather_NTSLR_NB::allgather(void *sbuf, int scount, MPI_Datatype stype, +Coll_allgather_NTSLR_NB::allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, MPI_Comm comm) { diff --git a/src/smpi/colls/allgather/allgather-NTSLR.cpp b/src/smpi/colls/allgather/allgather-NTSLR.cpp index 27c5b70bbe..3aa5365b46 100644 --- a/src/smpi/colls/allgather/allgather-NTSLR.cpp +++ b/src/smpi/colls/allgather/allgather-NTSLR.cpp @@ -13,7 +13,7 @@ namespace smpi{ // Allgather-Non-Topoloty-Scecific-Logical-Ring algorithm int -Coll_allgather_NTSLR::allgather(void *sbuf, int scount, MPI_Datatype stype, +Coll_allgather_NTSLR::allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, MPI_Comm comm) { diff --git a/src/smpi/colls/allgather/allgather-SMP-NTS.cpp b/src/smpi/colls/allgather/allgather-SMP-NTS.cpp index bce3f6ea6a..9e5986b6e9 100644 --- a/src/smpi/colls/allgather/allgather-SMP-NTS.cpp +++ b/src/smpi/colls/allgather/allgather-SMP-NTS.cpp @@ -10,7 +10,7 @@ namespace simgrid{ namespace smpi{ -int Coll_allgather_SMP_NTS::allgather(void *sbuf, int scount, +int Coll_allgather_SMP_NTS::allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, MPI_Comm comm) diff --git a/src/smpi/colls/allgather/allgather-bruck.cpp b/src/smpi/colls/allgather/allgather-bruck.cpp index 44578b253e..1e7cf374b8 100644 --- a/src/smpi/colls/allgather/allgather-bruck.cpp +++ b/src/smpi/colls/allgather/allgather-bruck.cpp @@ -73,7 +73,7 @@ namespace smpi{ -int Coll_allgather_bruck::allgather(void *send_buff, int send_count, +int Coll_allgather_bruck::allgather(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/allgather/allgather-loosely-lr.cpp b/src/smpi/colls/allgather/allgather-loosely-lr.cpp index 575356ad66..3da2263999 100644 --- a/src/smpi/colls/allgather/allgather-loosely-lr.cpp +++ b/src/smpi/colls/allgather/allgather-loosely-lr.cpp @@ -10,7 +10,7 @@ namespace simgrid{ namespace smpi{ -int Coll_allgather_loosely_lr::allgather(void *sbuf, int scount, +int Coll_allgather_loosely_lr::allgather(const void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, MPI_Comm comm) diff --git a/src/smpi/colls/allgather/allgather-mvapich-smp.cpp b/src/smpi/colls/allgather/allgather-mvapich-smp.cpp index 0d641c6baa..1a624ebf7e 100644 --- a/src/smpi/colls/allgather/allgather-mvapich-smp.cpp +++ b/src/smpi/colls/allgather/allgather-mvapich-smp.cpp @@ -38,7 +38,7 @@ namespace simgrid{ namespace smpi{ -int Coll_allgather_mvapich2_smp::allgather(void *sendbuf,int sendcnt, MPI_Datatype sendtype, +int Coll_allgather_mvapich2_smp::allgather(const void *sendbuf,int sendcnt, MPI_Datatype sendtype, void *recvbuf, int recvcnt,MPI_Datatype recvtype, MPI_Comm comm) { diff --git a/src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp b/src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp index f9bc2b909c..0b0a0b2a05 100644 --- a/src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp +++ b/src/smpi/colls/allgather/allgather-ompi-neighborexchange.cpp @@ -68,7 +68,7 @@ namespace simgrid{ namespace smpi{ int -Coll_allgather_ompi_neighborexchange::allgather(void *sbuf, int scount, +Coll_allgather_ompi_neighborexchange::allgather(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, diff --git a/src/smpi/colls/allgather/allgather-pair.cpp b/src/smpi/colls/allgather/allgather-pair.cpp index 51c0364236..7f0ec36bfa 100644 --- a/src/smpi/colls/allgather/allgather-pair.cpp +++ b/src/smpi/colls/allgather/allgather-pair.cpp @@ -70,7 +70,7 @@ namespace smpi{ int -Coll_allgather_pair::allgather(void *send_buff, int send_count, +Coll_allgather_pair::allgather(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/allgather/allgather-rdb.cpp b/src/smpi/colls/allgather/allgather-rdb.cpp index e580acadc8..5811d72370 100644 --- a/src/smpi/colls/allgather/allgather-rdb.cpp +++ b/src/smpi/colls/allgather/allgather-rdb.cpp @@ -10,7 +10,7 @@ namespace simgrid{ namespace smpi{ int -Coll_allgather_rdb::allgather(void *sbuf, int send_count, +Coll_allgather_rdb::allgather(const void *sbuf, int send_count, MPI_Datatype send_type, void *rbuf, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/allgather/allgather-rhv.cpp b/src/smpi/colls/allgather/allgather-rhv.cpp index e4b504e528..bcbb4d1cd3 100644 --- a/src/smpi/colls/allgather/allgather-rhv.cpp +++ b/src/smpi/colls/allgather/allgather-rhv.cpp @@ -13,7 +13,7 @@ namespace smpi{ // now only work with power of two processes int -Coll_allgather_rhv::allgather(void *sbuf, int send_count, +Coll_allgather_rhv::allgather(const void *sbuf, int send_count, MPI_Datatype send_type, void *rbuf, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/allgather/allgather-ring.cpp b/src/smpi/colls/allgather/allgather-ring.cpp index f6537a5395..26e369d24c 100644 --- a/src/smpi/colls/allgather/allgather-ring.cpp +++ b/src/smpi/colls/allgather/allgather-ring.cpp @@ -69,7 +69,7 @@ namespace smpi{ int -Coll_allgather_ring::allgather(void *send_buff, int send_count, +Coll_allgather_ring::allgather(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/allgather/allgather-smp-simple.cpp b/src/smpi/colls/allgather/allgather-smp-simple.cpp index b559ba4f8c..06bf8d8f46 100644 --- a/src/smpi/colls/allgather/allgather-smp-simple.cpp +++ b/src/smpi/colls/allgather/allgather-smp-simple.cpp @@ -10,7 +10,7 @@ namespace simgrid{ namespace smpi{ -int Coll_allgather_smp_simple::allgather(void *send_buf, int scount, +int Coll_allgather_smp_simple::allgather(const void *send_buf, int scount, MPI_Datatype stype, void *recv_buf, int rcount, MPI_Datatype rtype, MPI_Comm comm) diff --git a/src/smpi/colls/allgather/allgather-spreading-simple.cpp b/src/smpi/colls/allgather/allgather-spreading-simple.cpp index e5009071fd..af20e8f6b0 100644 --- a/src/smpi/colls/allgather/allgather-spreading-simple.cpp +++ b/src/smpi/colls/allgather/allgather-spreading-simple.cpp @@ -72,7 +72,7 @@ namespace smpi{ int -Coll_allgather_spreading_simple::allgather(void *send_buff, int send_count, +Coll_allgather_spreading_simple::allgather(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, diff --git a/src/smpi/colls/allgatherv/allgatherv-GB.cpp b/src/smpi/colls/allgatherv/allgatherv-GB.cpp index 39b440694b..d3de949c9c 100644 --- a/src/smpi/colls/allgatherv/allgatherv-GB.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-GB.cpp @@ -10,9 +10,9 @@ namespace simgrid{ namespace smpi{ // Allgather - gather/bcast algorithm -int Coll_allgatherv_GB::allgatherv(void *send_buff, int send_count, +int Coll_allgatherv_GB::allgatherv(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, - int *recv_counts, int *recv_disps, MPI_Datatype recv_type, + const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { Colls::gatherv(send_buff, send_count, send_type, recv_buff, recv_counts, recv_disps, recv_type, 0, comm); diff --git a/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp b/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp index df72733c94..a359f44517 100644 --- a/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-mpich-rdb.cpp @@ -14,12 +14,12 @@ namespace simgrid{ namespace smpi{ int Coll_allgatherv_mpich_rdb::allgatherv ( - void *sendbuf, + const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, - int *recvcounts, - int *displs, + const int *recvcounts, + const int *displs, MPI_Datatype recvtype, MPI_Comm comm) { diff --git a/src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp b/src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp index c0d9dc925d..155b24f61d 100644 --- a/src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-mpich-ring.cpp @@ -29,9 +29,9 @@ namespace simgrid{ namespace smpi{ int -Coll_allgatherv_mpich_ring::allgatherv(void *sendbuf, int sendcount, +Coll_allgatherv_mpich_ring::allgatherv(const void *sendbuf, int sendcount, MPI_Datatype send_type, void *recvbuf, - int *recvcounts, int *displs, MPI_Datatype recvtype, + const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm) { diff --git a/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp b/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp index b4c2b033ce..91d9977778 100644 --- a/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-ompi-bruck.cpp @@ -80,10 +80,10 @@ namespace simgrid{ namespace smpi{ -int Coll_allgatherv_ompi_bruck::allgatherv(void *sbuf, int scount, +int Coll_allgatherv_ompi_bruck::allgatherv(const void *sbuf, int scount, MPI_Datatype sdtype, - void *rbuf, int *rcounts, - int *rdispls, + void *rbuf, const int *rcounts, + const int *rdispls, MPI_Datatype rdtype, MPI_Comm comm) { diff --git a/src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp b/src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp index bdeacabd34..74542dece0 100644 --- a/src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-ompi-neighborexchange.cpp @@ -69,9 +69,9 @@ namespace simgrid{ namespace smpi{ int -Coll_allgatherv_ompi_neighborexchange::allgatherv(void *sbuf, int scount, +Coll_allgatherv_ompi_neighborexchange::allgatherv(const void *sbuf, int scount, MPI_Datatype sdtype, - void* rbuf, int *rcounts, int *rdispls, + void* rbuf, const int *rcounts, const int *rdispls, MPI_Datatype rdtype, MPI_Comm comm) { diff --git a/src/smpi/colls/allgatherv/allgatherv-pair.cpp b/src/smpi/colls/allgatherv/allgatherv-pair.cpp index ae5fbdef97..f066747815 100644 --- a/src/smpi/colls/allgatherv/allgatherv-pair.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-pair.cpp @@ -69,9 +69,9 @@ namespace simgrid{ namespace smpi{ int -Coll_allgatherv_pair::allgatherv(void *send_buff, int send_count, +Coll_allgatherv_pair::allgatherv(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, - int *recv_counts, int *recv_disps, MPI_Datatype recv_type, + const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { diff --git a/src/smpi/colls/allgatherv/allgatherv-ring.cpp b/src/smpi/colls/allgatherv/allgatherv-ring.cpp index 8d0a65d5c7..b09243566c 100644 --- a/src/smpi/colls/allgatherv/allgatherv-ring.cpp +++ b/src/smpi/colls/allgatherv/allgatherv-ring.cpp @@ -68,9 +68,9 @@ namespace simgrid{ namespace smpi{ int -Coll_allgatherv_ring::allgatherv(void *send_buff, int send_count, +Coll_allgatherv_ring::allgatherv(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, - int *recv_counts, int *recv_disps, MPI_Datatype recv_type, + const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { diff --git a/src/smpi/colls/allreduce/allreduce-lr.cpp b/src/smpi/colls/allreduce/allreduce-lr.cpp index 9d92883e69..380e09322a 100644 --- a/src/smpi/colls/allreduce/allreduce-lr.cpp +++ b/src/smpi/colls/allreduce/allreduce-lr.cpp @@ -21,7 +21,7 @@ namespace simgrid{ namespace smpi{ int -Coll_allreduce_lr::allreduce(void *sbuf, void *rbuf, int rcount, +Coll_allreduce_lr::allreduce(const void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { int tag = COLL_TAG_ALLREDUCE; diff --git a/src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp b/src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp index 669c34752e..d5102b1ff5 100644 --- a/src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp +++ b/src/smpi/colls/allreduce/allreduce-mvapich-rs.cpp @@ -26,7 +26,7 @@ namespace simgrid{ namespace smpi{ -int Coll_allreduce_mvapich2_rs::allreduce(void *sendbuf, +int Coll_allreduce_mvapich2_rs::allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, diff --git a/src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp b/src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp index 4c206c4cee..8a89d286ab 100644 --- a/src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp +++ b/src/smpi/colls/allreduce/allreduce-mvapich-two-level.cpp @@ -40,14 +40,14 @@ #define MPIR_Allreduce_pt2pt_rd_MV2 Coll_allreduce_rdb::allreduce #define MPIR_Allreduce_pt2pt_rs_MV2 Coll_allreduce_mvapich2_rs::allreduce -extern int (*MV2_Allreducection)(void *sendbuf, +extern int (*MV2_Allreducection)(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); -extern int (*MV2_Allreduce_intra_function)( void *sendbuf, +extern int (*MV2_Allreduce_intra_function)(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, @@ -56,7 +56,7 @@ extern int (*MV2_Allreduce_intra_function)( void *sendbuf, namespace simgrid{ namespace smpi{ -static int MPIR_Allreduce_reduce_p2p_MV2( void *sendbuf, +static int MPIR_Allreduce_reduce_p2p_MV2(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, @@ -66,7 +66,7 @@ static int MPIR_Allreduce_reduce_p2p_MV2( void *sendbuf, return MPI_SUCCESS; } -static int MPIR_Allreduce_reduce_shmem_MV2( void *sendbuf, +static int MPIR_Allreduce_reduce_shmem_MV2(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, @@ -78,7 +78,7 @@ static int MPIR_Allreduce_reduce_shmem_MV2( void *sendbuf, /* general two level allreduce helper function */ -int Coll_allreduce_mvapich2_two_level::allreduce(void *sendbuf, +int Coll_allreduce_mvapich2_two_level::allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, diff --git a/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp b/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp index cea8087227..e20328f9b0 100644 --- a/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp +++ b/src/smpi/colls/allreduce/allreduce-ompi-ring-segmented.cpp @@ -158,7 +158,7 @@ namespace simgrid{ namespace smpi{ int -Coll_allreduce_ompi_ring_segmented::allreduce(void *sbuf, void *rbuf, int count, +Coll_allreduce_ompi_ring_segmented::allreduce(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) diff --git a/src/smpi/colls/allreduce/allreduce-rab-rdb.cpp b/src/smpi/colls/allreduce/allreduce-rab-rdb.cpp index 60f093fa67..4c9f338d98 100644 --- a/src/smpi/colls/allreduce/allreduce-rab-rdb.cpp +++ b/src/smpi/colls/allreduce/allreduce-rab-rdb.cpp @@ -7,7 +7,7 @@ #include "../colls_private.hpp" namespace simgrid{ namespace smpi{ -int Coll_allreduce_rab_rdb::allreduce(void *sbuff, void *rbuff, int count, +int Coll_allreduce_rab_rdb::allreduce(const void *sbuff, void *rbuff, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { diff --git a/src/smpi/colls/allreduce/allreduce-rab1.cpp b/src/smpi/colls/allreduce/allreduce-rab1.cpp index 9563c03df8..9910b14048 100644 --- a/src/smpi/colls/allreduce/allreduce-rab1.cpp +++ b/src/smpi/colls/allreduce/allreduce-rab1.cpp @@ -9,7 +9,7 @@ namespace simgrid{ namespace smpi{ // NP pow of 2 for now -int Coll_allreduce_rab1::allreduce(void *sbuff, void *rbuff, +int Coll_allreduce_rab1::allreduce(const void *sbuff, void *rbuff, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { diff --git a/src/smpi/colls/allreduce/allreduce-rab2.cpp b/src/smpi/colls/allreduce/allreduce-rab2.cpp index bad546c10b..0a45358480 100644 --- a/src/smpi/colls/allreduce/allreduce-rab2.cpp +++ b/src/smpi/colls/allreduce/allreduce-rab2.cpp @@ -10,7 +10,7 @@ namespace simgrid{ namespace smpi{ // this requires that count >= NP -int Coll_allreduce_rab2::allreduce(void *sbuff, void *rbuff, +int Coll_allreduce_rab2::allreduce(const void *sbuff, void *rbuff, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { @@ -62,7 +62,7 @@ int Coll_allreduce_rab2::allreduce(void *sbuff, void *rbuff, smpi_free_tmp_buffer(tmp); smpi_free_tmp_buffer(send); } else { - send = sbuff; + send = const_cast(sbuff); send_size = count / nprocs; nbytes = send_size * s_extent; r_offset = rank * nbytes; diff --git a/src/smpi/colls/allreduce/allreduce-rdb.cpp b/src/smpi/colls/allreduce/allreduce-rdb.cpp index 19163414cf..4afddb4381 100644 --- a/src/smpi/colls/allreduce/allreduce-rdb.cpp +++ b/src/smpi/colls/allreduce/allreduce-rdb.cpp @@ -8,7 +8,7 @@ //#include namespace simgrid{ namespace smpi{ -int Coll_allreduce_rdb::allreduce(void *sbuff, void *rbuff, int count, +int Coll_allreduce_rdb::allreduce(const void *sbuff, void *rbuff, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { int nprocs, rank, tag = COLL_TAG_ALLREDUCE; diff --git a/src/smpi/colls/allreduce/allreduce-redbcast.cpp b/src/smpi/colls/allreduce/allreduce-redbcast.cpp index b3898995b0..1f5863cb19 100644 --- a/src/smpi/colls/allreduce/allreduce-redbcast.cpp +++ b/src/smpi/colls/allreduce/allreduce-redbcast.cpp @@ -7,7 +7,7 @@ #include "../colls_private.hpp" namespace simgrid{ namespace smpi{ -int Coll_allreduce_redbcast::allreduce(void *buf, void *buf2, int count, +int Coll_allreduce_redbcast::allreduce(const void *buf, void *buf2, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { diff --git a/src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp b/src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp index 723eb422c7..7de6db78fb 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-binomial-pipeline.cpp @@ -40,7 +40,7 @@ This fucntion performs all-reduce operation as follow. ** in a pipeline fashion */ namespace simgrid{ namespace smpi{ -int Coll_allreduce_smp_binomial_pipeline::allreduce(void *send_buf, +int Coll_allreduce_smp_binomial_pipeline::allreduce(const void *send_buf, void *recv_buf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) diff --git a/src/smpi/colls/allreduce/allreduce-smp-binomial.cpp b/src/smpi/colls/allreduce/allreduce-smp-binomial.cpp index c9b0076db0..3b1c401687 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-binomial.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-binomial.cpp @@ -29,7 +29,7 @@ This fucntion performs all-reduce operation as follow. */ namespace simgrid{ namespace smpi{ -int Coll_allreduce_smp_binomial::allreduce(void *send_buf, void *recv_buf, +int Coll_allreduce_smp_binomial::allreduce(const void *send_buf, void *recv_buf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { diff --git a/src/smpi/colls/allreduce/allreduce-smp-rdb.cpp b/src/smpi/colls/allreduce/allreduce-smp-rdb.cpp index 1c8d99d00f..a9a573941b 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-rdb.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-rdb.cpp @@ -28,7 +28,7 @@ This fucntion performs all-reduce operation as follow. */ namespace simgrid{ namespace smpi{ -int Coll_allreduce_smp_rdb::allreduce(void *send_buf, void *recv_buf, int count, +int Coll_allreduce_smp_rdb::allreduce(const void *send_buf, void *recv_buf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { diff --git a/src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp b/src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp index e2753d17ff..9babeb9e94 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-rsag-lr.cpp @@ -16,7 +16,7 @@ This fucntion performs all-reduce operation as follow. */ namespace simgrid{ namespace smpi{ -int Coll_allreduce_smp_rsag_lr::allreduce(void *send_buf, void *recv_buf, +int Coll_allreduce_smp_rsag_lr::allreduce(const void *send_buf, void *recv_buf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { diff --git a/src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp b/src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp index 2286a05afd..0b20bf2ca0 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-rsag-rab.cpp @@ -20,7 +20,7 @@ This fucntion performs all-reduce operation as follow. */ namespace simgrid{ namespace smpi{ -int Coll_allreduce_smp_rsag_rab::allreduce(void *sbuf, void *rbuf, int count, +int Coll_allreduce_smp_rsag_rab::allreduce(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { diff --git a/src/smpi/colls/allreduce/allreduce-smp-rsag.cpp b/src/smpi/colls/allreduce/allreduce-smp-rsag.cpp index d53d29e89f..1be58c92c8 100644 --- a/src/smpi/colls/allreduce/allreduce-smp-rsag.cpp +++ b/src/smpi/colls/allreduce/allreduce-smp-rsag.cpp @@ -15,7 +15,7 @@ This fucntion performs all-reduce operation as follow. */ namespace simgrid{ namespace smpi{ -int Coll_allreduce_smp_rsag::allreduce(void *send_buf, void *recv_buf, +int Coll_allreduce_smp_rsag::allreduce(const void *send_buf, void *recv_buf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { diff --git a/src/smpi/colls/alltoall/alltoall-2dmesh.cpp b/src/smpi/colls/alltoall/alltoall-2dmesh.cpp index 03f0a8774d..e27e5ded26 100644 --- a/src/smpi/colls/alltoall/alltoall-2dmesh.cpp +++ b/src/smpi/colls/alltoall/alltoall-2dmesh.cpp @@ -55,7 +55,7 @@ static int alltoall_check_is_2dmesh(int num, int *i, int *j) namespace simgrid{ namespace smpi{ -int Coll_alltoall_2dmesh::alltoall(void *send_buff, int send_count, +int Coll_alltoall_2dmesh::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/alltoall/alltoall-3dmesh.cpp b/src/smpi/colls/alltoall/alltoall-3dmesh.cpp index 258058d6c2..3870c52499 100644 --- a/src/smpi/colls/alltoall/alltoall-3dmesh.cpp +++ b/src/smpi/colls/alltoall/alltoall-3dmesh.cpp @@ -47,7 +47,7 @@ static int alltoall_check_is_3dmesh(int num, int *i, int *j, int *k) } namespace simgrid{ namespace smpi{ -int Coll_alltoall_3dmesh::alltoall(void *send_buff, int send_count, +int Coll_alltoall_3dmesh::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/alltoall/alltoall-basic-linear.cpp b/src/smpi/colls/alltoall/alltoall-basic-linear.cpp index 39c764ed51..06c538251a 100644 --- a/src/smpi/colls/alltoall/alltoall-basic-linear.cpp +++ b/src/smpi/colls/alltoall/alltoall-basic-linear.cpp @@ -13,7 +13,7 @@ namespace simgrid{ namespace smpi{ -int Coll_alltoall_basic_linear::alltoall(void *sendbuf, int sendcount, MPI_Datatype sendtype, +int Coll_alltoall_basic_linear::alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) { int system_tag = COLL_TAG_ALLTOALL; @@ -29,7 +29,7 @@ int Coll_alltoall_basic_linear::alltoall(void *sendbuf, int sendcount, MPI_Datat sendtype->extent(&lb, &sendext); recvtype->extent(&lb, &recvext); /* simple optimization */ - int err = Datatype::copy(static_cast(sendbuf) + rank * sendcount * sendext, sendcount, sendtype, + int err = Datatype::copy(static_cast(sendbuf) + rank * sendcount * sendext, sendcount, sendtype, static_cast(recvbuf) + rank * recvcount * recvext, recvcount, recvtype); if (err == MPI_SUCCESS && size > 1) { /* Initiate all send/recv to/from others. */ @@ -47,7 +47,7 @@ int Coll_alltoall_basic_linear::alltoall(void *sendbuf, int sendcount, MPI_Datat * 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(sendbuf) + i * sendcount * sendext, sendcount, + requests[count] = Request::isend_init(static_cast(sendbuf) + i * sendcount * sendext, sendcount, sendtype, i, system_tag, comm); count++; } diff --git a/src/smpi/colls/alltoall/alltoall-bruck.cpp b/src/smpi/colls/alltoall/alltoall-bruck.cpp index 0d971d8d20..c2ea5ed9ba 100644 --- a/src/smpi/colls/alltoall/alltoall-bruck.cpp +++ b/src/smpi/colls/alltoall/alltoall-bruck.cpp @@ -32,7 +32,7 @@ namespace smpi{ int -Coll_alltoall_bruck::alltoall(void *send_buff, int send_count, +Coll_alltoall_bruck::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp b/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp index 6fc2d7d7ca..5d77d38c6c 100644 --- a/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp +++ b/src/smpi/colls/alltoall/alltoall-mvapich-scatter-dest.cpp @@ -45,7 +45,7 @@ namespace simgrid{ namespace smpi{ int Coll_alltoall_mvapich2_scatter_dest::alltoall( - void *sendbuf, + const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, diff --git a/src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp b/src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp index 8e823e1e33..34e2897394 100644 --- a/src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-pair-light-barrier.cpp @@ -30,7 +30,7 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoall_pair_light_barrier::alltoall(void *send_buff, int send_count, +Coll_alltoall_pair_light_barrier::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, diff --git a/src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp b/src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp index 14ea77915c..2c40264a8a 100644 --- a/src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-pair-mpi-barrier.cpp @@ -30,7 +30,7 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoall_pair_mpi_barrier::alltoall(void *send_buff, int send_count, +Coll_alltoall_pair_mpi_barrier::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp b/src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp index 914d19c254..d626bab949 100644 --- a/src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-pair-one-barrier.cpp @@ -29,7 +29,7 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoall_pair_one_barrier::alltoall(void *send_buff, int send_count, +Coll_alltoall_pair_one_barrier::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/alltoall/alltoall-pair.cpp b/src/smpi/colls/alltoall/alltoall-pair.cpp index 1d3b4cf222..652a40ef9b 100644 --- a/src/smpi/colls/alltoall/alltoall-pair.cpp +++ b/src/smpi/colls/alltoall/alltoall-pair.cpp @@ -30,7 +30,7 @@ ****************************************************************************/ namespace simgrid{ namespace smpi{ -int Coll_alltoall_pair_rma::alltoall(void *send_buff, int send_count, MPI_Datatype send_type, +int Coll_alltoall_pair_rma::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) { @@ -64,7 +64,7 @@ int Coll_alltoall_pair_rma::alltoall(void *send_buff, int send_count, MPI_Dataty } -int Coll_alltoall_pair::alltoall(void *send_buff, int send_count, +int Coll_alltoall_pair::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/alltoall/alltoall-rdb.cpp b/src/smpi/colls/alltoall/alltoall-rdb.cpp index e52cbc79e4..24618457fd 100644 --- a/src/smpi/colls/alltoall/alltoall-rdb.cpp +++ b/src/smpi/colls/alltoall/alltoall-rdb.cpp @@ -30,7 +30,7 @@ ****************************************************************************/ namespace simgrid{ namespace smpi{ -int Coll_alltoall_rdb::alltoall(void *send_buff, int send_count, +int Coll_alltoall_rdb::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp b/src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp index adbbccc8d3..7aa92f9193 100644 --- a/src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-ring-light-barrier.cpp @@ -30,7 +30,7 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoall_ring_light_barrier::alltoall(void *send_buff, int send_count, +Coll_alltoall_ring_light_barrier::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, diff --git a/src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp b/src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp index e6a35bdb03..c8e4c34e51 100644 --- a/src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-ring-mpi-barrier.cpp @@ -29,7 +29,7 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoall_ring_mpi_barrier::alltoall(void *send_buff, int send_count, +Coll_alltoall_ring_mpi_barrier::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp b/src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp index 459c77b95d..be7e0896ec 100644 --- a/src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp +++ b/src/smpi/colls/alltoall/alltoall-ring-one-barrier.cpp @@ -28,7 +28,7 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoall_ring_one_barrier::alltoall(void *send_buff, int send_count, +Coll_alltoall_ring_one_barrier::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/alltoall/alltoall-ring.cpp b/src/smpi/colls/alltoall/alltoall-ring.cpp index 620e2acc52..8144198205 100644 --- a/src/smpi/colls/alltoall/alltoall-ring.cpp +++ b/src/smpi/colls/alltoall/alltoall-ring.cpp @@ -28,7 +28,7 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoall_ring::alltoall(void *send_buff, int send_count, +Coll_alltoall_ring::alltoall(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm) diff --git a/src/smpi/colls/alltoallv/alltoallv-bruck.cpp b/src/smpi/colls/alltoallv/alltoallv-bruck.cpp index c80bffe716..6bb0147125 100644 --- a/src/smpi/colls/alltoallv/alltoallv-bruck.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-bruck.cpp @@ -15,9 +15,9 @@ **/ namespace simgrid{ namespace smpi{ -int Coll_alltoallv_bruck::alltoallv(void *sendbuf, int *sendcounts, int *senddisps, +int Coll_alltoallv_bruck::alltoallv(const void *sendbuf, const int *sendcounts, const int *senddisps, MPI_Datatype sendtype, void *recvbuf, - int *recvcounts, int *recvdisps, MPI_Datatype recvtype, + const int *recvcounts,const int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm) { int system_tag = COLL_TAG_ALLTOALLV; diff --git a/src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp b/src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp index 501d15e383..5b646c6a9e 100644 --- a/src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-ompi-basic-linear.cpp @@ -17,9 +17,9 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoallv_ompi_basic_linear::alltoallv(void *sbuf, int *scounts, int *sdisps, +Coll_alltoallv_ompi_basic_linear::alltoallv(const void *sbuf, const int *scounts, const int *sdisps, MPI_Datatype sdtype, - void *rbuf, int *rcounts, int *rdisps, + void *rbuf, const int *rcounts, const int *rdisps, MPI_Datatype rdtype, MPI_Comm comm) { diff --git a/src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp index 4a529a67e3..f171d0f103 100644 --- a/src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-pair-light-barrier.cpp @@ -30,9 +30,9 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoallv_pair_light_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps, +Coll_alltoallv_pair_light_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, - void *recv_buff, int *recv_counts, int *recv_disps, + void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { diff --git a/src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp index 4624cb05f7..2055ef1a2f 100644 --- a/src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-pair-mpi-barrier.cpp @@ -30,9 +30,9 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoallv_pair_mpi_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps, +Coll_alltoallv_pair_mpi_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, - void *recv_buff, int *recv_counts, int *recv_disps, + void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { MPI_Status s; diff --git a/src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp index 135afd033d..dd5b2f7eb6 100644 --- a/src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-pair-one-barrier.cpp @@ -29,9 +29,9 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoallv_pair_one_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps, +Coll_alltoallv_pair_one_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, - void *recv_buff, int *recv_counts, int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) + void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { MPI_Aint send_chunk, recv_chunk; diff --git a/src/smpi/colls/alltoallv/alltoallv-pair.cpp b/src/smpi/colls/alltoallv/alltoallv-pair.cpp index 78fef831b5..c3ed962e2c 100644 --- a/src/smpi/colls/alltoallv/alltoallv-pair.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-pair.cpp @@ -29,9 +29,9 @@ ****************************************************************************/ namespace simgrid{ namespace smpi{ -int Coll_alltoallv_pair::alltoallv(void *send_buff, int *send_counts, int *send_disps, +int Coll_alltoallv_pair::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, - void *recv_buff, int *recv_counts, int *recv_disps, + void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { diff --git a/src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp index ef6d087f16..a1773f131b 100644 --- a/src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-ring-light-barrier.cpp @@ -30,9 +30,9 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoallv_ring_light_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps, +Coll_alltoallv_ring_light_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, - void *recv_buff, int *recv_counts, int *recv_disps, + void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { diff --git a/src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp index 8bcf2f4356..211347bc16 100644 --- a/src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-ring-mpi-barrier.cpp @@ -29,9 +29,9 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoallv_ring_mpi_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps, +Coll_alltoallv_ring_mpi_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, - void *recv_buff, int *recv_counts, int *recv_disps, + void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { MPI_Status s; diff --git a/src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp b/src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp index cb8e0638a6..de58b9fc5f 100644 --- a/src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-ring-one-barrier.cpp @@ -28,9 +28,9 @@ namespace simgrid{ namespace smpi{ int -Coll_alltoallv_ring_one_barrier::alltoallv(void *send_buff, int *send_counts, int *send_disps, +Coll_alltoallv_ring_one_barrier::alltoallv(const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, - void *recv_buff, int *recv_counts, int *recv_disps, + void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { MPI_Status s; diff --git a/src/smpi/colls/alltoallv/alltoallv-ring.cpp b/src/smpi/colls/alltoallv/alltoallv-ring.cpp index 35bc4c72e1..88e27c0093 100644 --- a/src/smpi/colls/alltoallv/alltoallv-ring.cpp +++ b/src/smpi/colls/alltoallv/alltoallv-ring.cpp @@ -27,8 +27,8 @@ ****************************************************************************/ namespace simgrid{ namespace smpi{ -int Coll_alltoallv_ring::alltoallv(void* send_buff, int* send_counts, int* send_disps, MPI_Datatype send_type, - void* recv_buff, int* recv_counts, int* recv_disps, MPI_Datatype recv_type, +int Coll_alltoallv_ring::alltoallv(const void* send_buff, const int* send_counts, const int* send_disps, MPI_Datatype send_type, + void* recv_buff, const int* recv_counts, const int* recv_disps, MPI_Datatype recv_type, MPI_Comm comm) { MPI_Status s; diff --git a/src/smpi/colls/gather/gather-mvapich.cpp b/src/smpi/colls/gather/gather-mvapich.cpp index d4cdf81e16..7d0a4e3056 100644 --- a/src/smpi/colls/gather/gather-mvapich.cpp +++ b/src/smpi/colls/gather/gather-mvapich.cpp @@ -41,7 +41,7 @@ #define MPIR_Gather_MV2_Direct Coll_gather_ompi_basic_linear::gather #define MPIR_Gather_MV2_two_level_Direct Coll_gather_ompi_basic_linear::gather #define MPIR_Gather_intra Coll_gather_mpich::gather -typedef int (*MV2_Gather_function_ptr) (void *sendbuf, +typedef int (*MV2_Gather_function_ptr) (const void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, @@ -80,7 +80,7 @@ namespace smpi{ * intra node gather function * errflag - (out) to record errors */ -static int MPIR_pt_pt_intra_gather( void *sendbuf, int sendcnt, MPI_Datatype sendtype, +static int MPIR_pt_pt_intra_gather( const void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, int recvcnt, MPI_Datatype recvtype, int root, int rank, void *tmp_buf, int nbytes, @@ -127,7 +127,7 @@ static int MPIR_pt_pt_intra_gather( void *sendbuf, int sendcnt, MPI_Datatype sen -int Coll_gather_mvapich2_two_level::gather(void *sendbuf, +int Coll_gather_mvapich2_two_level::gather(const void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, diff --git a/src/smpi/colls/gather/gather-ompi.cpp b/src/smpi/colls/gather/gather-ompi.cpp index 7ee16c2c1e..c81c7b8567 100644 --- a/src/smpi/colls/gather/gather-ompi.cpp +++ b/src/smpi/colls/gather/gather-ompi.cpp @@ -25,7 +25,7 @@ namespace simgrid{ namespace smpi{ -int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, +int Coll_gather_ompi_binomial::gather(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, int root, MPI_Comm comm) { int line = -1; @@ -199,7 +199,7 @@ int Coll_gather_ompi_binomial::gather(void* sbuf, int scount, MPI_Datatype sdtyp * Accepts: - same arguments as MPI_Gather(), first segment size * Returns: - MPI_SUCCESS or error code */ -int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount, +int Coll_gather_ompi_linear_sync::gather(const void *sbuf, int scount, MPI_Datatype sdtype, void *rbuf, int rcount, MPI_Datatype rdtype, @@ -247,7 +247,7 @@ int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount, first_segment_count = scount; COLL_TUNED_COMPUTED_SEGCOUNT((size_t)first_segment_size, typelng, first_segment_count); - Request::recv(sbuf, 0, MPI_BYTE, root, COLL_TAG_GATHER, comm, MPI_STATUS_IGNORE); + Request::recv(const_cast(sbuf), 0, MPI_BYTE, root, COLL_TAG_GATHER, comm, MPI_STATUS_IGNORE); Request::send(sbuf, first_segment_count, sdtype, root, COLL_TAG_GATHER, comm); @@ -352,7 +352,7 @@ int Coll_gather_ompi_linear_sync::gather(void *sbuf, int scount, * Accepts: - same arguments as MPI_Gather() * Returns: - MPI_SUCCESS or error code */ -int Coll_gather_ompi_basic_linear::gather(void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, +int Coll_gather_ompi_basic_linear::gather(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, int root, MPI_Comm comm) { int i; diff --git a/src/smpi/colls/reduce/reduce-NTSL.cpp b/src/smpi/colls/reduce/reduce-NTSL.cpp index 3f48c44862..e07d5acc38 100644 --- a/src/smpi/colls/reduce/reduce-NTSL.cpp +++ b/src/smpi/colls/reduce/reduce-NTSL.cpp @@ -14,7 +14,7 @@ int reduce_NTSL_segment_size_in_byte = 8192; */ namespace simgrid{ namespace smpi{ -int Coll_reduce_NTSL::reduce(void *buf, void *rbuf, int count, +int Coll_reduce_NTSL::reduce(const void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) { diff --git a/src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp b/src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp index d5a03ba42d..63454dcc5f 100644 --- a/src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp +++ b/src/smpi/colls/reduce/reduce-arrival-pattern-aware.cpp @@ -19,7 +19,7 @@ int reduce_arrival_pattern_aware_segment_size_in_byte = 8192; namespace simgrid{ namespace smpi{ /* Non-topology-specific pipelined linear-reduce function */ -int Coll_reduce_arrival_pattern_aware::reduce(void *buf, void *rbuf, +int Coll_reduce_arrival_pattern_aware::reduce(const void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, diff --git a/src/smpi/colls/reduce/reduce-binomial.cpp b/src/smpi/colls/reduce/reduce-binomial.cpp index 76dc6b6aa0..df3bd42087 100644 --- a/src/smpi/colls/reduce/reduce-binomial.cpp +++ b/src/smpi/colls/reduce/reduce-binomial.cpp @@ -10,7 +10,7 @@ //#include namespace simgrid{ namespace smpi{ -int Coll_reduce_binomial::reduce(void *sendbuf, void *recvbuf, int count, +int Coll_reduce_binomial::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) { diff --git a/src/smpi/colls/reduce/reduce-flat-tree.cpp b/src/smpi/colls/reduce/reduce-flat-tree.cpp index 46b0496769..ef3ae9c8cf 100644 --- a/src/smpi/colls/reduce/reduce-flat-tree.cpp +++ b/src/smpi/colls/reduce/reduce-flat-tree.cpp @@ -9,7 +9,7 @@ namespace simgrid{ namespace smpi{ int -Coll_reduce_flat_tree::reduce(void *sbuf, void *rbuf, int count, +Coll_reduce_flat_tree::reduce(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, int root, MPI_Comm comm) { @@ -18,7 +18,7 @@ Coll_reduce_flat_tree::reduce(void *sbuf, void *rbuf, int count, int rank; MPI_Aint extent; char *origin = 0; - char *inbuf; + const char *inbuf; MPI_Status status; rank = comm->rank(); @@ -50,7 +50,7 @@ Coll_reduce_flat_tree::reduce(void *sbuf, void *rbuf, int count, for (i = size - 2; i >= 0; --i) { if (rank == i) - inbuf = static_cast(sbuf); + inbuf = static_cast(sbuf); else { Request::recv(origin, count, dtype, i, tag, comm, &status); inbuf = origin; diff --git a/src/smpi/colls/reduce/reduce-mvapich-knomial.cpp b/src/smpi/colls/reduce/reduce-mvapich-knomial.cpp index 13454c234d..25b6757a22 100644 --- a/src/smpi/colls/reduce/reduce-mvapich-knomial.cpp +++ b/src/smpi/colls/reduce/reduce-mvapich-knomial.cpp @@ -119,7 +119,7 @@ static int MPIR_Reduce_knomial_trace(int root, int reduce_knomial_factor, namespace simgrid{ namespace smpi{ int Coll_reduce_mvapich2_knomial::reduce ( - void *sendbuf, + const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, diff --git a/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp b/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp index a10160df10..e24faf618f 100644 --- a/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp +++ b/src/smpi/colls/reduce/reduce-mvapich-two-level.cpp @@ -50,7 +50,7 @@ #define MPIR_Reduce_redscat_gather_MV2 Coll_reduce_scatter_gather::reduce #define MPIR_Reduce_shmem_MV2 Coll_reduce_ompi_basic_linear::reduce -extern int (*MV2_Reduce_function)( void *sendbuf, +extern int (*MV2_Reduce_function)( const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, @@ -58,7 +58,7 @@ extern int (*MV2_Reduce_function)( void *sendbuf, int root, MPI_Comm comm_ptr); -extern int (*MV2_Reduce_intra_function)( void *sendbuf, +extern int (*MV2_Reduce_intra_function)( const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, @@ -68,14 +68,14 @@ extern int (*MV2_Reduce_intra_function)( void *sendbuf, /*Fn pointers for collectives */ -static int (*reduce_fn)(void *sendbuf, +static int (*reduce_fn)(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm); namespace simgrid{ namespace smpi{ -int Coll_reduce_mvapich2_two_level::reduce( void *sendbuf, +int Coll_reduce_mvapich2_two_level::reduce( const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, diff --git a/src/smpi/colls/reduce/reduce-ompi.cpp b/src/smpi/colls/reduce/reduce-ompi.cpp index d6f2a85335..ad1193488c 100644 --- a/src/smpi/colls/reduce/reduce-ompi.cpp +++ b/src/smpi/colls/reduce/reduce-ompi.cpp @@ -25,7 +25,7 @@ namespace simgrid{ namespace smpi{ -int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int original_count, +int smpi_coll_tuned_ompi_reduce_generic(const void* sendbuf, void* recvbuf, int original_count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, ompi_coll_tree_t* tree, int count_by_segment, @@ -41,7 +41,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi * for the first block: thus we must copy sendbuf to accumbuf on intermediate * to keep the optimized loop happy. */ -int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int original_count, +int smpi_coll_tuned_ompi_reduce_generic(const void* sendbuf, void* recvbuf, int original_count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, ompi_coll_tree_t* tree, int count_by_segment, @@ -323,7 +323,7 @@ int smpi_coll_tuned_ompi_reduce_generic( void* sendbuf, void* recvbuf, int origi */ -int Coll_reduce_ompi_chain::reduce( void *sendbuf, void *recvbuf, int count, +int Coll_reduce_ompi_chain::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm @@ -351,7 +351,7 @@ int Coll_reduce_ompi_chain::reduce( void *sendbuf, void *recvbuf, int count, } -int Coll_reduce_ompi_pipeline::reduce( void *sendbuf, void *recvbuf, +int Coll_reduce_ompi_pipeline::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm ) @@ -395,7 +395,7 @@ int Coll_reduce_ompi_pipeline::reduce( void *sendbuf, void *recvbuf, segcount, 0); } -int Coll_reduce_ompi_binary::reduce( void *sendbuf, void *recvbuf, +int Coll_reduce_ompi_binary::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) @@ -425,7 +425,7 @@ int Coll_reduce_ompi_binary::reduce( void *sendbuf, void *recvbuf, segcount, 0); } -int Coll_reduce_ompi_binomial::reduce( void *sendbuf, void *recvbuf, +int Coll_reduce_ompi_binomial::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) @@ -472,7 +472,7 @@ int Coll_reduce_ompi_binomial::reduce( void *sendbuf, void *recvbuf, * Acecpts: same as MPI_Reduce() * Returns: MPI_SUCCESS or error code */ -int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf, +int Coll_reduce_ompi_in_order_binary::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, @@ -504,7 +504,7 @@ int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf, operations for non-commutative ops. */ io_root = size - 1; - use_this_sendbuf = sendbuf; + use_this_sendbuf = const_cast(sendbuf); use_this_recvbuf = recvbuf; if (io_root != root) { ptrdiff_t text, ext; @@ -584,7 +584,7 @@ int Coll_reduce_ompi_in_order_binary::reduce( void *sendbuf, void *recvbuf, */ int -Coll_reduce_ompi_basic_linear::reduce(void *sbuf, void *rbuf, int count, +Coll_reduce_ompi_basic_linear::reduce(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, int root, diff --git a/src/smpi/colls/reduce/reduce-rab.cpp b/src/smpi/colls/reduce/reduce-rab.cpp index 5b2f4b20fb..584ffd8823 100644 --- a/src/smpi/colls/reduce/reduce-rab.cpp +++ b/src/smpi/colls/reduce/reduce-rab.cpp @@ -517,7 +517,7 @@ static void MPI_I_do_op(void* b1, void* b2, void* rslt, int cnt, REDUCE_LIMITS namespace simgrid{ namespace smpi{ -static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype mpi_datatype, MPI_Op mpi_op, int root, MPI_Comm comm, int is_all) +static int MPI_I_anyReduce(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype mpi_datatype, MPI_Op mpi_op, int root, MPI_Comm comm, int is_all) { char *scr1buf, *scr2buf, *scr3buf, *xxx, *sendbuf, *recvbuf; int myrank, size, x_base, x_size, computed, idx; @@ -949,12 +949,12 @@ static int MPI_I_anyReduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype #endif /*REDUCE_LIMITS*/ -int Coll_reduce_rab::reduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) +int Coll_reduce_rab::reduce(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) { return( MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, root, comm, 0) ); } -int Coll_allreduce_rab::allreduce(void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int Coll_allreduce_rab::allreduce(const void* Sendbuf, void* Recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { return( MPI_I_anyReduce(Sendbuf, Recvbuf, count, datatype, op, -1, comm, 1) ); } diff --git a/src/smpi/colls/reduce/reduce-scatter-gather.cpp b/src/smpi/colls/reduce/reduce-scatter-gather.cpp index 196fa207e5..5bfa4edff5 100644 --- a/src/smpi/colls/reduce/reduce-scatter-gather.cpp +++ b/src/smpi/colls/reduce/reduce-scatter-gather.cpp @@ -12,7 +12,7 @@ */ namespace simgrid{ namespace smpi{ -int Coll_reduce_scatter_gather::reduce(void *sendbuf, void *recvbuf, +int Coll_reduce_scatter_gather::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) { diff --git a/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp b/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp index 51348082d1..a3a1c795c6 100644 --- a/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp +++ b/src/smpi/colls/reduce_scatter/reduce_scatter-mpich.cpp @@ -24,7 +24,7 @@ static inline int MPIU_Mirror_permutation(unsigned int x, int bits) namespace simgrid{ namespace smpi{ -int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf, int recvcounts[], +int Coll_reduce_scatter_mpich_pair::reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { int rank, comm_size, i; @@ -93,11 +93,11 @@ int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf, if (is_commutative || (src < rank)) { if (sendbuf != MPI_IN_PLACE) { if (op != MPI_OP_NULL) - op->apply(tmp_recvbuf, recvbuf, &recvcounts[rank], datatype); + op->apply(tmp_recvbuf, recvbuf, &((const_cast(recvcounts))[rank]), datatype); } else { if (op != MPI_OP_NULL) - op->apply(tmp_recvbuf, ((char*)recvbuf + disps[rank] * extent), &recvcounts[rank], datatype); + op->apply(tmp_recvbuf, ((char*)recvbuf + disps[rank] * extent), &((const_cast(recvcounts))[rank]), datatype); /* we can't store the result at the beginning of recvbuf right here because there is useful data there that other process/processes need. at the @@ -108,7 +108,7 @@ int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf, else { if (sendbuf != MPI_IN_PLACE) { if (op != MPI_OP_NULL) - op->apply(recvbuf, tmp_recvbuf, &recvcounts[rank], datatype); + op->apply(recvbuf, tmp_recvbuf, &((const_cast(recvcounts))[rank]), datatype); /* copy result back into recvbuf */ mpi_errno = Datatype::copy(tmp_recvbuf, recvcounts[rank], datatype, recvbuf, recvcounts[rank], datatype); @@ -117,7 +117,7 @@ int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf, } else { if (op != MPI_OP_NULL) - op->apply(((char*)recvbuf + disps[rank] * extent), tmp_recvbuf, &recvcounts[rank], datatype); + op->apply(((char*)recvbuf + disps[rank] * extent), tmp_recvbuf, &((const_cast(recvcounts))[rank]), datatype); /* copy result back into recvbuf */ mpi_errno = Datatype::copy(tmp_recvbuf, recvcounts[rank], datatype, ((char*)recvbuf + disps[rank] * extent), recvcounts[rank], datatype); @@ -145,7 +145,7 @@ int Coll_reduce_scatter_mpich_pair::reduce_scatter(void *sendbuf, void *recvbuf, } -int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(void *sendbuf, void *recvbuf, int recvcounts[], +int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { int mpi_errno = MPI_SUCCESS; @@ -262,7 +262,7 @@ int Coll_reduce_scatter_mpich_noncomm::reduce_scatter(void *sendbuf, void *recvb -int Coll_reduce_scatter_mpich_rdb::reduce_scatter(void *sendbuf, void *recvbuf, int recvcounts[], +int Coll_reduce_scatter_mpich_rdb::reduce_scatter(const void *sendbuf, void *recvbuf, const int recvcounts[], MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { int rank, comm_size, i; diff --git a/src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp b/src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp index 850fe90151..3a7eb3715b 100644 --- a/src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp +++ b/src/smpi/colls/reduce_scatter/reduce_scatter-ompi.cpp @@ -44,9 +44,9 @@ namespace simgrid{ namespace smpi{ int -Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf, +Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(const void *sbuf, void *rbuf, - int *rcounts, + const int *rcounts, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm @@ -362,7 +362,7 @@ Coll_reduce_scatter_ompi_basic_recursivehalving::reduce_scatter(void *sbuf, * */ int -Coll_reduce_scatter_ompi_ring::reduce_scatter(void *sbuf, void *rbuf, int *rcounts, +Coll_reduce_scatter_ompi_ring::reduce_scatter(const void *sbuf, void *rbuf, const int *rcounts, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm @@ -483,7 +483,7 @@ Coll_reduce_scatter_ompi_ring::reduce_scatter(void *sbuf, void *rbuf, int *rcoun rbuf[prevblock] = inbuf[inbi ^ 0x1] (op) rbuf[prevblock] */ tmprecv = accumbuf + (ptrdiff_t)displs[prevblock] * extent; - if(op!=MPI_OP_NULL) op->apply( inbuf[inbi ^ 0x1], tmprecv, &(rcounts[prevblock]), dtype); + if(op!=MPI_OP_NULL) op->apply( inbuf[inbi ^ 0x1], tmprecv, &((const_cast(rcounts))[prevblock]), dtype); /* send previous block to send_to */ Request::send(tmprecv, rcounts[prevblock], dtype, send_to, @@ -497,7 +497,7 @@ Coll_reduce_scatter_ompi_ring::reduce_scatter(void *sbuf, void *rbuf, int *rcoun /* Apply operation on the last block (my block) rbuf[rank] = inbuf[inbi] (op) rbuf[rank] */ tmprecv = accumbuf + (ptrdiff_t)displs[rank] * extent; - if(op!=MPI_OP_NULL) op->apply( inbuf[inbi], tmprecv, &(rcounts[rank]), dtype); + if(op!=MPI_OP_NULL) op->apply( inbuf[inbi], tmprecv, &((const_cast(rcounts))[rank]), dtype); /* Copy result from tmprecv to rbuf */ ret = Datatype::copy(tmprecv, rcounts[rank], dtype, (char*)rbuf, rcounts[rank], dtype); diff --git a/src/smpi/colls/scatter/scatter-mvapich-two-level.cpp b/src/smpi/colls/scatter/scatter-mvapich-two-level.cpp index 3cb8003f6b..c485a88601 100644 --- a/src/smpi/colls/scatter/scatter-mvapich-two-level.cpp +++ b/src/smpi/colls/scatter/scatter-mvapich-two-level.cpp @@ -39,14 +39,14 @@ #define MPIR_Scatter_MV2_Binomial Coll_scatter_ompi_binomial::scatter #define MPIR_Scatter_MV2_Direct Coll_scatter_ompi_basic_linear::scatter -extern int (*MV2_Scatter_intra_function) (void *sendbuf, int sendcount, MPI_Datatype sendtype, +extern int (*MV2_Scatter_intra_function) (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); namespace simgrid{ namespace smpi{ -int Coll_scatter_mvapich2_two_level_direct::scatter(void *sendbuf, +int Coll_scatter_mvapich2_two_level_direct::scatter(const void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, @@ -223,7 +223,7 @@ int Coll_scatter_mvapich2_two_level_direct::scatter(void *sendbuf, } -int Coll_scatter_mvapich2_two_level_binomial::scatter(void *sendbuf, +int Coll_scatter_mvapich2_two_level_binomial::scatter(const void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, diff --git a/src/smpi/colls/scatter/scatter-ompi.cpp b/src/smpi/colls/scatter/scatter-ompi.cpp index c4c41b069c..5163124a96 100644 --- a/src/smpi/colls/scatter/scatter-ompi.cpp +++ b/src/smpi/colls/scatter/scatter-ompi.cpp @@ -25,7 +25,7 @@ namespace simgrid{ namespace smpi{ -int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, +int Coll_scatter_ompi_binomial::scatter(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, int root, MPI_Comm comm) { int line = -1; @@ -191,7 +191,7 @@ int Coll_scatter_ompi_binomial::scatter(void* sbuf, int scount, MPI_Datatype sdt * Accepts: - same arguments as MPI_Scatter() * Returns: - MPI_SUCCESS or error code */ -int Coll_scatter_ompi_basic_linear::scatter(void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, +int Coll_scatter_ompi_basic_linear::scatter(const void* sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, int root, MPI_Comm comm) { int i, rank, size, err; diff --git a/src/smpi/colls/smpi_coll.cpp b/src/smpi/colls/smpi_coll.cpp index 4f16a569a0..ffb2dd4504 100644 --- a/src/smpi/colls/smpi_coll.cpp +++ b/src/smpi/colls/smpi_coll.cpp @@ -115,9 +115,9 @@ void Colls::set_collectives(){ } } -//Implementations of the single algorith collectives +//Implementations of the single algorithm collectives -int Colls::gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, +int Colls::gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm) { MPI_Request request; @@ -126,7 +126,7 @@ int Colls::gatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *re } -int Colls::scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, +int Colls::scatterv(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { MPI_Request request; @@ -135,7 +135,7 @@ int Colls::scatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype se } -int Colls::scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int Colls::scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { int system_tag = -888; MPI_Aint lb = 0; @@ -196,7 +196,7 @@ int Colls::scan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, return MPI_SUCCESS; } -int Colls::exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int Colls::exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { int system_tag = -888; MPI_Aint lb = 0; @@ -263,8 +263,8 @@ int Colls::exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype return MPI_SUCCESS; } -int Colls::alltoallw(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype* sendtypes, - void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm) +int Colls::alltoallw(const void *sendbuf, const int *sendcounts, const int *senddisps, const MPI_Datatype* sendtypes, + void *recvbuf, const int *recvcounts, const int *recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm) { MPI_Request request; Colls::ialltoallw(sendbuf, sendcounts, senddisps, sendtypes, recvbuf, recvcounts, recvdisps, recvtypes, comm, &request); diff --git a/src/smpi/colls/smpi_default_selector.cpp b/src/smpi/colls/smpi_default_selector.cpp index 69b2029f6c..8c5db82f05 100644 --- a/src/smpi/colls/smpi_default_selector.cpp +++ b/src/smpi/colls/smpi_default_selector.cpp @@ -22,7 +22,7 @@ int Coll_barrier_default::barrier(MPI_Comm comm) } -int Coll_gather_default::gather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +int Coll_gather_default::gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { MPI_Request request; @@ -30,7 +30,7 @@ int Coll_gather_default::gather(void *sendbuf, int sendcount, MPI_Datatype sendt return Request::wait(&request, MPI_STATUS_IGNORE); } -int Coll_reduce_scatter_default::reduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, +int Coll_reduce_scatter_default::reduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { int rank = comm->rank(); @@ -54,7 +54,7 @@ int Coll_reduce_scatter_default::reduce_scatter(void *sendbuf, void *recvbuf, in } -int Coll_allgather_default::allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +int Coll_allgather_default::allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,int recvcount, MPI_Datatype recvtype, MPI_Comm comm) { MPI_Request request; @@ -62,8 +62,8 @@ int Coll_allgather_default::allgather(void *sendbuf, int sendcount, MPI_Datatype return Request::wait(&request, MPI_STATUS_IGNORE); } -int Coll_allgatherv_default::allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, - int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm) +int Coll_allgatherv_default::allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, + const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm) { MPI_Request request; Colls::iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, &request); @@ -78,7 +78,7 @@ int Coll_allgatherv_default::allgatherv(void *sendbuf, int sendcount, MPI_Dataty return MPI_SUCCESS; } -int Coll_scatter_default::scatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, +int Coll_scatter_default::scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) { MPI_Request request; @@ -86,7 +86,7 @@ int Coll_scatter_default::scatter(void *sendbuf, int sendcount, MPI_Datatype sen return Request::wait(&request, MPI_STATUS_IGNORE); } -int Coll_reduce_default::reduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, +int Coll_reduce_default::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) { //non commutative case, use a working algo from openmpi @@ -98,7 +98,7 @@ int Coll_reduce_default::reduce(void *sendbuf, void *recvbuf, int count, MPI_Dat return Request::wait(&request, MPI_STATUS_IGNORE); } -int Coll_allreduce_default::allreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) +int Coll_allreduce_default::allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { //FIXME: have mpi_ireduce and iallreduce handle derived datatypes correctly if(datatype->flags() & DT_FLAG_DERIVED) @@ -110,13 +110,13 @@ int Coll_allreduce_default::allreduce(void *sendbuf, void *recvbuf, int count, M return ret; } -int Coll_alltoall_default::alltoall( void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, MPI_Comm comm) +int Coll_alltoall_default::alltoall(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, MPI_Comm comm) { return Coll_alltoall_ompi::alltoall(sbuf, scount, sdtype, rbuf, rcount, rdtype, comm); } -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) +int Coll_alltoallv_default::alltoallv(const void *sendbuf, const int *sendcounts, const int *senddisps, MPI_Datatype sendtype, + void *recvbuf, const int *recvcounts, const int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm) { MPI_Request request; Colls::ialltoallv(sendbuf, sendcounts, senddisps, sendtype, recvbuf, recvcounts, recvdisps, recvtype, comm, &request); diff --git a/src/smpi/colls/smpi_intel_mpi_selector.cpp b/src/smpi/colls/smpi_intel_mpi_selector.cpp index 516653316d..26bdbf4a21 100644 --- a/src/smpi/colls/smpi_intel_mpi_selector.cpp +++ b/src/smpi/colls/smpi_intel_mpi_selector.cpp @@ -50,7 +50,7 @@ MPI_Allreduce namespace simgrid{ namespace smpi{ -int (*intel_allreduce_functions_table[])(void *sendbuf, +int (*intel_allreduce_functions_table[])(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, @@ -634,7 +634,7 @@ intel_tuning_table_element intel_alltoall_table[] = } } }; -int (*intel_alltoall_functions_table[])(void *sbuf, int scount, +int (*intel_alltoall_functions_table[])(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -967,7 +967,7 @@ MPI_Reduce */ -int (*intel_reduce_functions_table[])(void *sendbuf, void *recvbuf, +int (*intel_reduce_functions_table[])(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm) ={ @@ -1055,8 +1055,8 @@ MPI_Reduce_scatter 5. Topology aware Reduce + Scatterv algorithm */ -static int intel_reduce_scatter_reduce_scatterv(void *sbuf, void *rbuf, - int *rcounts, +static int intel_reduce_scatter_reduce_scatterv(const void *sbuf, void *rbuf, + const int *rcounts, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) @@ -1065,8 +1065,8 @@ static int intel_reduce_scatter_reduce_scatterv(void *sbuf, void *rbuf, return MPI_SUCCESS; } -static int intel_reduce_scatter_recursivehalving(void *sbuf, void *rbuf, - int *rcounts, +static int intel_reduce_scatter_recursivehalving(const void *sbuf, void *rbuf, + const int *rcounts, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) @@ -1077,8 +1077,8 @@ static int intel_reduce_scatter_recursivehalving(void *sbuf, void *rbuf, return Coll_reduce_scatter_mvapich2::reduce_scatter(sbuf, rbuf, rcounts,dtype, op,comm); } -int (*intel_reduce_scatter_functions_table[])( void *sbuf, void *rbuf, - int *rcounts, +int (*intel_reduce_scatter_functions_table[])( const void *sbuf, void *rbuf, + const int *rcounts, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm @@ -1487,7 +1487,7 @@ MPI_Allgather */ -int (*intel_allgather_functions_table[])(void *sbuf, int scount, +int (*intel_allgather_functions_table[])(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -1656,10 +1656,10 @@ MPI_Allgatherv */ -int (*intel_allgatherv_functions_table[])(void *sbuf, int scount, +int (*intel_allgatherv_functions_table[])(const void *sbuf, int scount, MPI_Datatype sdtype, - void* rbuf, int *rcounts, - int *rdispls, + void* rbuf, const int *rcounts, + const int *rdispls, MPI_Datatype rdtype, MPI_Comm comm ) ={ @@ -1867,7 +1867,7 @@ MPI_Gather */ -int (*intel_gather_functions_table[])(void *sbuf, int scount, +int (*intel_gather_functions_table[])(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -1971,7 +1971,7 @@ MPI_Scatter */ -int (*intel_scatter_functions_table[])(void *sbuf, int scount, +int (*intel_scatter_functions_table[])(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -2145,9 +2145,9 @@ MPI_Alltoallv */ -int (*intel_alltoallv_functions_table[])(void *sbuf, int *scounts, int *sdisps, +int (*intel_alltoallv_functions_table[])(const void *sbuf, const int *scounts, const int *sdisps, MPI_Datatype sdtype, - void *rbuf, int *rcounts, int *rdisps, + void *rbuf, const int *rcounts, const int *rdisps, MPI_Datatype rdtype, MPI_Comm comm ) ={ diff --git a/src/smpi/colls/smpi_mpich_selector.cpp b/src/smpi/colls/smpi_mpich_selector.cpp index 6cf26f29f0..5e0dd828aa 100644 --- a/src/smpi/colls/smpi_mpich_selector.cpp +++ b/src/smpi/colls/smpi_mpich_selector.cpp @@ -58,7 +58,7 @@ */ namespace simgrid{ namespace smpi{ -int Coll_allreduce_mpich::allreduce(void *sbuf, void *rbuf, int count, +int Coll_allreduce_mpich::allreduce(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { size_t dsize, block_dsize; @@ -138,7 +138,7 @@ int Coll_allreduce_mpich::allreduce(void *sbuf, void *rbuf, int count, End Algorithm: MPI_Alltoall */ -int Coll_alltoall_mpich::alltoall( void *sbuf, int scount, +int Coll_alltoall_mpich::alltoall(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -187,9 +187,9 @@ int Coll_alltoall_mpich::alltoall( void *sbuf, int scount, comm); } -int Coll_alltoallv_mpich::alltoallv(void *sbuf, int *scounts, int *sdisps, +int Coll_alltoallv_mpich::alltoallv(const void *sbuf, const int *scounts, const int *sdisps, MPI_Datatype sdtype, - void *rbuf, int *rcounts, int *rdisps, + void *rbuf, const int *rcounts, const int *rdisps, MPI_Datatype rdtype, MPI_Comm comm ) @@ -353,7 +353,7 @@ int Coll_bcast_mpich::bcast(void *buff, int count, */ -int Coll_reduce_mpich::reduce( void *sendbuf, void *recvbuf, +int Coll_reduce_mpich::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm @@ -436,8 +436,8 @@ int Coll_reduce_mpich::reduce( void *sendbuf, void *recvbuf, */ -int Coll_reduce_scatter_mpich::reduce_scatter( void *sbuf, void *rbuf, - int *rcounts, +int Coll_reduce_scatter_mpich::reduce_scatter(const void *sbuf, void *rbuf, + const int *rcounts, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm @@ -532,7 +532,7 @@ int Coll_reduce_scatter_mpich::reduce_scatter( void *sbuf, void *rbuf, End Algorithm: MPI_Allgather */ -int Coll_allgather_mpich::allgather(void *sbuf, int scount, +int Coll_allgather_mpich::allgather(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -610,10 +610,10 @@ int Coll_allgather_mpich::allgather(void *sbuf, int scount, End Algorithm: MPI_Allgatherv */ -int Coll_allgatherv_mpich::allgatherv(void *sbuf, int scount, +int Coll_allgatherv_mpich::allgatherv(const void *sbuf, int scount, MPI_Datatype sdtype, - void* rbuf, int *rcounts, - int *rdispls, + void* rbuf, const int *rcounts, + const int *rdispls, MPI_Datatype rdtype, MPI_Comm comm ) @@ -668,7 +668,7 @@ int Coll_allgatherv_mpich::allgatherv(void *sbuf, int scount, End Algorithm: MPI_Gather */ -int Coll_gather_mpich::gather(void *sbuf, int scount, +int Coll_gather_mpich::gather(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -703,7 +703,7 @@ int Coll_gather_mpich::gather(void *sbuf, int scount, */ -int Coll_scatter_mpich::scatter(void *sbuf, int scount, +int Coll_scatter_mpich::scatter(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -719,7 +719,7 @@ int Coll_scatter_mpich::scatter(void *sbuf, int scount, rbuf, rcount, rdtype, root, comm); if(comm->rank()!=root){ - xbt_free(sbuf); + xbt_free(const_cast(sbuf)); } return ret; } diff --git a/src/smpi/colls/smpi_mvapich2_selector.cpp b/src/smpi/colls/smpi_mvapich2_selector.cpp index 549f5a959d..6812846699 100644 --- a/src/smpi/colls/smpi_mvapich2_selector.cpp +++ b/src/smpi/colls/smpi_mvapich2_selector.cpp @@ -14,7 +14,7 @@ namespace simgrid{ namespace smpi{ -int Coll_alltoall_mvapich2::alltoall( void *sendbuf, int sendcount, +int Coll_alltoall_mvapich2::alltoall( const void *sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, @@ -84,7 +84,7 @@ int Coll_alltoall_mvapich2::alltoall( void *sendbuf, int sendcount, return (mpi_errno); } -int Coll_allgather_mvapich2::allgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +int Coll_allgather_mvapich2::allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm) { @@ -185,7 +185,7 @@ int Coll_allgather_mvapich2::allgather(void *sendbuf, int sendcount, MPI_Datatyp return mpi_errno; } -int Coll_gather_mvapich2::gather(void *sendbuf, +int Coll_gather_mvapich2::gather(const void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, @@ -259,8 +259,8 @@ int Coll_gather_mvapich2::gather(void *sendbuf, return mpi_errno; } -int Coll_allgatherv_mvapich2::allgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, - void *recvbuf, int *recvcounts, int *displs, +int Coll_allgatherv_mvapich2::allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, + void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm ) { int mpi_errno = MPI_SUCCESS; @@ -321,7 +321,7 @@ int Coll_allgatherv_mvapich2::allgatherv(void *sendbuf, int sendcount, MPI_Datat -int Coll_allreduce_mvapich2::allreduce(void *sendbuf, +int Coll_allreduce_mvapich2::allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, @@ -440,9 +440,9 @@ int Coll_allreduce_mvapich2::allreduce(void *sendbuf, } -int Coll_alltoallv_mvapich2::alltoallv(void *sbuf, int *scounts, int *sdisps, +int Coll_alltoallv_mvapich2::alltoallv(const void *sbuf, const int *scounts, const int *sdisps, MPI_Datatype sdtype, - void *rbuf, int *rcounts, int *rdisps, + void *rbuf, const int *rcounts, const int *rdisps, MPI_Datatype rdtype, MPI_Comm comm ) @@ -662,7 +662,7 @@ int Coll_bcast_mvapich2::bcast(void *buffer, -int Coll_reduce_mvapich2::reduce( void *sendbuf, +int Coll_reduce_mvapich2::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, @@ -780,7 +780,7 @@ int Coll_reduce_mvapich2::reduce( void *sendbuf, } -int Coll_reduce_scatter_mvapich2::reduce_scatter(void *sendbuf, void *recvbuf, int *recvcnts, +int Coll_reduce_scatter_mvapich2::reduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcnts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { @@ -855,7 +855,7 @@ int Coll_reduce_scatter_mvapich2::reduce_scatter(void *sendbuf, void *recvbuf, i -int Coll_scatter_mvapich2::scatter(void *sendbuf, +int Coll_scatter_mvapich2::scatter(const void *sendbuf, int sendcnt, MPI_Datatype sendtype, void *recvbuf, diff --git a/src/smpi/colls/smpi_mvapich2_selector_stampede.hpp b/src/smpi/colls/smpi_mvapich2_selector_stampede.hpp index e6dfc43462..9762cf2cdd 100644 --- a/src/smpi/colls/smpi_mvapich2_selector_stampede.hpp +++ b/src/smpi/colls/smpi_mvapich2_selector_stampede.hpp @@ -21,7 +21,7 @@ XBT_PUBLIC void smpi_coll_cleanup_mvapich2(void); struct mv2_alltoall_tuning_element { int min; int max; - int (*MV2_pt_Alltoall_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + int (*MV2_pt_Alltoall_function)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm_ptr); }; @@ -32,7 +32,7 @@ struct mv2_alltoall_tuning_table { mv2_alltoall_tuning_element in_place_algo_table[MV2_MAX_NB_THRESHOLDS]; }; -int (*MV2_Alltoall_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, +int (*MV2_Alltoall_function)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm_ptr) = NULL; /* Indicates number of processes per node */ @@ -333,7 +333,7 @@ static void init_mv2_alltoall_tables_stampede() struct mv2_allgather_tuning_element { int min; int max; - int (*MV2_pt_Allgatherction)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, + int (*MV2_pt_Allgatherction)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm_ptr); }; @@ -344,7 +344,7 @@ struct mv2_allgather_tuning_table { mv2_allgather_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS]; }; -int (*MV2_Allgatherction)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, +int (*MV2_Allgatherction)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm); int* mv2_allgather_table_ppn_conf = NULL; @@ -352,7 +352,7 @@ int mv2_allgather_num_ppn_conf = 1; int* mv2_size_allgather_tuning_table = NULL; mv2_allgather_tuning_table** mv2_allgather_thresholds_table = NULL; -static int MPIR_Allgather_RD_Allgather_Comm_MV2(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, +static int MPIR_Allgather_RD_Allgather_Comm_MV2(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm_ptr) { return 0; @@ -562,7 +562,7 @@ static void init_mv2_allgather_tables_stampede() struct mv2_gather_tuning_element { int min; int max; - int (*MV2_pt_Gather_function)(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, + int (*MV2_pt_Gather_function)(const void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm_ptr); }; @@ -577,7 +577,7 @@ struct mv2_gather_tuning_table { int mv2_size_gather_tuning_table = 7; mv2_gather_tuning_table* mv2_gather_thresholds_table = NULL; -typedef int (*MV2_Gather_function_ptr)(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, +typedef int (*MV2_Gather_function_ptr)(const void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm); MV2_Gather_function_ptr MV2_Gather_inter_leader_function = NULL; @@ -652,8 +652,8 @@ static void init_mv2_gather_tables_stampede() struct mv2_allgatherv_tuning_element { int min; int max; - int (*MV2_pt_Allgatherv_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts, - int* displs, MPI_Datatype recvtype, MPI_Comm commg); + int (*MV2_pt_Allgatherv_function)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, + const int* displs, MPI_Datatype recvtype, MPI_Comm commg); }; struct mv2_allgatherv_tuning_table { @@ -662,8 +662,8 @@ struct mv2_allgatherv_tuning_table { mv2_allgatherv_tuning_element inter_leader[MV2_MAX_NB_THRESHOLDS]; }; -int (*MV2_Allgatherv_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts, - int* displs, MPI_Datatype recvtype, MPI_Comm comm); +int (*MV2_Allgatherv_function)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, + const int* displs, MPI_Datatype recvtype, MPI_Comm comm); int mv2_size_allgatherv_tuning_table = 0; mv2_allgatherv_tuning_table* mv2_allgatherv_thresholds_table = NULL; @@ -731,7 +731,7 @@ static void init_mv2_allgatherv_tables_stampede() struct mv2_allreduce_tuning_element { int min; int max; - int (*MV2_pt_Allreducection)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, + int (*MV2_pt_Allreducection)(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); }; @@ -745,35 +745,35 @@ struct mv2_allreduce_tuning_table { mv2_allreduce_tuning_element intra_node[MV2_MAX_NB_THRESHOLDS]; }; -int (*MV2_Allreducection)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, +int (*MV2_Allreducection)(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) = NULL; -int (*MV2_Allreduce_intra_function)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, +int (*MV2_Allreduce_intra_function)(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) = NULL; int mv2_size_allreduce_tuning_table = 0; mv2_allreduce_tuning_table* mv2_allreduce_thresholds_table = NULL; -static int MPIR_Allreduce_mcst_reduce_two_level_helper_MV2(void* sendbuf, void* recvbuf, int count, +static int MPIR_Allreduce_mcst_reduce_two_level_helper_MV2(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { return 0; } -static int MPIR_Allreduce_mcst_reduce_redscat_gather_MV2(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, +static int MPIR_Allreduce_mcst_reduce_redscat_gather_MV2(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { return 0; } -static int MPIR_Allreduce_reduce_p2p_MV2(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, +static int MPIR_Allreduce_reduce_p2p_MV2(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { simgrid::smpi::Colls::reduce(sendbuf, recvbuf, count, datatype, op, 0, comm); return MPI_SUCCESS; } -static int MPIR_Allreduce_reduce_shmem_MV2(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, +static int MPIR_Allreduce_reduce_shmem_MV2(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { simgrid::smpi::Colls::reduce(sendbuf, recvbuf, count, datatype, op, 0, comm); @@ -1149,7 +1149,7 @@ static void init_mv2_bcast_tables_stampede() struct mv2_reduce_tuning_element { int min; int max; - int (*MV2_pt_Reduce_function)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, + int (*MV2_pt_Reduce_function)(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm_ptr); }; @@ -1170,10 +1170,10 @@ mv2_reduce_tuning_table* mv2_reduce_thresholds_table = NULL; int mv2_reduce_intra_knomial_factor = -1; int mv2_reduce_inter_knomial_factor = -1; -int (*MV2_Reduce_function)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, +int (*MV2_Reduce_function)(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm_ptr) = NULL; -int (*MV2_Reduce_intra_function)(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, +int (*MV2_Reduce_intra_function)(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm_ptr) = NULL; #define MPIR_Reduce_inter_knomial_wrapper_MV2 simgrid::smpi::Coll_reduce_mvapich2_knomial::reduce @@ -1381,7 +1381,7 @@ static void init_mv2_reduce_tables_stampede() struct mv2_red_scat_tuning_element { int min; int max; - int (*MV2_pt_Red_scat_function)(void* sendbuf, void* recvbuf, int* recvcnts, MPI_Datatype datatype, MPI_Op op, + int (*MV2_pt_Red_scat_function)(const void* sendbuf, void* recvbuf, const int* recvcnts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm_ptr); }; @@ -1394,10 +1394,10 @@ struct mv2_red_scat_tuning_table { int mv2_size_red_scat_tuning_table = 0; mv2_red_scat_tuning_table* mv2_red_scat_thresholds_table = NULL; -int (*MV2_Red_scat_function)(void* sendbuf, void* recvbuf, int* recvcnts, MPI_Datatype datatype, MPI_Op op, +int (*MV2_Red_scat_function)(const void* sendbuf, void* recvbuf, const int* recvcnts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm_ptr); -static int MPIR_Reduce_Scatter_Basic_MV2(void* sendbuf, void* recvbuf, int* recvcnts, MPI_Datatype datatype, MPI_Op op, +static int MPIR_Reduce_Scatter_Basic_MV2(const void* sendbuf, void* recvbuf, const int* recvcnts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm) { simgrid::smpi::Coll_reduce_scatter_default::reduce_scatter(sendbuf, recvbuf, recvcnts, datatype, op, comm); @@ -1473,7 +1473,7 @@ static void init_mv2_reduce_scatter_tables_stampede() struct mv2_scatter_tuning_element { int min; int max; - int (*MV2_pt_Scatter_function)(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, + int (*MV2_pt_Scatter_function)(const void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm); }; @@ -1490,15 +1490,15 @@ int mv2_scatter_num_ppn_conf = 1; int* mv2_size_scatter_tuning_table = NULL; mv2_scatter_tuning_table** mv2_scatter_thresholds_table = NULL; -int (*MV2_Scatter_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, +int (*MV2_Scatter_function)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) = NULL; -int (*MV2_Scatter_intra_function)(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, +int (*MV2_Scatter_intra_function)(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm) = NULL; -int MPIR_Scatter_mcst_wrap_MV2(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, +int MPIR_Scatter_mcst_wrap_MV2(const void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm_ptr); -int MPIR_Scatter_mcst_wrap_MV2(void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, +int MPIR_Scatter_mcst_wrap_MV2(const void* sendbuf, int sendcnt, MPI_Datatype sendtype, void* recvbuf, int recvcnt, MPI_Datatype recvtype, int root, MPI_Comm comm_ptr) { return 0; diff --git a/src/smpi/colls/smpi_nbc_impl.cpp b/src/smpi/colls/smpi_nbc_impl.cpp index b8de308e12..4193b13fff 100644 --- a/src/smpi/colls/smpi_nbc_impl.cpp +++ b/src/smpi/colls/smpi_nbc_impl.cpp @@ -69,7 +69,7 @@ int Colls::ibcast(void *buf, int count, MPI_Datatype datatype, int root, MPI_Com return MPI_SUCCESS; } -int Colls::iallgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +int Colls::iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf,int recvcount, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request) { @@ -103,7 +103,7 @@ int Colls::iallgather(void *sendbuf, int sendcount, MPI_Datatype sendtype, return MPI_SUCCESS; } -int Colls::iscatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, +int Colls::iscatter(const 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; @@ -123,7 +123,7 @@ int Colls::iscatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, sendtype->extent(&lb, &sendext); // Local copy from root if(recvbuf!=MPI_IN_PLACE){ - Datatype::copy(static_cast(sendbuf) + root * sendcount * sendext, + Datatype::copy(static_cast(sendbuf) + root * sendcount * sendext, sendcount, sendtype, recvbuf, recvcount, recvtype); } // Send buffers to receivers @@ -131,7 +131,7 @@ int Colls::iscatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, int index = 0; for(int dst = 0; dst < size; dst++) { if(dst != root) { - requests[index] = Request::isend_init(static_cast(sendbuf) + dst * sendcount * sendext, sendcount, sendtype, + requests[index] = Request::isend_init(static_cast(sendbuf) + dst * sendcount * sendext, sendcount, sendtype, dst, system_tag, comm); index++; } @@ -143,8 +143,8 @@ int Colls::iscatter(void *sendbuf, int sendcount, MPI_Datatype sendtype, 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) +int Colls::iallgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, + const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request* request) { const int system_tag = COLL_TAG_ALLGATHERV; MPI_Aint lb = 0; @@ -177,7 +177,7 @@ int Colls::iallgatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void 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 Colls::ialltoall( const 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; MPI_Aint lb = 0; MPI_Aint sendext = 0; @@ -191,7 +191,7 @@ int Colls::ialltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, void* sendtype->extent(&lb, &sendext); recvtype->extent(&lb, &recvext); /* simple optimization */ - int err = Datatype::copy(static_cast(sendbuf) + rank * sendcount * sendext, sendcount, sendtype, + int err = Datatype::copy(static_cast(sendbuf) + rank * sendcount * sendext, sendcount, sendtype, static_cast(recvbuf) + rank * recvcount * recvext, recvcount, recvtype); if (err == MPI_SUCCESS && size > 1) { /* Initiate all send/recv to/from others. */ @@ -209,7 +209,7 @@ int Colls::ialltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, void* * TODO: check the previous assertion */ for (int i = (rank + size - 1) % size; i != rank; i = (i + size - 1) % size) { - requests[count] = Request::isend_init(static_cast(sendbuf) + i * sendcount * sendext, sendcount, + requests[count] = Request::isend_init(static_cast(sendbuf) + i * sendcount * sendext, sendcount, sendtype, i, system_tag, comm); count++; } @@ -220,8 +220,8 @@ int Colls::ialltoall( void *sendbuf, int sendcount, MPI_Datatype sendtype, void* 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){ +int Colls::ialltoallv(const void *sendbuf, const int *sendcounts, const int *senddisps, MPI_Datatype sendtype, + void *recvbuf, const int *recvcounts, const 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; @@ -235,7 +235,7 @@ int Colls::ialltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty sendtype->extent(&lb, &sendext); recvtype->extent(&lb, &recvext); /* Local copy from self */ - int err = Datatype::copy(static_cast(sendbuf) + senddisps[rank] * sendext, sendcounts[rank], sendtype, + int err = Datatype::copy(static_cast(sendbuf) + senddisps[rank] * sendext, sendcounts[rank], sendtype, static_cast(recvbuf) + recvdisps[rank] * recvext, recvcounts[rank], recvtype); if (err == MPI_SUCCESS && size > 1) { /* Initiate all send/recv to/from others. */ @@ -254,7 +254,7 @@ int Colls::ialltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty /* Now create all sends */ for (int i = 0; i < size; ++i) { if (i != rank) { - requests[count] = Request::isend_init(static_cast(sendbuf) + senddisps[i] * sendext, + requests[count] = Request::isend_init(static_cast(sendbuf) + senddisps[i] * sendext, sendcounts[i], sendtype, i, system_tag, comm); count++; }else{ @@ -268,8 +268,8 @@ int Colls::ialltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty return err; } -int Colls::ialltoallw(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype* sendtypes, - void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request){ +int Colls::ialltoallw(const void *sendbuf, const int *sendcounts, const int *senddisps, const MPI_Datatype* sendtypes, + void *recvbuf, const int *recvcounts, const int *recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request){ const int system_tag = COLL_TAG_ALLTOALLV; /* Initialize. */ @@ -278,7 +278,7 @@ int Colls::ialltoallw(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty (*request) = new Request( nullptr, 0, MPI_BYTE, rank,rank, system_tag, comm, MPI_REQ_PERSISTENT); /* Local copy from self */ - int err = (sendcounts[rank]>0 && recvcounts[rank]) ? Datatype::copy(static_cast(sendbuf) + senddisps[rank], sendcounts[rank], sendtypes[rank], + int err = (sendcounts[rank]>0 && recvcounts[rank]) ? Datatype::copy(static_cast(sendbuf) + senddisps[rank], sendcounts[rank], sendtypes[rank], static_cast(recvbuf) + recvdisps[rank], recvcounts[rank], recvtypes[rank]): MPI_SUCCESS; if (err == MPI_SUCCESS && size > 1) { /* Initiate all send/recv to/from others. */ @@ -297,7 +297,7 @@ int Colls::ialltoallw(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty /* Now create all sends */ for (int i = 0; i < size; ++i) { if (i != rank) { - requests[count] = Request::isend_init(static_cast(sendbuf) + senddisps[i] , + requests[count] = Request::isend_init(static_cast(sendbuf) + senddisps[i] , sendcounts[i], sendtypes[i], i, system_tag, comm); count++; }else{ @@ -311,7 +311,7 @@ int Colls::ialltoallw(void *sendbuf, int *sendcounts, int *senddisps, MPI_Dataty return err; } -int Colls::igather(void *sendbuf, int sendcount, MPI_Datatype sendtype, +int Colls::igather(const 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; @@ -349,7 +349,7 @@ int Colls::igather(void *sendbuf, int sendcount, MPI_Datatype sendtype, return MPI_SUCCESS; } -int Colls::igatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int *recvcounts, int *displs, +int Colls::igatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request) { int system_tag = COLL_TAG_GATHERV; @@ -386,7 +386,7 @@ int Colls::igatherv(void *sendbuf, int sendcount, MPI_Datatype sendtype, void *r } return MPI_SUCCESS; } -int Colls::iscatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, +int Colls::iscatterv(const void *sendbuf, const int *sendcounts, const 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; @@ -406,7 +406,7 @@ int Colls::iscatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype s sendtype->extent(&lb, &sendext); // Local copy from root if(recvbuf!=MPI_IN_PLACE){ - Datatype::copy(static_cast(sendbuf) + displs[root] * sendext, sendcounts[root], + Datatype::copy(static_cast(sendbuf) + displs[root] * sendext, sendcounts[root], sendtype, recvbuf, recvcount, recvtype); } // Send buffers to receivers @@ -414,7 +414,7 @@ int Colls::iscatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype s int index = 0; for (int dst = 0; dst < size; dst++) { if (dst != root) { - requests[index] = Request::isend_init(static_cast(sendbuf) + displs[dst] * sendext, sendcounts[dst], + requests[index] = Request::isend_init(static_cast(sendbuf) + displs[dst] * sendext, sendcounts[dst], sendtype, dst, system_tag, comm); index++; } @@ -426,14 +426,14 @@ int Colls::iscatterv(void *sendbuf, int *sendcounts, int *displs, MPI_Datatype s return MPI_SUCCESS; } -int Colls::ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, +int Colls::ireduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, MPI_Request* request) { const int system_tag = COLL_TAG_REDUCE; MPI_Aint lb = 0; MPI_Aint dataext = 0; - char* sendtmpbuf = static_cast(sendbuf); + void* sendtmpbuf = const_cast(sendbuf); int rank = comm->rank(); int size = comm->size(); @@ -442,7 +442,7 @@ int Colls::ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp return MPI_ERR_COMM; if( sendbuf == MPI_IN_PLACE ) { - sendtmpbuf = static_cast(smpi_get_tmp_sendbuffer(count*datatype->get_extent())); + sendtmpbuf = static_cast(smpi_get_tmp_sendbuffer(count*datatype->get_extent())); Datatype::copy(recvbuf, count, datatype,sendtmpbuf, count, datatype); } @@ -484,7 +484,7 @@ int Colls::ireduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp return MPI_SUCCESS; } -int Colls::iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, +int Colls::iallreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request) { @@ -517,7 +517,7 @@ int Colls::iallreduce(void *sendbuf, void *recvbuf, int count, MPI_Datatype data return MPI_SUCCESS; } -int Colls::iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request) +int Colls::iscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request) { int system_tag = -888; MPI_Aint lb = 0; @@ -549,7 +549,7 @@ int Colls::iscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, return MPI_SUCCESS; } -int Colls::iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request) +int Colls::iexscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request) { int system_tag = -888; MPI_Aint lb = 0; @@ -579,7 +579,7 @@ int Colls::iexscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatyp return MPI_SUCCESS; } -int Colls::ireduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, +int Colls::ireduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request* request){ //Version where each process performs the reduce for its own part. Alltoall pattern for comms. const int system_tag = COLL_TAG_REDUCE_SCATTER; @@ -599,14 +599,14 @@ int Colls::ireduce_scatter(void *sendbuf, void *recvbuf, int *recvcounts, MPI_Da int recvdisp=0; for (int other = 0; other < size; other++) { if(other != rank) { - requests[index] = Request::isend_init(static_cast(sendbuf) + recvdisp * dataext, recvcounts[other], datatype, other, system_tag,comm); + requests[index] = Request::isend_init(static_cast(sendbuf) + recvdisp * dataext, recvcounts[other], datatype, other, system_tag,comm); XBT_VERB("sending with recvdisp %d", recvdisp); index++; requests[index] = Request::irecv_init(smpi_get_tmp_sendbuffer(count * dataext), count, datatype, other, system_tag, comm); index++; }else{ - Datatype::copy(static_cast(sendbuf) + recvdisp * dataext, count, datatype, recvbuf, count, datatype); + Datatype::copy(static_cast(sendbuf) + recvdisp * dataext, count, datatype, recvbuf, count, datatype); } recvdisp+=recvcounts[other]; } diff --git a/src/smpi/colls/smpi_openmpi_selector.cpp b/src/smpi/colls/smpi_openmpi_selector.cpp index 1464d17143..3d8134d822 100644 --- a/src/smpi/colls/smpi_openmpi_selector.cpp +++ b/src/smpi/colls/smpi_openmpi_selector.cpp @@ -11,7 +11,7 @@ namespace simgrid{ namespace smpi{ -int Coll_allreduce_ompi::allreduce(void *sbuf, void *rbuf, int count, +int Coll_allreduce_ompi::allreduce(const void *sbuf, void *rbuf, int count, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) { size_t dsize, block_dsize; @@ -55,7 +55,7 @@ int Coll_allreduce_ompi::allreduce(void *sbuf, void *rbuf, int count, -int Coll_alltoall_ompi::alltoall( void *sbuf, int scount, +int Coll_alltoall_ompi::alltoall(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -88,9 +88,9 @@ int Coll_alltoall_ompi::alltoall( void *sbuf, int scount, comm); } -int Coll_alltoallv_ompi::alltoallv(void *sbuf, int *scounts, int *sdisps, +int Coll_alltoallv_ompi::alltoallv(const void *sbuf, const int *scounts, const int *sdisps, MPI_Datatype sdtype, - void *rbuf, int *rcounts, int *rdisps, + void *rbuf, const int *rcounts, const int *rdisps, MPI_Datatype rdtype, MPI_Comm comm ) @@ -224,7 +224,7 @@ int Coll_bcast_ompi::bcast(void *buff, int count, #endif /* 0 */ } -int Coll_reduce_ompi::reduce( void *sendbuf, void *recvbuf, +int Coll_reduce_ompi::reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm @@ -327,8 +327,8 @@ int Coll_reduce_ompi::reduce( void *sendbuf, void *recvbuf, #endif /* 0 */ } -int Coll_reduce_scatter_ompi::reduce_scatter( void *sbuf, void *rbuf, - int *rcounts, +int Coll_reduce_scatter_ompi::reduce_scatter(const void *sbuf, void *rbuf, + const int *rcounts, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm @@ -381,7 +381,7 @@ int Coll_reduce_scatter_ompi::reduce_scatter( void *sbuf, void *rbuf, } -int Coll_allgather_ompi::allgather(void *sbuf, int scount, +int Coll_allgather_ompi::allgather(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -461,10 +461,10 @@ int Coll_allgather_ompi::allgather(void *sbuf, int scount, #endif /* defined(USE_MPICH2_DECISION) */ } -int Coll_allgatherv_ompi::allgatherv(void *sbuf, int scount, +int Coll_allgatherv_ompi::allgatherv(const void *sbuf, int scount, MPI_Datatype sdtype, - void* rbuf, int *rcounts, - int *rdispls, + void* rbuf, const int *rcounts, + const int *rdispls, MPI_Datatype rdtype, MPI_Comm comm ) @@ -508,7 +508,7 @@ int Coll_allgatherv_ompi::allgatherv(void *sbuf, int scount, } } -int Coll_gather_ompi::gather(void *sbuf, int scount, +int Coll_gather_ompi::gather(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -568,7 +568,7 @@ int Coll_gather_ompi::gather(void *sbuf, int scount, } -int Coll_scatter_ompi::scatter(void *sbuf, int scount, +int Coll_scatter_ompi::scatter(const void *sbuf, int scount, MPI_Datatype sdtype, void* rbuf, int rcount, MPI_Datatype rdtype, @@ -604,7 +604,7 @@ int Coll_scatter_ompi::scatter(void *sbuf, int scount, rbuf, rcount, rdtype, root, comm); if(rank!=root){ - xbt_free(sbuf); + xbt_free(const_cast(sbuf)); } return ret; } diff --git a/src/smpi/include/smpi_coll.hpp b/src/smpi/include/smpi_coll.hpp index e4c5df3ac5..3e73854afa 100644 --- a/src/smpi/include/smpi_coll.hpp +++ b/src/smpi/include/smpi_coll.hpp @@ -41,39 +41,39 @@ static ret cat (COLL_UNPAREN args); \ #define COLL_NOTHING(...) #define COLL_GATHER_SIG gather, int, \ - (void *send_buff, int send_count, MPI_Datatype send_type, \ + (const void *send_buff, int send_count, MPI_Datatype send_type, \ void *recv_buff, int recv_count, MPI_Datatype recv_type, \ int root, MPI_Comm comm) #define COLL_ALLGATHER_SIG allgather, int, \ - (void *send_buff, int send_count, MPI_Datatype send_type, \ + (const void *send_buff, int send_count, MPI_Datatype send_type, \ void *recv_buff, int recv_count, MPI_Datatype recv_type, \ MPI_Comm comm) #define COLL_ALLGATHERV_SIG allgatherv, int, \ - (void *send_buff, int send_count, MPI_Datatype send_type, \ - void *recv_buff, int *recv_count, int *recv_disps, \ + (const void *send_buff, int send_count, MPI_Datatype send_type, \ + void *recv_buff, const int *recv_count, const int *recv_disps, \ MPI_Datatype recv_type, MPI_Comm comm) #define COLL_ALLTOALL_SIG alltoall, int, \ - (void *send_buff, int send_count, MPI_Datatype send_type, \ + (const void *send_buff, int send_count, MPI_Datatype send_type, \ void *recv_buff, int recv_count, MPI_Datatype recv_type, \ MPI_Comm comm) #define COLL_ALLTOALLV_SIG alltoallv, int, \ - (void *send_buff, int *send_counts, int *send_disps, MPI_Datatype send_type, \ - void *recv_buff, int *recv_counts, int *recv_disps, MPI_Datatype recv_type, \ + (const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, \ + void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, \ MPI_Comm comm) #define COLL_BCAST_SIG bcast, int, \ (void *buf, int count, MPI_Datatype datatype, \ int root, MPI_Comm comm) #define COLL_REDUCE_SIG reduce, int, \ - (void *buf, void *rbuf, int count, MPI_Datatype datatype, \ + (const void *buf, void *rbuf, int count, MPI_Datatype datatype, \ MPI_Op op, int root, MPI_Comm comm) #define COLL_ALLREDUCE_SIG allreduce, int, \ - (void *sbuf, void *rbuf, int rcount, \ + (const void *sbuf, void *rbuf, int rcount, \ MPI_Datatype dtype, MPI_Op op, MPI_Comm comm) #define COLL_REDUCE_SCATTER_SIG reduce_scatter, int, \ - (void *sbuf, void *rbuf, int *rcounts,\ + (const void *sbuf, void *rbuf, const int *rcounts,\ MPI_Datatype dtype,MPI_Op op,MPI_Comm comm) #define COLL_SCATTER_SIG scatter, int, \ - (void *sendbuf, int sendcount, MPI_Datatype sendtype,\ + (const void *sendbuf, int sendcount, MPI_Datatype sendtype,\ void *recvbuf, int recvcount, MPI_Datatype recvtype,\ int root, MPI_Comm comm) #define COLL_BARRIER_SIG barrier, int, \ @@ -109,52 +109,52 @@ public: COLL_APPLY(COLL_DEFS, COLL_ALLTOALLV_SIG, ""); // These fairly unused collectives only have one implementation in SMPI - static int gatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int* recvcounts, int* displs, + static int gatherv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm); - static int scatterv(void* sendbuf, int* sendcounts, int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, + static int scatterv(const void* sendbuf, const int* sendcounts, const int* displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm); - static int scan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); - static int exscan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); + static int scan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); + static int exscan(const void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm); static int alltoallw - (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype* sendtypes, void* recvbuf, int* recvcounts, - int* recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm); + (const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts, + const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm); //async collectives 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, + static int igather (const 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, + static int igatherv (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + const int* recvcounts, const int* displs, MPI_Datatype recvtype, int root, MPI_Comm comm, MPI_Request *request); + static int iallgather (const 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, + static int iallgatherv (const void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, + const int* recvcounts, const int* displs, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); + static int iscatter (const 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, + static int iscatterv (const void* sendbuf, const int* sendcounts, const 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); + (const 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); + (const 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); + (const 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); + (const 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); + (const void* sendbuf, void* recvbuf, const 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, + (const void* sendbuf, void* recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, MPI_Request *request); + static int ialltoall (const 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); + (const void* sendbuf, const int* sendcounts, const int* senddisps, MPI_Datatype sendtype, void* recvbuf, const int* recvcounts, + const int* recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request); static int ialltoallw - (void* sendbuf, int* sendcounts, int* senddisps, MPI_Datatype* sendtypes, void* recvbuf, int* recvcounts, - int* recvdisps, MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request); + (const void* sendbuf, const int* sendcounts, const int* senddisps, const MPI_Datatype* sendtypes, void* recvbuf, const int* recvcounts, + const int* recvdisps, const MPI_Datatype* recvtypes, MPI_Comm comm, MPI_Request *request); static void (*smpi_coll_cleanup_callback)(); -- 2.20.1