From 89cdc268b64c4e453f9e4bf4fc1c8defb8a1e331 Mon Sep 17 00:00:00 2001 From: Navarrop Date: Tue, 28 Jun 2011 15:51:02 +0200 Subject: [PATCH 1/1] Prefer the raw context to the ucontext by default. --- buildtools/Cmake/gras_config.h.in | 1 + src/simix/smx_context.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) 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); -- 2.20.1