From: thiery Date: Tue, 1 Feb 2011 09:15:46 +0000 (+0000) Subject: Rename flag cfg=contexts/parallel to cfg=contexts/nthreads X-Git-Tag: v3.6_beta2~385 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ec86e827d8bb67988913e0658155b2fa4fbd7ac6 Rename flag cfg=contexts/parallel to cfg=contexts/nthreads git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9544 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/simix/context.h b/include/simix/context.h index 0ba2a6c1d5..e51262dd6d 100644 --- a/include/simix/context.h +++ b/include/simix/context.h @@ -91,8 +91,8 @@ smx_context_t smx_ctx_base_self(void); void *smx_ctx_base_get_data(smx_context_t context); /* parallelism */ -void SIMIX_context_set_parallel_threads(int nb_threads); -int SIMIX_context_get_parallel_threads(void); +void SIMIX_context_set_nthreads(int nb_threads); +int SIMIX_context_get_nthreads(void); int SIMIX_context_is_parallel(void); SG_END_DECL() diff --git a/src/simix/smx_context.c b/src/simix/smx_context.c index c2bf12d475..9515444091 100644 --- a/src/simix/smx_context.c +++ b/src/simix/smx_context.c @@ -76,7 +76,7 @@ void SIMIX_context_mod_exit(void) * * \param nb_threads the number of threads to use */ -void SIMIX_context_set_parallel_threads(int nb_threads) { +void SIMIX_context_set_nthreads(int nb_threads) { xbt_assert1(nb_threads > 0, "Invalid number of parallel threads: %d", nb_threads); smx_parallel_contexts = nb_threads; @@ -87,7 +87,7 @@ void SIMIX_context_set_parallel_threads(int nb_threads) { * for the user contexts. * \return the number of threads (1 means no parallelism) */ -int SIMIX_context_get_parallel_threads() { +int SIMIX_context_get_nthreads() { return smx_parallel_contexts; } diff --git a/src/surf/surf_config.c b/src/surf/surf_config.c index eceaaa7fb0..5227d675f2 100644 --- a/src/surf/surf_config.c +++ b/src/surf/surf_config.c @@ -199,9 +199,9 @@ static void _surf_cfg_cb_context_stack_size(const char *name, int pos) smx_context_stack_size = xbt_cfg_get_int(_surf_cfg_set, name) * 1024; } -static void _surf_cfg_cb_parallel_contexts(const char *name, int pos) +static void _surf_cfg_cb_contexts_nthreads(const char *name, int pos) { - SIMIX_context_set_parallel_threads(xbt_cfg_get_int(_surf_cfg_set, name)); + SIMIX_context_set_nthreads(xbt_cfg_get_int(_surf_cfg_set, name)); } static void _surf_cfg_cb__surf_network_fullduplex(const char *name, @@ -360,10 +360,10 @@ void surf_config_init(int *argc, char **argv) /* number of parallel threads for user processes */ default_value_int = 1; - xbt_cfg_register(&_surf_cfg_set, "contexts/parallel", + xbt_cfg_register(&_surf_cfg_set, "contexts/nthreads", "Number of parallel threads for user contexts (EXPERIMENTAL)", xbt_cfgelm_int, &default_value_int, 1, 1, - _surf_cfg_cb_parallel_contexts, NULL); + _surf_cfg_cb_contexts_nthreads, NULL); default_value_int = 0; xbt_cfg_register(&_surf_cfg_set, "fullduplex",