-char* smx_context_factory_name = NULL; /* factory name specified by --cfg=contexts/factory:value */
-int smx_context_stack_size;
-int smx_context_stack_size_was_set = 0;
-int smx_context_guard_size;
-int smx_context_guard_size_was_set = 0;
-#if HAVE_THREAD_LOCAL_STORAGE
-static XBT_THREAD_LOCAL smx_context_t smx_current_context_parallel;
-#else
-static xbt_os_thread_key_t smx_current_context_key = 0;
-#endif
-static smx_context_t smx_current_context_serial;
-static int smx_parallel_contexts = 1;
-static int smx_parallel_threshold = 2;
-static e_xbt_parmap_mode_t smx_parallel_synchronization_mode = XBT_PARMAP_DEFAULT;
-
-/**
- * This function is called by SIMIX_global_init() to initialize the context module.
- */
-void SIMIX_context_mod_init(void)
-{
-#if HAVE_THREAD_CONTEXTS && !HAVE_THREAD_LOCAL_STORAGE
- /* the __thread storage class is not available on this platform:
- * use getspecific/setspecific instead to store the current context in each thread */
- xbt_os_thread_key_create(&smx_current_context_key);
-#endif
- if (!simix_global->context_factory) {
- /* select the context factory to use to create the contexts */
- if (simgrid::simix::factory_initializer)
- simix_global->context_factory = simgrid::simix::factory_initializer();
- else { /* use the factory specified by --cfg=contexts/factory:value */
-#if HAVE_THREAD_CONTEXTS
- if (!strcmp(smx_context_factory_name, "thread"))
- simix_global->context_factory = simgrid::simix::thread_factory();
-#else
- if (0);
-#endif
-#if HAVE_UCONTEXT_CONTEXTS
- else if (!strcmp(smx_context_factory_name, "ucontext"))
- simix_global->context_factory = simgrid::simix::sysv_factory();
-#endif
-#if HAVE_RAW_CONTEXTS
- else if (!strcmp(smx_context_factory_name, "raw"))
- simix_global->context_factory = simgrid::simix::raw_factory();
-#endif
-#if HAVE_BOOST_CONTEXTS
- else if (!strcmp(smx_context_factory_name, "boost"))
- simix_global->context_factory = simgrid::simix::boost_factory();
-#endif
- else {
- XBT_ERROR("Invalid context factory specified. Valid factories on this machine:");