Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix default context factory.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 1 Oct 2013 13:18:13 +0000 (15:18 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 1 Oct 2013 13:18:24 +0000 (15:18 +0200)
src/simgrid/sg_config.c
src/simix/smx_context.c

index 1b188b5..994bc19 100644 (file)
@@ -602,13 +602,9 @@ void sg_config_init(int *argc, char **argv)
 
     /* context factory */
     xbt_cfg_register(&_sg_cfg_set, "contexts/factory",
 
     /* context factory */
     xbt_cfg_register(&_sg_cfg_set, "contexts/factory",
-                     "Context factory to use in SIMIX (ucontext, thread or raw)",
+                     "Context factory to use in SIMIX (default, ucontext, thread or raw)",
                      xbt_cfgelm_string, 1, 1, _sg_cfg_cb_context_factory, NULL);
                      xbt_cfgelm_string, 1, 1, _sg_cfg_cb_context_factory, NULL);
-#ifndef WIN32
-    xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/factory", "ucontext");
-#else
-    xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/factory", "raw");
-#endif
+    xbt_cfg_setdefault_string(_sg_cfg_set, "contexts/factory", "default");
 
     /* stack size of contexts in Ko */
     xbt_cfg_register(&_sg_cfg_set, "contexts/stack_size",
 
     /* stack size of contexts in Ko */
     xbt_cfg_register(&_sg_cfg_set, "contexts/stack_size",
index 791a73e..c05ef67 100644 (file)
@@ -48,7 +48,8 @@ void SIMIX_context_mod_init(void)
     }
     else { /* use the factory specified by --cfg=contexts/factory:value */
 
     }
     else { /* use the factory specified by --cfg=contexts/factory:value */
 
-    if (smx_context_factory_name == NULL) {
+    if (smx_context_factory_name == NULL ||
+        !strcmp(smx_context_factory_name, "default")) {
         /* use the default factory */
   #ifdef HAVE_RAWCTX
       SIMIX_ctx_raw_factory_init(&simix_global->context_factory);
         /* use the default factory */
   #ifdef HAVE_RAWCTX
       SIMIX_ctx_raw_factory_init(&simix_global->context_factory);