Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Prefer the raw context to the ucontext by default.
authorNavarrop <Pierre.Navarro@imag.fr>
Tue, 28 Jun 2011 13:51:02 +0000 (15:51 +0200)
committerNavarrop <Pierre.Navarro@imag.fr>
Tue, 28 Jun 2011 13:51:02 +0000 (15:51 +0200)
buildtools/Cmake/gras_config.h.in
src/simix/smx_context.c

index 32496ee..c58ef93 100644 (file)
 #cmakedefine PROCESSOR_i686 @PROCESSOR_i686@
 #cmakedefine PROCESSOR_x86_64 @PROCESSOR_x86_64@
 #cmakedefine CMAKE_SYSTEM_PROCESSOR @CMAKE_SYSTEM_PROCESSOR@
+#cmakedefine HAVE_RAWCTX @HAVE_RAWCTX@
 
 /* Defined if arrays in struct can straddle struct alignment boundaries. This
    is like than the structure compaction above, but this time, the argument to
index ca29ef5..9fc1b5d 100644 (file)
@@ -43,15 +43,17 @@ void SIMIX_context_mod_init(void)
     }
     else { /* use the factory specified by --cfg=contexts/factory:value */
 
-      if (smx_context_factory_name == NULL) {
+    if (smx_context_factory_name == NULL) {
         /* use the default factory */
-#ifdef CONTEXT_UCONTEXT
-        SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
-#else
-        SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
-#endif
-      }
-      else if (!strcmp(smx_context_factory_name, "ucontext")) {
+       #ifdef HAVE_RAWCTX
+       SIMIX_ctx_raw_factory_init(&simix_global->context_factory);
+       #elif CONTEXT_UCONTEXT
+               SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);
+       #else
+               SIMIX_ctx_thread_factory_init(&simix_global->context_factory);
+       #endif
+    }
+    else if (!strcmp(smx_context_factory_name, "ucontext")) {
         /* use ucontext */
 #ifdef CONTEXT_UCONTEXT
         SIMIX_ctx_sysv_factory_init(&simix_global->context_factory);