Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix a linking error in libgras. At least I hope since another issue prevents me from...
[simgrid.git] / src / surf / surf_config.c
index e0b90da..e54c58d 100644 (file)
@@ -9,13 +9,13 @@
 #include "xbt/config.h"
 #include "xbt/str.h"
 #include "surf/surf_private.h"
+#include "simix/context.h"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_config, surf,
                                 "About the configuration of surf (and the rest of the simulation)");
 
 xbt_cfg_t _surf_cfg_set = NULL;
 
-
 /* Parse the command line, looking for options */
 static void surf_config_cmd_line(int *argc, char **argv)
 {
@@ -179,7 +179,7 @@ static void _surf_cfg_cb__surf_path(const char *name, int pos)
 
 /* callback to decide if we want to use the model-checking */
 #include "xbt_modinter.h"
-int _surf_do_model_check = 0;   /* this variable is used accros the lib */
+extern int _surf_do_model_check;   /* this variable lives in xbt_main until I find a right location for it */
 
 static void _surf_cfg_cb_model_check(const char *name, int pos)
 {
@@ -189,11 +189,14 @@ static void _surf_cfg_cb_model_check(const char *name, int pos)
   xbt_dict_preinit();
 }
 
-int _surf_parallel_contexts = 0;
+static void _surf_cfg_cb_context_factory(const char *name, int pos)
+{
+  smx_context_factory_name = xbt_cfg_get_string(_surf_cfg_set, name);
+}
 
 static void _surf_cfg_cb_parallel_contexts(const char *name, int pos)
 {
-  _surf_parallel_contexts = 1;
+  smx_parallel_contexts = 1;
 }
 
 static void _surf_cfg_cb__surf_network_fullduplex(const char *name,
@@ -337,6 +340,12 @@ void surf_config_init(int *argc, char **argv)
        _surf_cfg_cb_model_check which sets it's value to 1 (instead of the defalut value 0)
        xbt_cfg_set_int(_surf_cfg_set, "model-check", default_value_int); */
 
+    /* context factory */
+    default_value = xbt_strdup("ucontext");
+    xbt_cfg_register(&_surf_cfg_set, "simix/context",
+                     "Context factory to use in SIMIX (ucontext, thread or raw)",
+                     xbt_cfgelm_string, &default_value, 1, 1, _surf_cfg_cb_context_factory, NULL);
+
     /* parallel contexts */
     default_value_int = 0;
     xbt_cfg_register(&_surf_cfg_set, "parallel-contexts",
@@ -346,7 +355,7 @@ void surf_config_init(int *argc, char **argv)
 
     default_value_int = 0;
     xbt_cfg_register(&_surf_cfg_set, "fullduplex",
-                     "Update the constraint set propagating recursively to others constraints",
+                     "Activate the interferences between uploads and downloads for fluid max-min models (LV08, CM03)",
                      xbt_cfgelm_int, &default_value_int, 0, 1,
                      _surf_cfg_cb__surf_network_fullduplex, NULL);
     xbt_cfg_set_int(_surf_cfg_set, "fullduplex", default_value_int);