From: Navarrop Date: Tue, 28 Jun 2011 13:51:02 +0000 (+0200) Subject: Prefer the raw context to the ucontext by default. X-Git-Tag: v3_6_2~203^2~16^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/89cdc268b64c4e453f9e4bf4fc1c8defb8a1e331 Prefer the raw context to the ucontext by default. --- diff --git a/buildtools/Cmake/gras_config.h.in b/buildtools/Cmake/gras_config.h.in index 32496eea97..c58ef93b74 100644 --- a/buildtools/Cmake/gras_config.h.in +++ b/buildtools/Cmake/gras_config.h.in @@ -103,6 +103,7 @@ #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 diff --git a/src/simix/smx_context.c b/src/simix/smx_context.c index ca29ef5915..9fc1b5d3e7 100644 --- a/src/simix/smx_context.c +++ b/src/simix/smx_context.c @@ -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);