Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add a flag --cfg=contexts/parallel_threshold:n
[simgrid.git] / src / surf / surf_config.c
index 5227d67..e98f304 100644 (file)
@@ -204,6 +204,11 @@ static void _surf_cfg_cb_contexts_nthreads(const char *name, int pos)
   SIMIX_context_set_nthreads(xbt_cfg_get_int(_surf_cfg_set, name));
 }
 
+static void _surf_cfg_cb_contexts_parallel_threshold(const char *name, int pos)
+{
+  SIMIX_context_set_parallel_threshold(xbt_cfg_get_int(_surf_cfg_set, name));
+}
+
 static void _surf_cfg_cb__surf_network_fullduplex(const char *name,
                                                   int pos)
 {
@@ -365,6 +370,13 @@ void surf_config_init(int *argc, char **argv)
                      xbt_cfgelm_int, &default_value_int, 1, 1,
                      _surf_cfg_cb_contexts_nthreads, NULL);
 
+    /* minimal number of user contexts to be run in parallel */
+    default_value_int = 20;
+    xbt_cfg_register(&_surf_cfg_set, "contexts/parallel_threshold",
+        "Minimal number of user contexts to be run in parallel",
+        xbt_cfgelm_int, &default_value_int, 1, 1,
+        _surf_cfg_cb_contexts_parallel_threshold, NULL);
+
     default_value_int = 0;
     xbt_cfg_register(&_surf_cfg_set, "fullduplex",
                      "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM03)",