Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove spurious ;
[simgrid.git] / src / smpi / include / smpi_coll.hpp
index 9597fc3..1562a33 100644 (file)
@@ -41,39 +41,39 @@ static ret cat  (COLL_UNPAREN args); \
 #define COLL_NOTHING(...)
 
 #define COLL_GATHER_SIG gather, int, \
-                      (void *send_buff, int send_count, MPI_Datatype send_type, \
+                      (const void *send_buff, int send_count, MPI_Datatype send_type, \
                        void *recv_buff, int recv_count, MPI_Datatype recv_type, \
                            int root, MPI_Comm comm)
 #define COLL_ALLGATHER_SIG allgather, int, \
-                      (void *send_buff, int send_count, MPI_Datatype send_type, \
+                      (const void *send_buff, int send_count, MPI_Datatype send_type, \
                        void *recv_buff, int recv_count, MPI_Datatype recv_type, \
                            MPI_Comm comm)
 #define COLL_ALLGATHERV_SIG allgatherv, int, \
-                      (void *send_buff, int send_count, MPI_Datatype send_type, \
-                       void *recv_buff, int *recv_count, int *recv_disps, \
+                      (const void *send_buff, int send_count, MPI_Datatype send_type, \
+                       void *recv_buff, const int *recv_count, const int *recv_disps, \
                MPI_Datatype recv_type, MPI_Comm comm)
 #define COLL_ALLTOALL_SIG alltoall, int, \
-                     (void *send_buff, int send_count, MPI_Datatype send_type, \
+                     (const void *send_buff, int send_count, MPI_Datatype send_type, \
                       void *recv_buff, int recv_count, MPI_Datatype recv_type, \
                           MPI_Comm comm)
 #define COLL_ALLTOALLV_SIG alltoallv, int, \
-                     (void *send_buff, int *send_counts, int *send_disps, MPI_Datatype send_type, \
-                      void *recv_buff, int *recv_counts, int *recv_disps, MPI_Datatype recv_type, \
+                     (const void *send_buff, const int *send_counts, const int *send_disps, MPI_Datatype send_type, \
+                      void *recv_buff, const int *recv_counts, const int *recv_disps, MPI_Datatype recv_type, \
                           MPI_Comm comm)
 #define COLL_BCAST_SIG bcast, int, \
                   (void *buf, int count, MPI_Datatype datatype, \
                    int root, MPI_Comm comm)
 #define COLL_REDUCE_SIG reduce, int, \
-                   (void *buf, void *rbuf, int count, MPI_Datatype datatype, \
+                   (const void *buf, void *rbuf, int count, MPI_Datatype datatype, \
                         MPI_Op op, int root, MPI_Comm comm)
 #define COLL_ALLREDUCE_SIG allreduce, int, \
-                      (void *sbuf, void *rbuf, int rcount, \
+                      (const void *sbuf, void *rbuf, int rcount, \
                            MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
 #define COLL_REDUCE_SCATTER_SIG reduce_scatter, int, \
-                      (void *sbuf, void *rbuf, int *rcounts,\
+                      (const void *sbuf, void *rbuf, const int *rcounts,\
                     MPI_Datatype dtype,MPI_Op  op,MPI_Comm  comm)
 #define COLL_SCATTER_SIG scatter, int, \
-                (void *sendbuf, int sendcount, MPI_Datatype sendtype,\
+                (const void *sendbuf, int sendcount, MPI_Datatype sendtype,\
                 void *recvbuf, int recvcount, MPI_Datatype recvtype,\
                 int root, MPI_Comm comm)
 #define COLL_BARRIER_SIG barrier, int, \
@@ -96,59 +96,65 @@ public:
   static void set_collectives();
 
   // for each collective type, create the set_* prototype, the description array and the function pointer
-  COLL_APPLY(COLL_DEFS, COLL_GATHER_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_ALLGATHER_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_ALLGATHERV_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_REDUCE_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_ALLREDUCE_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_REDUCE_SCATTER_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_SCATTER_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_BARRIER_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_BCAST_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_ALLTOALL_SIG, "");
-  COLL_APPLY(COLL_DEFS, COLL_ALLTOALLV_SIG, "");
+  COLL_APPLY(COLL_DEFS, COLL_GATHER_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_ALLGATHER_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_ALLGATHERV_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_REDUCE_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_ALLREDUCE_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_REDUCE_SCATTER_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_SCATTER_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_BARRIER_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_BCAST_SIG, "")
+  COLL_APPLY(COLL_DEFS, COLL_ALLTOALL_SIG, "")
+  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
+         (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
+         (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)();
@@ -157,17 +163,17 @@ public:
 class Coll {
 public:
   // for each collective type, create a function member
-  COLL_APPLY(COLL_SIG, COLL_GATHER_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_ALLGATHER_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_ALLGATHERV_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_REDUCE_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_ALLREDUCE_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_REDUCE_SCATTER_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_SCATTER_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_BARRIER_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_BCAST_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_ALLTOALL_SIG, "");
-  COLL_APPLY(COLL_SIG, COLL_ALLTOALLV_SIG, "");
+  COLL_APPLY(COLL_SIG, COLL_GATHER_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_ALLGATHER_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_ALLGATHERV_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_REDUCE_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_ALLREDUCE_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_REDUCE_SCATTER_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_SCATTER_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_BARRIER_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_BCAST_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_ALLTOALL_SIG, "")
+  COLL_APPLY(COLL_SIG, COLL_ALLTOALLV_SIG, "")
 };
 
 /*************