Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
expend more macros in MPI collectives
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 22 Nov 2019 06:01:19 +0000 (07:01 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 22 Nov 2019 06:22:20 +0000 (07:22 +0100)
src/smpi/colls/smpi_coll.cpp
src/smpi/include/smpi_coll.hpp
tools/cmake/DefinePackages.cmake

index 2dce7e7..1d0f166 100644 (file)
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_coll, smpi, "Logging specific to SMPI collectives.");
 
-#define COLL_SETTER(cat, ret, args, args2)                                                                             \
-  void colls::_XBT_CONCAT(set_, cat)(const std::string& name)                                                          \
-  {                                                                                                                    \
-    int id = find_coll_description(_XBT_CONCAT3(mpi_coll_, cat, _description), name, _XBT_STRINGIFY(cat));             \
-    cat    = reinterpret_cast<ret(*) args>(_XBT_CONCAT3(mpi_coll_, cat, _description)[id].coll);                       \
-    if (cat == nullptr)                                                                                                \
-      xbt_die("Collective " _XBT_STRINGIFY(cat) " set to nullptr!");                                                   \
-  }
-
-namespace simgrid{
-namespace smpi{
+namespace simgrid {
+namespace smpi {
 
 /* these arrays must be nullptr terminated */
-s_mpi_coll_description_t mpi_coll_gather_description[]         = {COLL_GATHERS(COLL_DESCRIPTION, COLL_COMMA),
-                                                          {"", "", nullptr}};
-s_mpi_coll_description_t mpi_coll_allgather_description[]      = {COLL_ALLGATHERS(COLL_DESCRIPTION, COLL_COMMA),
-                                                             {"", "", nullptr}};
-s_mpi_coll_description_t mpi_coll_allgatherv_description[]     = {COLL_ALLGATHERVS(COLL_DESCRIPTION, COLL_COMMA),
-                                                              {"", "", nullptr}};
-s_mpi_coll_description_t mpi_coll_allreduce_description[]      = {COLL_ALLREDUCES(COLL_DESCRIPTION, COLL_COMMA),
-                                                             {"", "", nullptr}};
-s_mpi_coll_description_t mpi_coll_reduce_scatter_description[] = {COLL_REDUCE_SCATTERS(COLL_DESCRIPTION, COLL_COMMA),
-                                                                  {"", "", nullptr}};
-s_mpi_coll_description_t mpi_coll_scatter_description[]        = {COLL_SCATTERS(COLL_DESCRIPTION, COLL_COMMA),
-                                                           {"", "", nullptr}};
-s_mpi_coll_description_t mpi_coll_barrier_description[]        = {COLL_BARRIERS(COLL_DESCRIPTION, COLL_COMMA),
-                                                           {"", "", nullptr}};
-s_mpi_coll_description_t mpi_coll_alltoall_description[]       = {COLL_ALLTOALLS(COLL_DESCRIPTION, COLL_COMMA),
-                                                            {"", "", nullptr}};
-s_mpi_coll_description_t mpi_coll_alltoallv_description[]      = {COLL_ALLTOALLVS(COLL_DESCRIPTION, COLL_COMMA),
-                                                             {"", "", nullptr}};
-s_mpi_coll_description_t mpi_coll_bcast_description[]  = {COLL_BCASTS(COLL_DESCRIPTION, COLL_COMMA), {"", "", nullptr}};
-s_mpi_coll_description_t mpi_coll_reduce_description[] = {COLL_REDUCES(COLL_DESCRIPTION, COLL_COMMA),
-                                                          {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_gather_description[] = {
+    {"default","gather default collective", (void*)gather__default},
+    {"ompi","gather ompi collective", (void*)gather__ompi},
+    {"ompi_basic_linear","gather ompi_basic_linear collective", (void*)gather__ompi_basic_linear},
+    {"ompi_binomial", "gather ompi_binomial collective", (void*)gather__ompi_binomial},
+    {"ompi_linear_sync", "gather ompi_linear_sync collective", (void*)gather__ompi_linear_sync},
+    {"mpich", "gather mpich collective", (void*)gather__mpich},
+    {"mvapich2","gather mvapich2 collective", (void*)gather__mvapich2},
+    {"mvapich2_two_level", "gather mvapich2_two_level collective", (void*)gather__mvapich2_two_level},
+    {"impi","gather impi collective", (void*)gather__impi},
+    {"automatic","gather automatic collective",(void*)gather__automatic},
+    {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_allgather_description[] = {
+    {"default", "allgather default collective", (void*)allgather__default},
+    {"2dmesh", "allgather 2dmesh collective", (void*)allgather__2dmesh},
+    {"3dmesh", "allgather 3dmesh collective", (void*)allgather__3dmesh},
+    {"bruck", "allgather bruck collective", (void*)allgather__bruck},
+    {"GB", "allgather GB collective", (void*)allgather__GB},
+    {"loosely_lr", "allgather loosely_lr collective", (void*)allgather__loosely_lr},
+    {"NTSLR", "allgather NTSLR collective", (void*)allgather__NTSLR},
+    {"NTSLR_NB", "allgather NTSLR_NB collective", (void*)allgather__NTSLR_NB},
+    {"pair", "allgather pair collective", (void*)allgather__pair},
+    {"rdb", "allgather rdb collective", (void*)allgather__rdb},
+    {"rhv", "allgather rhv collective", (void*)allgather__rhv},
+    {"ring", "allgather ring collective", (void*)allgather__ring },
+    {"SMP_NTS", "allgather SMP_NTS collective", (void*)allgather__SMP_NTS},
+    {"smp_simple", "allgather smp_simple collective", (void*)allgather__smp_simple},
+    {"spreading_simple", "allgather spreading_simple collective", (void*)allgather__spreading_simple},
+    {"ompi", "allgather ompi collective", (void*)allgather__ompi},
+    {"ompi_neighborexchange", "allgather ompi_neighborexchange collective", (void*)allgather__ompi_neighborexchange},
+    {"mvapich2", "allgather mvapich2 collective", (void*)allgather__mvapich2},
+    {"mvapich2_smp", "allgather mvapich2_smp collective", (void*)allgather__mvapich2_smp},
+    {"mpich", "allgather mpich collective", (void*)allgather__mpich},
+    {"impi", "allgather impi collective", (void*)allgather__impi},
+    {"automatic", "allgather automatic collective", (void*)allgather__automatic},
+    {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_allgatherv_description[] = {
+    {"default", "allgatherv default collective", (void*)allgatherv__default},
+    {"GB", "allgatherv GB collective", (void*)allgatherv__GB},
+    {"pair", "allgatherv pair collective", (void*)allgatherv__pair},
+    {"ring", "allgatherv ring collective", (void*)allgatherv__ring},
+    {"ompi", "allgatherv ompi collective", (void*)allgatherv__ompi},
+    {"ompi_neighborexchange", "allgatherv ompi_neighborexchange collective", (void*)allgatherv__ompi_neighborexchange},
+    {"ompi_bruck", "allgatherv ompi_bruck collective", (void*)allgatherv__ompi_bruck},
+    {"mpich", "allgatherv mpich collective", (void*)allgatherv__mpich},
+    {"mpich_rdb", "allgatherv mpich_rdb collective", (void*)allgatherv__mpich_rdb},
+    {"mpich_ring", "allgatherv mpich_ring collective", (void*)allgatherv__mpich_ring},
+    {"mvapich2", "allgatherv mvapich2 collective", (void*)allgatherv__mvapich2},
+    {"impi", "allgatherv impi collective", (void*)allgatherv__impi},
+    {"automatic", "allgatherv automatic collective", (void*)allgatherv__automatic},
+    {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_allreduce_description[] = {
+    {"default", "allreduce default collective", (void*)allreduce__default},
+    {"lr", "allreduce lr collective", (void*)allreduce__lr},
+    {"rab1", "allreduce rab1 collective", (void*)allreduce__rab1},
+    {"rab2", "allreduce rab2 collective", (void*)allreduce__rab2},
+    {"rab_rdb", "allreduce rab_rdb collective", (void*)allreduce__rab_rdb},
+    {"rdb", "allreduce rdb collective", (void*)allreduce__rdb},
+    {"smp_binomial", "allreduce smp_binomial collective", (void*)allreduce__smp_binomial},
+    {"smp_binomial_pipeline", "allreduce smp_binomial_pipeline collective", (void*)allreduce__smp_binomial_pipeline},
+    {"smp_rdb", "allreduce smp_rdb collective", (void*)allreduce__smp_rdb},
+    {"smp_rsag", "allreduce smp_rsag collective", (void*)allreduce__smp_rsag},
+    {"smp_rsag_lr", "allreduce smp_rsag_lr collective", (void*)allreduce__smp_rsag_lr},
+    {"smp_rsag_rab", "allreduce smp_rsag_rab collective", (void*)allreduce__smp_rsag_rab},
+    {"redbcast", "allreduce redbcast collective", (void*)allreduce__redbcast},
+    {"ompi", "allreduce ompi collective", (void*)allreduce__ompi},
+    {"ompi_ring_segmented", "allreduce ompi_ring_segmented collective", (void*)allreduce__ompi_ring_segmented},
+    {"mpich", "allreduce mpich collective", (void*)allreduce__mpich},
+    {"mvapich2", "allreduce mvapich2 collective", (void*)allreduce__mvapich2},
+    {"mvapich2_rs", "allreduce mvapich2_rs collective", (void*)allreduce__mvapich2_rs},
+    {"mvapich2_two_level", "allreduce mvapich2_two_level collective", (void*)allreduce__mvapich2_two_level},
+    {"impi", "allreduce impi collective", (void*)allreduce__impi},
+    {"rab", "allreduce rab collective", (void*)allreduce__rab},
+    {"automatic", "allreduce automatic collective", (void*)allreduce__automatic},
+    {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_reduce_scatter_description[] = {
+    {"default", "reduce_scatter default collective", (void*)reduce_scatter__default},
+    {"ompi", "reduce_scatter ompi collective", (void*)reduce_scatter__ompi},
+    {"ompi_basic_recursivehalving", "reduce_scatter ompi_basic_recursivehalving collective", (void*)reduce_scatter__ompi_basic_recursivehalving},
+    {"ompi_ring", "reduce_scatter ompi_ring collective", (void*)reduce_scatter__ompi_ring},
+    {"mpich", "reduce_scatter mpich collective", (void*)reduce_scatter__mpich},
+    {"mpich_pair", "reduce_scatter mpich_pair collective", (void*)reduce_scatter__mpich_pair},
+    {"mpich_rdb", "reduce_scatter mpich_rdb collective", (void*)reduce_scatter__mpich_rdb},
+    {"mpich_noncomm", "reduce_scatter mpich_noncomm collective", (void*)reduce_scatter__mpich_noncomm},
+    {"mvapich2", "reduce_scatter mvapich2 collective", (void*)reduce_scatter__mvapich2},
+    {"impi", "reduce_scatter impi collective", (void*)reduce_scatter__impi},
+    {"automatic", "reduce_scatter automatic collective", (void*)reduce_scatter__automatic},
+    {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_scatter_description[] = {
+    {"default", "scatter default collective", (void*)scatter__default},
+    {"ompi", "scatter ompi collective", (void*)scatter__ompi},
+    {"ompi_basic_linear", "scatter ompi_basic_linear collective", (void*)scatter__ompi_basic_linear},
+    {"ompi_binomial", "scatter ompi_binomial collective", (void*)scatter__ompi_binomial},
+    {"mpich", "scatter mpich collective", (void*)scatter__mpich},
+    {"mvapich2", "scatter mvapich2 collective", (void*)scatter__mvapich2},
+    {"mvapich2_two_level_binomial", "scatter mvapich2_two_level_binomial collective", (void*)scatter__mvapich2_two_level_binomial},
+    {"mvapich2_two_level_direct", "scatter mvapich2_two_level_direct collective", (void*)scatter__mvapich2_two_level_direct},
+    {"impi", "scatter impi collective", (void*)scatter__impi},
+    {"automatic", "scatter automatic collective", (void*)scatter__automatic},
+    {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_barrier_description[] = {
+    {"default", "barrier default collective", (void*)barrier__default},
+    {"ompi", "barrier ompi collective", (void*)barrier__ompi},
+    {"ompi_basic_linear", "barrier ompi_basic_linear collective", (void*)barrier__ompi_basic_linear},
+    {"ompi_two_procs", "barrier ompi_two_procs collective", (void*)barrier__ompi_two_procs},
+    {"ompi_tree", "barrier ompi_tree collective", (void*)barrier__ompi_tree},
+    {"ompi_bruck", "barrier ompi_bruck collective", (void*)barrier__ompi_bruck},
+    {"ompi_recursivedoubling", "barrier ompi_recursivedoubling collective", (void*)barrier__ompi_recursivedoubling},
+    {"ompi_doublering", "barrier ompi_doublering collective", (void*)barrier__ompi_doublering},
+    {"mpich_smp", "barrier mpich_smp collective", (void*)barrier__mpich_smp},
+    {"mpich", "barrier mpich collective", (void*)barrier__mpich},
+    {"mvapich2_pair", "barrier mvapich2_pair collective", (void*)barrier__mvapich2_pair},
+    {"mvapich2", "barrier mvapich2 collective", (void*)barrier__mvapich2},
+    {"impi", "barrier impi collective", (void*)barrier__impi},
+    {"automatic", "barrier automatic collective", (void*)barrier__automatic},
+    {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_alltoall_description[] = {
+    {"default", "alltoall default collective", (void*)alltoall__default},
+    {"2dmesh", "alltoall 2dmesh collective", (void*)alltoall__2dmesh},
+    {"3dmesh", "alltoall 3dmesh collective", (void*)alltoall__3dmesh},
+    {"basic_linear", "alltoall basic_linear collective", (void*)alltoall__basic_linear},
+    {"bruck", "alltoall bruck collective", (void*)alltoall__bruck},
+    {"pair", "alltoall pair collective", (void*)alltoall__pair},
+    {"pair_rma", "alltoall pair_rma collective", (void*)alltoall__pair_rma},
+    {"pair_light_barrier", "alltoall pair_light_barrier collective", (void*)alltoall__pair_light_barrier},
+    {"pair_mpi_barrier", "alltoall pair_mpi_barrier collective", (void*)alltoall__pair_mpi_barrier},
+    {"pair_one_barrier", "alltoall pair_one_barrier collective", (void*)alltoall__pair_one_barrier},
+    {"rdb", "alltoall rdb collective", (void*)alltoall__rdb},
+    {"ring", "alltoall ring collective", (void*)alltoall__ring},
+    {"ring_light_barrier", "alltoall ring_light_barrier collective", (void*)alltoall__ring_light_barrier},
+    {"ring_mpi_barrier", "alltoall ring_mpi_barrier collective", (void*)alltoall__ring_mpi_barrier},
+    {"ring_one_barrier", "alltoall ring_one_barrier collective", (void*)alltoall__ring_one_barrier},
+    {"mvapich2", "alltoall mvapich2 collective", (void*)alltoall__mvapich2},
+    {"mvapich2_scatter_dest", "alltoall mvapich2_scatter_dest collective", (void*)alltoall__mvapich2_scatter_dest},
+    {"ompi", "alltoall ompi collective", (void*)alltoall__ompi},
+    {"mpich", "alltoall mpich collective", (void*)alltoall__mpich},
+    {"impi", "alltoall impi collective", (void*)alltoall__impi},
+    {"automatic", "alltoall automatic collective", (void*)alltoall__automatic},
+    {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_alltoallv_description[] = {
+    {"default", "alltoallv default collective", (void*)alltoallv__default},
+    {"bruck", "alltoallv bruck collective", (void*)alltoallv__bruck},
+    {"pair", "alltoallv pair collective", (void*)alltoallv__pair},
+    {"pair_light_barrier", "alltoallv pair_light_barrier collective", (void*)alltoallv__pair_light_barrier},
+    {"pair_mpi_barrier", "alltoallv pair_mpi_barrier collective", (void*)alltoallv__pair_mpi_barrier},
+    {"pair_one_barrier", "alltoallv pair_one_barrier collective", (void*)alltoallv__pair_one_barrier},
+    {"ring", "alltoallv ring collective", (void*)alltoallv__ring},
+    {"ring_light_barrier", "alltoallv ring_light_barrier collective", (void*)alltoallv__ring_light_barrier},
+    {"ring_mpi_barrier", "alltoallv ring_mpi_barrier collective", (void*)alltoallv__ring_mpi_barrier},
+    {"ring_one_barrier", "alltoallv ring_one_barrier collective", (void*)alltoallv__ring_one_barrier},
+    {"ompi", "alltoallv ompi collective", (void*)alltoallv__ompi},
+    {"mpich", "alltoallv mpich collective", (void*)alltoallv__mpich},
+    {"ompi_basic_linear", "alltoallv ompi_basic_linear collective", (void*)alltoallv__ompi_basic_linear},
+    {"mvapich2", "alltoallv mvapich2 collective", (void*)alltoallv__mvapich2},
+    {"impi", "alltoallv impi collective", (void*)alltoallv__impi},
+    {"automatic", "alltoallv automatic collective", (void*)alltoallv__automatic},
+    {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_bcast_description[] = {
+    {"default", "bcast default collective", (void*)bcast__default},
+    {"arrival_pattern_aware", "bcast arrival_pattern_aware collective", (void*)bcast__arrival_pattern_aware},
+    {"arrival_pattern_aware_wait", "bcast arrival_pattern_aware_wait collective", (void*)bcast__arrival_pattern_aware_wait},
+    {"arrival_scatter", "bcast arrival_scatter collective", (void*)bcast__arrival_scatter},
+    {"binomial_tree", "bcast binomial_tree collective", (void*)bcast__binomial_tree},
+    {"flattree", "bcast flattree collective", (void*)bcast__flattree},
+    {"flattree_pipeline", "bcast flattree_pipeline collective", (void*)bcast__flattree_pipeline},
+    {"NTSB", "bcast NTSB collective", (void*)bcast__NTSB},
+    {"NTSL", "bcast NTSL collective", (void*)bcast__NTSL},
+    {"NTSL_Isend", "bcast NTSL_Isend collective", (void*)bcast__NTSL_Isend},
+    {"scatter_LR_allgather", "bcast scatter_LR_allgather collective", (void*)bcast__scatter_LR_allgather},
+    {"scatter_rdb_allgather", "bcast scatter_rdb_allgather collective", (void*)bcast__scatter_rdb_allgather},
+    {"SMP_binary", "bcast SMP_binary collective", (void*)bcast__SMP_binary},
+    {"SMP_binomial", "bcast SMP_binomial collective", (void*)bcast__SMP_binomial},
+    {"SMP_linear", "bcast SMP_linear collective", (void*)bcast__SMP_linear},
+    {"ompi", "bcast ompi collective", (void*)bcast__ompi},
+    {"ompi_split_bintree", "bcast ompi_split_bintree collective", (void*)bcast__ompi_split_bintree},
+    {"ompi_pipeline", "bcast ompi_pipeline collective", (void*)bcast__ompi_pipeline},
+    {"mpich", "bcast mpich collective", (void*)bcast__mpich},
+    {"mvapich2", "bcast mvapich2 collective", (void*)bcast__mvapich2},
+    {"mvapich2_inter_node", "bcast mvapich2_inter_node collective", (void*)bcast__mvapich2_inter_node},
+    {"mvapich2_intra_node", "bcast mvapich2_intra_node collective", (void*)bcast__mvapich2_intra_node},
+    {"mvapich2_knomial_intra_node", "bcast mvapich2_knomial_intra_node collective", (void*)bcast__mvapich2_knomial_intra_node},
+    {"impi", "bcast impi collective", (void*)bcast__impi},
+    {"automatic", "bcast automatic collective", (void*)bcast__automatic},
+    {"", "", nullptr}};
+s_mpi_coll_description_t mpi_coll_reduce_description[] = {
+    {"default", "reduce default collective", (void*)reduce__default},
+    {"arrival_pattern_aware", "reduce arrival_pattern_aware collective", (void*)reduce__arrival_pattern_aware},
+    {"binomial", "reduce binomial collective", (void*)reduce__binomial},
+    {"flat_tree", "reduce flat_tree collective", (void*)reduce__flat_tree},
+    {"NTSL", "reduce NTSL collective", (void*)reduce__NTSL},
+    {"scatter_gather", "reduce scatter_gather collective", (void*)reduce__scatter_gather},
+    {"ompi", "reduce ompi collective", (void*)reduce__ompi},
+    {"ompi_chain", "reduce ompi_chain collective", (void*)reduce__ompi_chain},
+    {"ompi_pipeline", "reduce ompi_pipeline collective", (void*)reduce__ompi_pipeline},
+    {"ompi_basic_linear", "reduce ompi_basic_linear collective", (void*)reduce__ompi_basic_linear},
+    {"ompi_in_order_binary", "reduce ompi_in_order_binary collective", (void*)reduce__ompi_in_order_binary},
+    {"ompi_binary", "reduce ompi_binary collective", (void*)reduce__ompi_binary},
+    {"ompi_binomial", "reduce ompi_binomial collective", (void*)reduce__ompi_binomial},
+    {"mpich", "reduce mpich collective", (void*)reduce__mpich},
+    {"mvapich2", "reduce mvapich2 collective", (void*)reduce__mvapich2},
+    {"mvapich2_knomial", "reduce mvapich2_knomial collective", (void*)reduce__mvapich2_knomial},
+    {"mvapich2_two_level", "reduce mvapich2_two_level collective", (void*)reduce__mvapich2_two_level},
+    {"impi", "reduce impi collective", (void*)reduce__impi},
+    {"rab", "reduce rab collective", (void*)reduce__rab},
+    {"automatic", "reduce automatic collective", (void*)reduce__automatic},
+    {"", "", nullptr}};
 
 // Needed by the automatic selector weird implementation
 s_mpi_coll_description_t* colls::get_smpi_coll_description(const char* name, int rank)
@@ -128,17 +304,15 @@ int (*colls::barrier)(MPI_Comm comm);
 
 void (*colls::smpi_coll_cleanup_callback)();
 
-void colls::set_gather(const std::string& name)
-{
-  int id = find_coll_description(mpi_coll_gather_description, name, "gather");
-  gather = reinterpret_cast<int(*)(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)>(mpi_coll_gather_description[id].coll);
-  if (gather == nullptr)
-    xbt_die("Collective gather set to nullptr!");
-}
-
-//COLL_APPLY(COLL_SETTER,COLL_GATHER_SIG,"");
+#define COLL_SETTER(cat, ret, args, args2)                                                                             \
+  void colls::_XBT_CONCAT(set_, cat)(const std::string& name)                                                          \
+  {                                                                                                                    \
+    int id = find_coll_description(_XBT_CONCAT3(mpi_coll_, cat, _description), name, _XBT_STRINGIFY(cat));             \
+    cat    = reinterpret_cast<ret(*) args>(_XBT_CONCAT3(mpi_coll_, cat, _description)[id].coll);                       \
+    if (cat == nullptr)                                                                                                \
+      xbt_die("Collective " _XBT_STRINGIFY(cat) " set to nullptr!");                                                   \
+  }
+COLL_APPLY(COLL_SETTER, COLL_GATHER_SIG, "");
 COLL_APPLY(COLL_SETTER,COLL_ALLGATHER_SIG,"");
 COLL_APPLY(COLL_SETTER,COLL_ALLGATHERV_SIG,"");
 COLL_APPLY(COLL_SETTER,COLL_REDUCE_SIG,"");
index 04378c6..778222c 100644 (file)
@@ -1,6 +1,5 @@
-/*High level handling of collective algorithms*/
-/* Copyright (c) 2009-2019. The SimGrid Team.
- * All rights reserved.                                                     */
+/* High level handling of collective algorithms */
+/* Copyright (c) 2009-2019. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 /** @brief MPI collective description */
 
 #define COLL_DEFS(cat, ret, args, args2)                                                                               \
-  void _XBT_CONCAT(set_, cat)(const std::string& name);                                                                \
   extern int(*cat) args;
 
 #define COLL_SIG(cat, ret, args, args2) int cat args;
 
-#define COLL_DESCRIPTION(cat, ret, args, name)                                                                         \
-  {                                                                                                                    \
-    _XBT_STRINGIFY(name)                                                                                               \
-    , _XBT_STRINGIFY(cat) " " _XBT_STRINGIFY(name) " collective", (void*)_XBT_CONCAT3(cat, __, name)        \
-  }
-
-#define COLL_PROTO(cat, ret, args, name)                                                                               \
-  ret _XBT_CONCAT3(cat, __, name) args;
-
 #define COLL_UNPAREN(...)  __VA_ARGS__
-
 #define COLL_APPLY(action, sig, name) action(sig, name)
-#define COLL_COMMA ,
-#define COLL_NOsep
-#define COLL_NOTHING(...)
-
-#define COLL_GATHER_SIG gather, int, \
-                      (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, \
-                      (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, \
-                      (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, \
-                     (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, \
-                     (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, \
-                   (const void *buf, void *rbuf, int count, MPI_Datatype datatype, \
-                        MPI_Op op, int root, MPI_Comm comm)
-#define COLL_ALLREDUCE_SIG allreduce, int, \
-                      (const void *sbuf, void *rbuf, int rcount, \
-                           MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
-#define COLL_REDUCE_SCATTER_SIG reduce_scatter, int, \
-                      (const void *sbuf, void *rbuf, const int *rcounts,\
-                    MPI_Datatype dtype,MPI_Op  op,MPI_Comm  comm)
-#define COLL_SCATTER_SIG scatter, int, \
-                (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, \
-                (MPI_Comm comm)
 
-namespace simgrid{
-namespace smpi{
+#define COLL_GATHER_SIG gather, int,                                                                                   \
+    (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,                                                                             \
+    (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,                                                                           \
+    (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,                                                                               \
+    (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,                                                                             \
+    (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,                                                                                   \
+    (const void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
+#define COLL_ALLREDUCE_SIG allreduce, int,                                                                             \
+    (const void *sbuf, void *rbuf, int rcount,  MPI_Datatype dtype, MPI_Op op, MPI_Comm comm)
+#define COLL_REDUCE_SCATTER_SIG reduce_scatter, int,                                                                   \
+    (const void *sbuf, void *rbuf, const int *rcounts, MPI_Datatype dtype,MPI_Op  op,MPI_Comm  comm)
+#define COLL_SCATTER_SIG scatter, int,                                                                                 \
+    (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,                                                                                 \
+    (MPI_Comm comm)
+
+namespace simgrid {
+namespace smpi {
 
 struct s_mpi_coll_description_t {
   std::string name;
@@ -89,8 +63,19 @@ XBT_PUBLIC int find_coll_description(s_mpi_coll_description_t* table, const std:
 void set_collectives();
 XBT_PUBLIC s_mpi_coll_description_t* get_smpi_coll_description(const char* name, int rank);
 
+void set_gather(const std::string& name);
+void set_allgather(const std::string& name);
+void set_allgatherv(const std::string& name);
+void set_reduce(const std::string& name);
+void set_allreduce(const std::string& name);
+void set_reduce_scatter(const std::string& name);
+void set_scatter(const std::string& name);
+void set_barrier(const std::string& name);
+void set_bcast(const std::string& name);
+void set_alltoall(const std::string& name);
+void set_alltoallv(const std::string& name);
+
 // for each collective type, create the set_* prototype, the description array and the function pointer
-//  void set_gather(const std::string& name);
 //  extern int(*gather)(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);
 COLL_APPLY(COLL_DEFS, COLL_GATHER_SIG, "")
@@ -155,9 +140,9 @@ int ialltoallw(const void* sendbuf, const int* sendcounts, const int* senddisps,
 extern void (*smpi_coll_cleanup_callback)();
 };
 
-/*************
- * GATHER *
- *************/
+/***********************************************
+ * Prototypes of each and every implementation *
+ ***********************************************/
 
 int gather__default(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);
 int gather__ompi(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);
@@ -170,21 +155,6 @@ int gather__mvapich2_two_level(const void *send_buff, int send_count, MPI_Dataty
 int gather__impi(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);
 int gather__automatic(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_GATHERS(action, COLL_sep) \
-COLL_APPLY(action, COLL_GATHER_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, ompi_basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, ompi_binomial) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, ompi_linear_sync) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, mvapich2_two_level) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_GATHER_SIG, automatic)
-
-/*************
- * ALLGATHER *
- *************/
 int allgather__default(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 allgather__2dmesh(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 allgather__3dmesh(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm);
@@ -208,49 +178,6 @@ int allgather__mpich(const void *send_buff, int send_count, MPI_Datatype send_ty
 int allgather__impi(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 allgather__automatic(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_ALLGATHERS(action, COLL_sep) \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, 2dmesh) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, 3dmesh) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, bruck) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, GB) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, loosely_lr) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, NTSLR) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, NTSLR_NB) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, pair) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, rhv) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, ring) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, SMP_NTS) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, smp_simple) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, spreading_simple) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, ompi_neighborexchange) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, mvapich2_smp) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHER_SIG, automatic)
-
-/**************
- * ALLGATHERV *
- **************/
-
-#define COLL_ALLGATHERVS(action, COLL_sep) \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, GB) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, pair) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, ring) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi_neighborexchange) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, ompi_bruck) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich_rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, mpich_ring) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_ALLGATHERV_SIG, automatic)
-
 int allgatherv__default(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);
 int allgatherv__GB(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);
 int allgatherv__pair(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);
@@ -265,34 +192,6 @@ int allgatherv__mvapich2(const void *send_buff, int send_count, MPI_Datatype sen
 int allgatherv__impi(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);
 int allgatherv__automatic(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);
 
-/*************
- * ALLREDUCE *
- *************/
-
-#define COLL_ALLREDUCES(action, COLL_sep) \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, lr) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab1) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab2) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab_rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_binomial) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_binomial_pipeline) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rsag) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rsag_lr) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, smp_rsag_rab) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, redbcast) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, ompi_ring_segmented) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, mvapich2_rs) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, mvapich2_two_level) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, rab) COLL_sep \
-COLL_APPLY(action, COLL_ALLREDUCE_SIG, automatic)
-
 int allreduce__default(const void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm);
 int allreduce__lr(const void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm);
 int allreduce__rab1(const void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm);
@@ -316,33 +215,6 @@ int allreduce__impi(const void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype
 int allreduce__rab(const void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm);
 int allreduce__automatic(const void *sbuf, void *rbuf, int rcount, MPI_Datatype dtype, MPI_Op op, MPI_Comm comm);
 
-/************
- * ALLTOALL *
- ************/
-
-#define COLL_ALLTOALLS(action, COLL_sep) \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, 2dmesh) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, 3dmesh) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, bruck) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, pair) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_rma) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_light_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_mpi_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, pair_one_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, rdb) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, ring) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_light_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_mpi_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, ring_one_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, mvapich2_scatter_dest) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALL_SIG, automatic)
-
 int alltoall__default(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 alltoall__2dmesh(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 alltoall__3dmesh(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm);
@@ -365,28 +237,6 @@ int alltoall__mpich(const void *send_buff, int send_count, MPI_Datatype send_typ
 int alltoall__impi(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 alltoall__automatic(const void *send_buff, int send_count, MPI_Datatype send_type, void *recv_buff, int recv_count, MPI_Datatype recv_type, MPI_Comm comm);
 
-/*************
- * ALLTOALLV *
- *************/
-
-#define COLL_ALLTOALLVS(action, COLL_sep) \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, bruck) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair_light_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair_mpi_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, pair_one_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_light_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_mpi_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ring_one_barrier) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, ompi_basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_ALLTOALLV_SIG, automatic)
-
 int alltoallv__default(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);
 int alltoallv__bruck(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);
 int alltoallv__pair(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);
@@ -404,37 +254,6 @@ int alltoallv__mvapich2(const void *send_buff, const int *send_counts, const int
 int alltoallv__impi(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);
 int alltoallv__automatic(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);
 
-/*********
- * BCAST *
- *********/
-
-#define COLL_BCASTS(action, COLL_sep) \
-COLL_APPLY(action, COLL_BCAST_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, arrival_pattern_aware) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, arrival_pattern_aware_wait) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, arrival_scatter) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, binomial_tree) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, flattree) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, flattree_pipeline) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, NTSB) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, NTSL) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, NTSL_Isend) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, scatter_LR_allgather) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, scatter_rdb_allgather) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, SMP_binary) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, SMP_binomial) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, SMP_linear) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, ompi_split_bintree) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, ompi_pipeline) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mvapich2)   COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mvapich2_inter_node)   COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mvapich2_intra_node)   COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, mvapich2_knomial_intra_node)   COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, impi)   COLL_sep \
-COLL_APPLY(action, COLL_BCAST_SIG, automatic)
-
 int bcast__default(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
 int bcast__arrival_pattern_aware(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
 int bcast__arrival_pattern_aware_wait(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
@@ -461,32 +280,6 @@ int bcast__mvapich2_knomial_intra_node(void *buf, int count, MPI_Datatype dataty
 int bcast__impi(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
 int bcast__automatic(void *buf, int count, MPI_Datatype datatype, int root, MPI_Comm comm);
 
-/**********
- * REDUCE *
- **********/
-
-#define COLL_REDUCES(action, COLL_sep) \
-COLL_APPLY(action, COLL_REDUCE_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, arrival_pattern_aware) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, binomial) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, flat_tree) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, NTSL) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, scatter_gather) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_chain) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_pipeline) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_in_order_binary) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_binary) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, ompi_binomial) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, mvapich2_knomial) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, mvapich2_two_level) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, rab) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SIG, automatic)
-
 int reduce__default(const void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
 int reduce__arrival_pattern_aware(const void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
 int reduce__binomial(const void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
@@ -508,23 +301,6 @@ int reduce__impi(const void *buf, void *rbuf, int count, MPI_Datatype datatype,
 int reduce__rab(const void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
 int reduce__automatic(const void *buf, void *rbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm);
 
-/*************
- * REDUCE_SCATTER *
- *************/
-
-#define COLL_REDUCE_SCATTERS(action, COLL_sep) \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, ompi_basic_recursivehalving) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, ompi_ring)  COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_pair) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_rdb) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mpich_noncomm) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, mvapich2) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, impi) COLL_sep \
-COLL_APPLY(action, COLL_REDUCE_SCATTER_SIG, automatic)
-
 int reduce_scatter__default(const void *sbuf, void *rbuf, const int *rcounts, MPI_Datatype dtype,MPI_Op  op,MPI_Comm  comm);
 int reduce_scatter__ompi(const void *sbuf, void *rbuf, const int *rcounts, MPI_Datatype dtype,MPI_Op  op,MPI_Comm  comm);
 int reduce_scatter__ompi_basic_recursivehalving(const void *sbuf, void *rbuf, const int *rcounts, MPI_Datatype dtype,MPI_Op  op,MPI_Comm  comm);
@@ -537,22 +313,6 @@ int reduce_scatter__mvapich2(const void *sbuf, void *rbuf, const int *rcounts, M
 int reduce_scatter__impi(const void *sbuf, void *rbuf, const int *rcounts, MPI_Datatype dtype,MPI_Op  op,MPI_Comm  comm);
 int reduce_scatter__automatic(const void *sbuf, void *rbuf, const int *rcounts, MPI_Datatype dtype,MPI_Op  op,MPI_Comm  comm);
 
-/*************
- * SCATTER *
- *************/
-
-#define COLL_SCATTERS(action, COLL_sep) \
-COLL_APPLY(action, COLL_SCATTER_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, ompi_basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, ompi_binomial)  COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, mpich)   COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, mvapich2)   COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, mvapich2_two_level_binomial)   COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, mvapich2_two_level_direct)   COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, impi)   COLL_sep \
-COLL_APPLY(action, COLL_SCATTER_SIG, automatic)
-
 int scatter__default(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
 int scatter__ompi(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
 int scatter__ompi_basic_linear(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
@@ -564,26 +324,6 @@ int scatter__mvapich2_two_level_direct(const void *sendbuf, int sendcount, MPI_D
 int scatter__impi (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
 int scatter__automatic (const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm);
 
-/*************
- * BARRIER *
- *************/
-
-#define COLL_BARRIERS(action, COLL_sep) \
-COLL_APPLY(action, COLL_BARRIER_SIG, default) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_basic_linear) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_two_procs)  COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_tree)  COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_bruck)  COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_recursivedoubling) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, ompi_doublering) COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, mpich_smp)   COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, mpich)   COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, mvapich2_pair)   COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, mvapich2)   COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, impi)   COLL_sep \
-COLL_APPLY(action, COLL_BARRIER_SIG, automatic)
-
 int barrier__default(MPI_Comm comm);
 int barrier__ompi(MPI_Comm comm);
 int barrier__ompi_basic_linear(MPI_Comm comm);
index b350536..bbafaa5 100644 (file)
@@ -157,6 +157,14 @@ set(SMPI_SRC
   src/smpi/bindings/smpi_f77_comm.cpp
   src/smpi/bindings/smpi_f77_request.cpp
   src/smpi/bindings/smpi_f77_type.cpp
+  src/smpi/colls/smpi_coll.cpp
+  src/smpi/colls/smpi_nbc_impl.cpp
+  src/smpi/colls/smpi_automatic_selector.cpp
+  src/smpi/colls/smpi_default_selector.cpp
+  src/smpi/colls/smpi_mpich_selector.cpp
+  src/smpi/colls/smpi_intel_mpi_selector.cpp
+  src/smpi/colls/smpi_openmpi_selector.cpp
+  src/smpi/colls/smpi_mvapich2_selector.cpp
   src/smpi/colls/allgather/allgather-2dmesh.cpp
   src/smpi/colls/allgather/allgather-3dmesh.cpp
   src/smpi/colls/allgather/allgather-GB.cpp
@@ -256,14 +264,6 @@ set(SMPI_SRC
   src/smpi/colls/reduce/reduce-rab.cpp
   src/smpi/colls/scatter/scatter-ompi.cpp
   src/smpi/colls/scatter/scatter-mvapich-two-level.cpp
-  src/smpi/colls/smpi_nbc_impl.cpp
-  src/smpi/colls/smpi_automatic_selector.cpp
-  src/smpi/colls/smpi_default_selector.cpp
-  src/smpi/colls/smpi_mpich_selector.cpp
-  src/smpi/colls/smpi_intel_mpi_selector.cpp
-  src/smpi/colls/smpi_openmpi_selector.cpp
-  src/smpi/colls/smpi_mvapich2_selector.cpp
-  src/smpi/colls/smpi_coll.cpp
   )
 
 set(XBT_SRC