X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8a47028116925fea959f95bfe881618489658231..1ca4af8de22da143013582d8926db3282bfbd8b1:/src/surf/surf_config.c diff --git a/src/surf/surf_config.c b/src/surf/surf_config.c index c8641fb619..ad2b55e52d 100644 --- a/src/surf/surf_config.c +++ b/src/surf/surf_config.c @@ -252,6 +252,11 @@ static void _surf_cfg_cb_contexts_parallel_mode(const char *name, int pos) } } +static void _surf_cfg_cb_surf_nthreads(const char *name, int pos) +{ + surf_set_nthreads(xbt_cfg_get_int(_surf_cfg_set, name)); +} + static void _surf_cfg_cb__surf_network_coordinates(const char *name, int pos) { @@ -469,7 +474,7 @@ void surf_config_init(int *argc, char **argv) xbt_cfgelm_int, &default_value_int, 1, 1, _surf_cfg_cb_contexts_parallel_threshold, NULL); - /* minimal number of user contexts to be run in parallel */ + /* synchronization mode for parallel user contexts */ #ifdef HAVE_FUTEX_H default_value = xbt_strdup("futex"); #else //No futex on mac and posix is unimplememted yet @@ -480,6 +485,13 @@ void surf_config_init(int *argc, char **argv) xbt_cfgelm_string, &default_value, 1, 1, _surf_cfg_cb_contexts_parallel_mode, NULL); + /* number of parallel threads for Surf */ + default_value_int = surf_get_nthreads(); + xbt_cfg_register(&_surf_cfg_set, "surf/nthreads", + "Number of parallel threads used to update Surf models", + xbt_cfgelm_int, &default_value_int, 1, 1, + _surf_cfg_cb_surf_nthreads, NULL); + default_value = xbt_strdup("no"); xbt_cfg_register(&_surf_cfg_set, "network/coordinates", "\"yes\" or \"no\", specifying whether we use a coordinate-based routing (as Vivaldi)", @@ -534,6 +546,11 @@ void surf_config_init(int *argc, char **argv) xbt_cfgelm_double, &default_threshold, 1, 1, NULL, NULL); + //For smpi/bw_factor and smpi/lat_factor + //Default value have to be "threshold0:value0;threshold1:value1;...;thresholdN:valueN" + //test is if( size >= thresholdN ) return valueN; + //Values can be modified with command line --cfg=smpi/bw_factor:"threshold0:value0;threshold1:value1;...;thresholdN:valueN" + // or with tag config put line xbt_cfg_register(&_surf_cfg_set, "smpi/bw_factor", "Bandwidth factors for smpi.", xbt_cfgelm_string, NULL, 1, 1, NULL,