Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add scatter algos from ompi
[simgrid.git] / src / smpi / smpi_global.c
index 7b5a844..d980dfc 100644 (file)
@@ -360,12 +360,24 @@ int smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[])
   SIMIX_function_register_default(realmain);
   SIMIX_launch_application(argv[2]);
 
+  int gather_id = find_coll_description(mpi_coll_gather_description,
+                                           sg_cfg_get_string("smpi/gather"));
+  mpi_coll_gather_fun = (int (*)(void *, int, MPI_Datatype,
+                                   void*, int, MPI_Datatype, int, MPI_Comm))
+                          mpi_coll_gather_description[gather_id].coll;
+
   int allgather_id = find_coll_description(mpi_coll_allgather_description,
                                            sg_cfg_get_string("smpi/allgather"));
   mpi_coll_allgather_fun = (int (*)(void *, int, MPI_Datatype,
                                    void*, int, MPI_Datatype, MPI_Comm))
                           mpi_coll_allgather_description[allgather_id].coll;
 
+  int allgatherv_id = find_coll_description(mpi_coll_allgatherv_description,
+                                           sg_cfg_get_string("smpi/allgatherv"));
+  mpi_coll_allgatherv_fun = (int (*)(void *, int, MPI_Datatype,
+                                   void*, int*, int*, MPI_Datatype, MPI_Comm))
+                          mpi_coll_allgatherv_description[allgatherv_id].coll;
+
   int allreduce_id = find_coll_description(mpi_coll_allreduce_description,
                                            sg_cfg_get_string("smpi/allreduce"));
   mpi_coll_allreduce_fun = (int (*)(void *sbuf, void *rbuf, int rcount, \
@@ -378,6 +390,12 @@ int smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[])
                                   void*, int, MPI_Datatype, MPI_Comm))
                          mpi_coll_alltoall_description[alltoall_id].coll;
 
+  int alltoallv_id = find_coll_description(mpi_coll_alltoallv_description,
+                                          sg_cfg_get_string("smpi/alltoallv"));
+  mpi_coll_alltoallv_fun = (int (*)(void *, int*, int*, MPI_Datatype,
+                                   void*, int*, int*, MPI_Datatype, MPI_Comm))
+                         mpi_coll_alltoallv_description[alltoallv_id].coll;
+
   int bcast_id = find_coll_description(mpi_coll_bcast_description,
                                           sg_cfg_get_string("smpi/bcast"));
   mpi_coll_bcast_fun = (int (*)(void *buf, int count, MPI_Datatype datatype, \
@@ -390,6 +408,18 @@ int smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[])
                                  MPI_Op op, int root, MPI_Comm comm))
                        mpi_coll_reduce_description[reduce_id].coll;
 
+  int reduce_scatter_id = find_coll_description(mpi_coll_reduce_scatter_description,
+                                           sg_cfg_get_string("smpi/reduce_scatter"));
+  mpi_coll_reduce_scatter_fun = (int (*)(void *sbuf, void *rbuf, int *rcounts,\
+                    MPI_Datatype dtype,MPI_Op  op,MPI_Comm  comm))
+                          mpi_coll_reduce_scatter_description[reduce_scatter_id].coll;
+
+  int scatter_id = find_coll_description(mpi_coll_scatter_description,
+                                           sg_cfg_get_string("smpi/scatter"));
+  mpi_coll_scatter_fun = (int (*)(void *sendbuf, int sendcount, MPI_Datatype sendtype,\
+                void *recvbuf, int recvcount, MPI_Datatype recvtype,\
+                int root, MPI_Comm comm))
+                          mpi_coll_scatter_description[scatter_id].coll;
   smpi_global_init();
 
   /* Clean IO before the run */
@@ -401,7 +431,7 @@ int smpi_main(int (*realmain) (int argc, char *argv[]),int argc, char *argv[])
   else
     SIMIX_run();
 
-  if (sg_cfg_get_int("smpi/display_timing"))
+  if (sg_cfg_get_boolean("smpi/display_timing"))
     XBT_INFO("Simulation time: %g seconds.", SIMIX_get_clock());
 
   smpi_global_destroy();