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));
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))
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))
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))
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))
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)
return MPI_ERR_ARG;
smpi_bench_end();
- char* sendtmpbuf = static_cast<char*>(sendbuf);
+ const char* sendtmpbuf = static_cast<const char*>(sendbuf);
int sendtmpcount = sendcount;
MPI_Datatype sendtmptype = sendtype;
if ((comm->rank() == root) && (sendbuf == MPI_IN_PLACE)) {
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)
}
smpi_bench_end();
- char* sendtmpbuf = static_cast<char*>(sendbuf);
+ const char* sendtmpbuf = static_cast<const char*>(sendbuf);
int sendtmpcount = sendcount;
MPI_Datatype sendtmptype = sendtype;
if ((comm->rank() == root) && (sendbuf == MPI_IN_PLACE)) {
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)
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)
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)
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)
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;
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;
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;
return MPI_ERR_ARG;
smpi_bench_end();
- char* sendtmpbuf = static_cast<char*>(sendbuf);
+ const char* sendtmpbuf = static_cast<const char*>(sendbuf);
if (sendbuf == MPI_IN_PLACE) {
sendtmpbuf = static_cast<char*>(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<char*>(sendtmpbuf), count, datatype);
}
int rank = simgrid::s4u::this_actor::get_pid();
simgrid::smpi::Colls::iallreduce(sendtmpbuf, recvbuf, count, datatype, op, comm, request);
if (sendbuf == MPI_IN_PLACE)
- xbt_free(sendtmpbuf);
+ xbt_free(const_cast<char*>(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;
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<void*>(xbt_malloc(count * datatype->size()));
- memcpy(sendtmpbuf, recvbuf, count * datatype->size());
+ sendtmpbuf = static_cast<const void*>(xbt_malloc(count * datatype->size()));
+ memcpy(const_cast<void*>(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,
TRACE_smpi_comm_out(rank);
if (sendbuf == MPI_IN_PLACE)
- xbt_free(sendtmpbuf);
+ xbt_free(const_cast<void*>(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())
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<void*>(xbt_malloc(count * datatype->size()));
- memcpy(sendtmpbuf, recvbuf, count * datatype->size());
+ sendtmpbuf = static_cast<const void*>(xbt_malloc(count * datatype->size()));
+ memcpy(const_cast<void*>(sendtmpbuf), recvbuf, count * datatype->size());
}
TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Exscan" : "PMPI_Iexscan",
TRACE_smpi_comm_out(rank);
if (sendbuf == MPI_IN_PLACE)
- xbt_free(sendtmpbuf);
+ xbt_free(const_cast<void*>(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;
totalcount += recvcounts[i];
}
- void* sendtmpbuf = sendbuf;
+ const void* sendtmpbuf = sendbuf;
if (sendbuf == MPI_IN_PLACE) {
- sendtmpbuf = static_cast<void*>(xbt_malloc(totalcount * datatype->size()));
- memcpy(sendtmpbuf, recvbuf, totalcount * datatype->size());
+ sendtmpbuf = static_cast<const void*>(xbt_malloc(totalcount * datatype->size()));
+ memcpy(const_cast<void*>(sendtmpbuf), recvbuf, totalcount * datatype->size());
}
TRACE_smpi_comm_in(rank, request == MPI_REQUEST_IGNORED ? "PMPI_Reduce_scatter" : "PMPI_Ireduce_scatter",
TRACE_smpi_comm_out(rank);
if (sendbuf == MPI_IN_PLACE)
- xbt_free(sendtmpbuf);
+ xbt_free(const_cast<void*>(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)
int dt_send_size = datatype->is_replayable() ? 1 : datatype->size();
std::vector<int>* trace_recvcounts = new std::vector<int>(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<void*>(xbt_malloc(recvcount * count * datatype->size()));
- memcpy(sendtmpbuf, recvbuf, recvcount * count * datatype->size());
+ sendtmpbuf = static_cast<const void*>(xbt_malloc(recvcount * count * datatype->size()));
+ memcpy(const_cast<void*>(sendtmpbuf), recvbuf, recvcount * count * datatype->size());
}
TRACE_smpi_comm_in(
TRACE_smpi_comm_out(rank);
if (sendbuf == MPI_IN_PLACE)
- xbt_free(sendtmpbuf);
+ xbt_free(const_cast<void*>(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)
smpi_bench_end();
int rank = simgrid::s4u::this_actor::get_pid();
- void* sendtmpbuf = static_cast<char*>(sendbuf);
+ const void* sendtmpbuf = static_cast<const char*>(sendbuf);
int sendtmpcount = sendcount;
MPI_Datatype sendtmptype = sendtype;
if (sendbuf == MPI_IN_PLACE) {
sendtmpbuf = static_cast<void*>(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<void*>(sendtmpbuf), recvbuf, recvcount * comm->size() * recvtype->size());
sendtmpcount = recvcount;
sendtmptype = recvtype;
}
TRACE_smpi_comm_out(rank);
if (sendbuf == MPI_IN_PLACE)
- xbt_free(sendtmpbuf);
+ xbt_free(const_cast<void*>(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;
std::vector<int>* trace_recvcounts = new std::vector<int>;
int dt_size_recv = recvtype->size();
- void* sendtmpbuf = static_cast<char*>(sendbuf);
- int* sendtmpcounts = sendcounts;
- int* sendtmpdisps = senddisps;
+ const void* sendtmpbuf = static_cast<const char*>(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
if (sendbuf == MPI_IN_PLACE) {
sendtmpbuf = static_cast<void*>(xbt_malloc(maxsize));
- memcpy(sendtmpbuf, recvbuf, maxsize);
+ memcpy(const_cast<void*>(sendtmpbuf), recvbuf, maxsize);
sendtmpcounts = static_cast<int*>(xbt_malloc(size * sizeof(int)));
- memcpy(sendtmpcounts, recvcounts, size * sizeof(int));
+ memcpy(const_cast<int*>(sendtmpcounts), recvcounts, size * sizeof(int));
sendtmpdisps = static_cast<int*>(xbt_malloc(size * sizeof(int)));
- memcpy(sendtmpdisps, recvdisps, size * sizeof(int));
+ memcpy(const_cast<int*>(sendtmpdisps), recvdisps, size * sizeof(int));
sendtmptype = recvtype;
}
TRACE_smpi_comm_out(rank);
if (sendbuf == MPI_IN_PLACE) {
- xbt_free(sendtmpbuf);
- xbt_free(sendtmpcounts);
- xbt_free(sendtmpdisps);
+ xbt_free(const_cast<void*>(sendtmpbuf));
+ xbt_free(const_cast<int*>(sendtmpcounts));
+ xbt_free(const_cast<int*>(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;
std::vector<int>* trace_sendcounts = new std::vector<int>;
std::vector<int>* trace_recvcounts = new std::vector<int>;
- void* sendtmpbuf = static_cast<char*>(sendbuf);
- int* sendtmpcounts = sendcounts;
- int* sendtmpdisps = senddisps;
- MPI_Datatype* sendtmptypes = sendtypes;
+ const void* sendtmpbuf = static_cast<const char*>(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) {
if (sendbuf == MPI_IN_PLACE) {
sendtmpbuf = static_cast<void*>(xbt_malloc(maxsize));
- memcpy(sendtmpbuf, recvbuf, maxsize);
+ memcpy(const_cast<void*>(sendtmpbuf), recvbuf, maxsize);
sendtmpcounts = static_cast<int*>(xbt_malloc(size * sizeof(int)));
- memcpy(sendtmpcounts, recvcounts, size * sizeof(int));
+ memcpy(const_cast<int*>(sendtmpcounts), recvcounts, size * sizeof(int));
sendtmpdisps = static_cast<int*>(xbt_malloc(size * sizeof(int)));
- memcpy(sendtmpdisps, recvdisps, size * sizeof(int));
+ memcpy(const_cast<int*>(sendtmpdisps), recvdisps, size * sizeof(int));
sendtmptypes = static_cast<MPI_Datatype*>(xbt_malloc(size * sizeof(MPI_Datatype)));
- memcpy(sendtmptypes, recvtypes, size * sizeof(MPI_Datatype));
+ memcpy(const_cast<MPI_Datatype*>(sendtmptypes), recvtypes, size * sizeof(MPI_Datatype));
}
for (int i = 0; i < size; i++) { // copy data to avoid bad free
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<void*>(sendtmpbuf));
+ xbt_free(const_cast<int*>(sendtmpcounts));
+ xbt_free(const_cast<int*>(sendtmpdisps));
+ xbt_free(const_cast<MPI_Datatype*>(sendtmptypes));
}
smpi_bench_begin();
return retval;
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)
{
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)
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)
// 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)
{
// 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)
{
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)
-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)
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)
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)
{
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,
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)
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)
// 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)
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)
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)
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,
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);
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)
{
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)
{
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)
{
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)
{
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)
{
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)
{
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;
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,
#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,
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,
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,
/* 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,
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)
#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)
{
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)
{
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)
{
smpi_free_tmp_buffer(tmp);
smpi_free_tmp_buffer(send);
} else {
- send = sbuff;
+ send = const_cast<void*>(sbuff);
send_size = count / nprocs;
nbytes = send_size * s_extent;
r_offset = rank * nbytes;
//#include <star-reduction.c>
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;
#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)
{
*/
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)
*/
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)
{
*/
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)
{
*/
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)
{
*/
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)
{
*/
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)
{
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)
}
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)
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;
sendtype->extent(&lb, &sendext);
recvtype->extent(&lb, &recvext);
/* simple optimization */
- int err = Datatype::copy(static_cast<char *>(sendbuf) + rank * sendcount * sendext, sendcount, sendtype,
+ int err = Datatype::copy(static_cast<const char *>(sendbuf) + rank * sendcount * sendext, sendcount, sendtype,
static_cast<char *>(recvbuf) + rank * recvcount * recvext, recvcount, recvtype);
if (err == MPI_SUCCESS && size > 1) {
/* Initiate all send/recv to/from others. */
* TODO: check the previous assertion
*/
for (i = (rank + size - 1) % size; i != rank; i = (i + size - 1) % size) {
- requests[count] = Request::isend_init(static_cast<char *>(sendbuf) + i * sendcount * sendext, sendcount,
+ requests[count] = Request::isend_init(static_cast<const char *>(sendbuf) + i * sendcount * sendext, sendcount,
sendtype, i, system_tag, comm);
count++;
}
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)
namespace simgrid{
namespace smpi{
int Coll_alltoall_mvapich2_scatter_dest::alltoall(
- void *sendbuf,
+ const void *sendbuf,
int sendcount,
MPI_Datatype sendtype,
void *recvbuf,
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,
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)
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)
****************************************************************************/
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)
{
}
-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)
****************************************************************************/
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)
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,
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)
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)
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)
**/
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;
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)
{
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)
{
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;
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;
****************************************************************************/
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)
{
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)
{
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;
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;
****************************************************************************/
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;
#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,
* 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,
-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,
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;
* 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,
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<void*>(sbuf), 0, MPI_BYTE, root, COLL_TAG_GATHER, comm, MPI_STATUS_IGNORE);
Request::send(sbuf, first_segment_count, sdtype, root, COLL_TAG_GATHER, comm);
* 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;
*/
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)
{
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,
//#include <star-reduction.c>
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)
{
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)
{
int rank;
MPI_Aint extent;
char *origin = 0;
- char *inbuf;
+ const char *inbuf;
MPI_Status status;
rank = comm->rank();
for (i = size - 2; i >= 0; --i) {
if (rank == i)
- inbuf = static_cast<char*>(sbuf);
+ inbuf = static_cast<const char*>(sbuf);
else {
Request::recv(origin, count, dtype, i, tag, comm, &status);
inbuf = origin;
namespace simgrid{
namespace smpi{
int Coll_reduce_mvapich2_knomial::reduce (
- void *sendbuf,
+ const void *sendbuf,
void *recvbuf,
int count,
MPI_Datatype datatype,
#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,
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,
/*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,
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,
* 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,
*/
-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
}
-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 )
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)
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)
* 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,
operations for non-commutative ops.
*/
io_root = size - 1;
- use_this_sendbuf = sendbuf;
+ use_this_sendbuf = const_cast<void*>(sendbuf);
use_this_recvbuf = recvbuf;
if (io_root != root) {
ptrdiff_t text, ext;
*/
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,
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;
#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) );
}
*/
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)
{
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;
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<int*>(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<int*>(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
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<int*>(recvcounts))[rank]), datatype);
/* copy result back into recvbuf */
mpi_errno =
Datatype::copy(tmp_recvbuf, recvcounts[rank], datatype, recvbuf, recvcounts[rank], datatype);
}
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<int*>(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);
}
-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;
-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;
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
*
*/
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
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<int*>(rcounts))[prevblock]), dtype);
/* send previous block to send_to */
Request::send(tmprecv, rcounts[prevblock], dtype, send_to,
/* 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<int*>(rcounts))[rank]), dtype);
/* Copy result from tmprecv to rbuf */
ret = Datatype::copy(tmprecv, rcounts[rank], dtype, (char*)rbuf, rcounts[rank], dtype);
#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,
}
-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,
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;
* 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;
}
}
-//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;
}
-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;
}
-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;
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;
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);
}
-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;
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();
}
-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;
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);
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;
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
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)
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);
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,
}
}
};
-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,
*/
-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) ={
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)
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)
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
*/
-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,
*/
-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
) ={
*/
-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,
*/
-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,
*/
-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
) ={
*/
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;
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,
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
)
*/
-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
*/
-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
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,
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
)
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,
*/
-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,
rbuf, rcount, rdtype,
root, comm);
if(comm->rank()!=root){
- xbt_free(sbuf);
+ xbt_free(const_cast<void*>(sbuf));
}
return ret;
}
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,
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)
{
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,
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;
-int Coll_allreduce_mvapich2::allreduce(void *sendbuf,
+int Coll_allreduce_mvapich2::allreduce(const void *sendbuf,
void *recvbuf,
int count,
MPI_Datatype datatype,
}
-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
)
-int Coll_reduce_mvapich2::reduce( void *sendbuf,
+int Coll_reduce_mvapich2::reduce(const void *sendbuf,
void *recvbuf,
int count,
MPI_Datatype datatype,
}
-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)
{
-int Coll_scatter_mvapich2::scatter(void *sendbuf,
+int Coll_scatter_mvapich2::scatter(const void *sendbuf,
int sendcnt,
MPI_Datatype sendtype,
void *recvbuf,
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);
};
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 */
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);
};
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;
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;
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);
};
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;
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 {
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;
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);
};
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);
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);
};
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
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);
};
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);
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);
};
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;
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)
{
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;
sendtype->extent(&lb, &sendext);
// Local copy from root
if(recvbuf!=MPI_IN_PLACE){
- Datatype::copy(static_cast<char *>(sendbuf) + root * sendcount * sendext,
+ Datatype::copy(static_cast<const char *>(sendbuf) + root * sendcount * sendext,
sendcount, sendtype, recvbuf, recvcount, recvtype);
}
// Send buffers to receivers
int index = 0;
for(int dst = 0; dst < size; dst++) {
if(dst != root) {
- requests[index] = Request::isend_init(static_cast<char *>(sendbuf) + dst * sendcount * sendext, sendcount, sendtype,
+ requests[index] = Request::isend_init(static_cast<const char *>(sendbuf) + dst * sendcount * sendext, sendcount, sendtype,
dst, system_tag, comm);
index++;
}
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;
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;
sendtype->extent(&lb, &sendext);
recvtype->extent(&lb, &recvext);
/* simple optimization */
- int err = Datatype::copy(static_cast<char *>(sendbuf) + rank * sendcount * sendext, sendcount, sendtype,
+ int err = Datatype::copy(static_cast<const char *>(sendbuf) + rank * sendcount * sendext, sendcount, sendtype,
static_cast<char *>(recvbuf) + rank * recvcount * recvext, recvcount, recvtype);
if (err == MPI_SUCCESS && size > 1) {
/* Initiate all send/recv to/from others. */
* 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<char *>(sendbuf) + i * sendcount * sendext, sendcount,
+ requests[count] = Request::isend_init(static_cast<const char *>(sendbuf) + i * sendcount * sendext, sendcount,
sendtype, i, system_tag, comm);
count++;
}
return MPI_SUCCESS;
}
-int Colls::ialltoallv(void *sendbuf, int *sendcounts, int *senddisps, MPI_Datatype sendtype,
- void *recvbuf, int *recvcounts, int *recvdisps, MPI_Datatype recvtype, MPI_Comm comm, MPI_Request *request){
+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;
sendtype->extent(&lb, &sendext);
recvtype->extent(&lb, &recvext);
/* Local copy from self */
- int err = Datatype::copy(static_cast<char *>(sendbuf) + senddisps[rank] * sendext, sendcounts[rank], sendtype,
+ int err = Datatype::copy(static_cast<const char *>(sendbuf) + senddisps[rank] * sendext, sendcounts[rank], sendtype,
static_cast<char *>(recvbuf) + recvdisps[rank] * recvext, recvcounts[rank], recvtype);
if (err == MPI_SUCCESS && size > 1) {
/* Initiate all send/recv to/from others. */
/* Now create all sends */
for (int i = 0; i < size; ++i) {
if (i != rank) {
- requests[count] = Request::isend_init(static_cast<char *>(sendbuf) + senddisps[i] * sendext,
+ requests[count] = Request::isend_init(static_cast<const char *>(sendbuf) + senddisps[i] * sendext,
sendcounts[i], sendtype, i, system_tag, comm);
count++;
}else{
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. */
(*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<char *>(sendbuf) + senddisps[rank], sendcounts[rank], sendtypes[rank],
+ int err = (sendcounts[rank]>0 && recvcounts[rank]) ? Datatype::copy(static_cast<const char *>(sendbuf) + senddisps[rank], sendcounts[rank], sendtypes[rank],
static_cast<char *>(recvbuf) + recvdisps[rank], recvcounts[rank], recvtypes[rank]): MPI_SUCCESS;
if (err == MPI_SUCCESS && size > 1) {
/* Initiate all send/recv to/from others. */
/* Now create all sends */
for (int i = 0; i < size; ++i) {
if (i != rank) {
- requests[count] = Request::isend_init(static_cast<char *>(sendbuf) + senddisps[i] ,
+ requests[count] = Request::isend_init(static_cast<const char *>(sendbuf) + senddisps[i] ,
sendcounts[i], sendtypes[i], i, system_tag, comm);
count++;
}else{
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;
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;
}
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;
sendtype->extent(&lb, &sendext);
// Local copy from root
if(recvbuf!=MPI_IN_PLACE){
- Datatype::copy(static_cast<char *>(sendbuf) + displs[root] * sendext, sendcounts[root],
+ Datatype::copy(static_cast<const char *>(sendbuf) + displs[root] * sendext, sendcounts[root],
sendtype, recvbuf, recvcount, recvtype);
}
// Send buffers to receivers
int index = 0;
for (int dst = 0; dst < size; dst++) {
if (dst != root) {
- requests[index] = Request::isend_init(static_cast<char *>(sendbuf) + displs[dst] * sendext, sendcounts[dst],
+ requests[index] = Request::isend_init(static_cast<const char *>(sendbuf) + displs[dst] * sendext, sendcounts[dst],
sendtype, dst, system_tag, comm);
index++;
}
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<char *>(sendbuf);
+ void* sendtmpbuf = const_cast<void *>(sendbuf);
int rank = comm->rank();
int size = comm->size();
return MPI_ERR_COMM;
if( sendbuf == MPI_IN_PLACE ) {
- sendtmpbuf = static_cast<char *>(smpi_get_tmp_sendbuffer(count*datatype->get_extent()));
+ sendtmpbuf = static_cast<void *>(smpi_get_tmp_sendbuffer(count*datatype->get_extent()));
Datatype::copy(recvbuf, count, datatype,sendtmpbuf, count, datatype);
}
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)
{
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;
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;
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;
int recvdisp=0;
for (int other = 0; other < size; other++) {
if(other != rank) {
- requests[index] = Request::isend_init(static_cast<char *>(sendbuf) + recvdisp * dataext, recvcounts[other], datatype, other, system_tag,comm);
+ requests[index] = Request::isend_init(static_cast<const char *>(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<char *>(sendbuf) + recvdisp * dataext, count, datatype, recvbuf, count, datatype);
+ Datatype::copy(static_cast<const char *>(sendbuf) + recvdisp * dataext, count, datatype, recvbuf, count, datatype);
}
recvdisp+=recvcounts[other];
}
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;
-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,
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
)
#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
#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
}
-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,
#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
)
}
}
-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,
}
-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,
rbuf, rcount, rdtype,
root, comm);
if(rank!=root){
- xbt_free(sbuf);
+ xbt_free(const_cast<void*>(sbuf));
}
return ret;
}
#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, \
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)();