]> AND Public Git Repository - simgrid.git/blobdiff - src/simgrid/sg_config.c
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove c surf files
[simgrid.git] / src / simgrid / sg_config.c
index 420f3811825ed78cc3eba8ad50dadcf62d8e94ba..56c1120c255e1851dc90971bf7794cc933ceca62 100644 (file)
@@ -247,6 +247,9 @@ static void _sg_cfg_cb__coll(const char *category,
   /* New Module missing */
   find_coll_description(table, val);
 }
+static void _sg_cfg_cb__coll_gather(const char *name, int pos){
+  _sg_cfg_cb__coll("gather", mpi_coll_gather_description, name, pos);
+}
 static void _sg_cfg_cb__coll_allgather(const char *name, int pos){
   _sg_cfg_cb__coll("allgather", mpi_coll_allgather_description, name, pos);
 }
@@ -273,6 +276,15 @@ static void _sg_cfg_cb__coll_reduce(const char *name, int pos)
 {
   _sg_cfg_cb__coll("reduce", mpi_coll_reduce_description, name, pos);  
 }
+static void _sg_cfg_cb__coll_reduce_scatter(const char *name, int pos){
+  _sg_cfg_cb__coll("reduce_scatter", mpi_coll_reduce_scatter_description, name, pos);
+}
+static void _sg_cfg_cb__coll_scatter(const char *name, int pos){
+  _sg_cfg_cb__coll("scatter", mpi_coll_scatter_description, name, pos);
+}
+static void _sg_cfg_cb__coll_barrier(const char *name, int pos){
+  _sg_cfg_cb__coll("barrier", mpi_coll_barrier_description, name, pos);
+}
 #endif
 
 /* callback of the inclusion path */
@@ -359,11 +371,6 @@ static void _sg_cfg_cb__surf_network_coordinates(const char *name,
       xbt_die("Setting of whether to use coordinate cannot be disabled once set.");
 }
 
-static void _sg_cfg_cb_surf_nthreads(const char *name, int pos)
-{
-  surf_set_nthreads(xbt_cfg_get_int(_sg_cfg_set, name));
-}
-
 static void _sg_cfg_cb__surf_network_crosstraffic(const char *name,
                                                   int pos)
 {
@@ -433,23 +440,6 @@ void sg_config_init(int *argc, char **argv)
                      &default_value, 1, 1, &_sg_cfg_cb__storage_mode,
                      NULL);
 
-    /* ********************************************************************* */
-    /* TUTORIAL: New model                                                   */
-    sprintf(description,
-            "The model to use for the New model. Possible values: ");
-    p = description;
-    while (*(++p) != '\0');
-    for (i = 0; surf_new_model_description[i].name; i++)
-      p += sprintf(p, "%s%s", (i == 0 ? "" : ", "),
-                   surf_new_model_description[i].name);
-    sprintf(p,
-            ".\n       (use 'help' as a value to see the long description of each model)");
-    default_value = xbt_strdup("default");
-    xbt_cfg_register(&_sg_cfg_set, "new_model/model", description, xbt_cfgelm_string,
-                     &default_value, 1, 1, &_sg_cfg_cb__storage_mode,
-                     NULL);
-    /* ********************************************************************* */
-
     sprintf(description,
             "The model to use for the network. Possible values: ");
     p = description;
@@ -652,13 +642,6 @@ void sg_config_init(int *argc, char **argv)
         xbt_cfgelm_string, &default_value, 1, 1,
         _sg_cfg_cb_contexts_parallel_mode, NULL);
 
