From: Augustin Degomme Date: Tue, 11 Mar 2014 14:30:35 +0000 (+0100) Subject: Change default stack size in simgrid to 8MiB. X-Git-Tag: v3_11~105^2~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5a37cda?hp=4731216138bf08c22c9e49157a217e4680b943e0 Change default stack size in simgrid to 8MiB. This should not really allocate the 8 MiB in RAM, thus occupating the same amount of real memory than before This behavior is at least true on Linux and BSD systems --- diff --git a/doc/doxygen/options.doc b/doc/doxygen/options.doc index b9ab520108..a30daea661 100644 --- a/doc/doxygen/options.doc +++ b/doc/doxygen/options.doc @@ -391,7 +391,7 @@ stacks), leading to segfaults with corrupted stack traces. If you want to push the scalability limits of your code, you really want to reduce the \b contexts/stack_size item. Its default value -is 128 (in KiB), while our Chord simulation works with stacks as small +is 8 (in MiB), while our Chord simulation works with stacks as small as 16 KiB, for example. For the thread factory, the default value is the one of the system, if it is too large/small, it has to be set with this parameter. diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index 37bb10968f..f9617c1452 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -654,7 +654,7 @@ void sg_config_init(int *argc, char **argv) xbt_cfg_register(&_sg_cfg_set, "contexts/stack_size", "Stack size of contexts in Kib", xbt_cfgelm_int, 1, 1, _sg_cfg_cb_context_stack_size, NULL); - xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/stack_size", 128); + xbt_cfg_setdefault_int(_sg_cfg_set, "contexts/stack_size", 8*1024); /* No, it was not set yet (the above setdefault() changed this to 1). */ smx_context_stack_size_was_set = 0; diff --git a/src/simix/smx_context.c b/src/simix/smx_context.c index 214ea7197a..85a8eca90e 100644 --- a/src/simix/smx_context.c +++ b/src/simix/smx_context.c @@ -19,7 +19,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_context, simix, char* smx_context_factory_name = NULL; /* factory name specified by --cfg=contexts/factory:value */ smx_ctx_factory_initializer_t smx_factory_initializer_to_use = NULL; -int smx_context_stack_size = 128 * 1024; +int smx_context_stack_size = 8 * 1024 * 1024; int smx_context_stack_size_was_set = 0; #ifdef HAVE_THREAD_LOCAL_STORAGE static __thread smx_context_t smx_current_context_parallel;