-    /* number of parallel threads for Surf */
-    default_value_int = surf_get_nthreads();
-    xbt_cfg_register(&_sg_cfg_set, "surf/nthreads",
-                     "Number of parallel threads used to update Surf models",
-                     xbt_cfgelm_int, &default_value_int, 1, 1,
-                     _sg_cfg_cb_surf_nthreads, NULL);
-
     default_value = xbt_strdup("no");
     xbt_cfg_register(&_sg_cfg_set, "network/coordinates",
                      "\"yes\" or \"no\", specifying whether we use a coordinate-based routing (as Vivaldi)",
@@ -766,46 +749,64 @@ void sg_config_init(int *argc, char **argv)
                      xbt_cfgelm_double, &default_iprobe_time, 1, 1, NULL,
                      NULL);
     default_value = xbt_strdup("default");
+    xbt_cfg_register(&_sg_cfg_set, "smpi/coll_selector",
+                    "Which collective selector to use",
+                    xbt_cfgelm_string, &default_value, 1, 1, NULL,
+                    NULL);
+                    
+               xbt_cfg_register(&_sg_cfg_set, "smpi/gather",
+                    "Which collective to use for gather",
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_gather,
+                    NULL);
+                    
     xbt_cfg_register(&_sg_cfg_set, "smpi/allgather",
                     "Which collective to use for allgather",
-                    xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_allgather,
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allgather,
+                    NULL);
+
+    xbt_cfg_register(&_sg_cfg_set, "smpi/barrier",
+                    "Which collective to use for barrier",
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_barrier,
+                    NULL);
+
+    xbt_cfg_register(&_sg_cfg_set, "smpi/reduce_scatter",
+                    "Which collective to use for reduce_scatter",
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_reduce_scatter,
+                    NULL);
+
+    xbt_cfg_register(&_sg_cfg_set, "smpi/scatter",
+                    "Which collective to use for scatter",
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_scatter,
                     NULL);
 
-    default_value = xbt_strdup("default");
     xbt_cfg_register(&_sg_cfg_set, "smpi/allgatherv",
                     "Which collective to use for allgatherv",
-                    xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_allgatherv,
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allgatherv,
                     NULL);
 
-    default_value = xbt_strdup("default");
     xbt_cfg_register(&_sg_cfg_set, "smpi/allreduce",
                     "Which collective to use for allreduce",
-                    xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_allreduce,
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_allreduce,
                     NULL);
 
-    default_value = xbt_strdup("ompi");
     xbt_cfg_register(&_sg_cfg_set, "smpi/alltoall",
                     "Which collective to use for alltoall",
-                    xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_alltoall,
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_alltoall,
                     NULL);
 
-    default_value = xbt_strdup("default");
     xbt_cfg_register(&_sg_cfg_set, "smpi/alltoallv",
                     "Which collective to use for alltoallv",
-                    xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_alltoallv,
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_alltoallv,
                     NULL);
 
-    default_value = xbt_strdup("default");
     xbt_cfg_register(&_sg_cfg_set, "smpi/bcast",
                     "Which collective to use for bcast",
-                    xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_bcast,
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_bcast,
                     NULL);
 
-
-    default_value = xbt_strdup("default");
     xbt_cfg_register(&_sg_cfg_set, "smpi/reduce",
                     "Which collective to use for reduce",
-                    xbt_cfgelm_string, &default_value, 1, 1, &_sg_cfg_cb__coll_reduce,
+                    xbt_cfgelm_string, NULL, 1, 1, &_sg_cfg_cb__coll_reduce,
                     NULL);
 #endif // HAVE_SMPI
 
@@ -902,15 +903,6 @@ void surf_config_models_setup()
   storage_id = find_model_description(surf_storage_model_description, storage_model_name);
   surf_storage_model_description[storage_id].model_init_preparse();
 
-  /* ********************************************************************* */
-  /* TUTORIAL: New model                                                   */
-  int new_model_id = -1;
-  char *new_model_name = NULL;
-  new_model_name = xbt_cfg_get_string(_sg_cfg_set, "new_model/model");
-  XBT_DEBUG("Call new model_init");
-  new_model_id = find_model_description(surf_new_model_description, new_model_name);
-  surf_new_model_description[new_model_id].model_init_preparse();
-  /* ********************************************************************* */
 }
 
 int sg_cfg_get_int(const char* name)