From 01ecfcab4e527aeb253b84ffda52fd73cabbd13c Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 5 Feb 2017 22:21:11 +0100 Subject: [PATCH] change the default value of maxmin/concurrency_limit to -1 (+cosmetics) --- doc/doxygen/options.doc | 6 ++++-- src/simgrid/sg_config.cpp | 8 +++----- src/surf/maxmin.cpp | 24 ++++++++++-------------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/doc/doxygen/options.doc b/doc/doxygen/options.doc index 596c5fa761..5fc516da3f 100644 --- a/doc/doxygen/options.doc +++ b/doc/doxygen/options.doc @@ -201,8 +201,10 @@ price of a reduced numerical precision. \subsection options_concurrency_limit Concurrency limit -The maximum number of variables in a system can be tuned through -the \b maxmin/concurrency_limit item (default value: 100). Setting a higher value can lift some limitations, such as the number of concurrent processes running on a single host. +The maximum number of variables per resource can be tuned through +the \b maxmin/concurrency_limit item (default value: -1, meaning no such limitation). +Setting a higher value can lift some limitations, such as the number of +concurrent processes running on a single host. \subsection options_model_network Configuring the Network model diff --git a/src/simgrid/sg_config.cpp b/src/simgrid/sg_config.cpp index 621ca12c0c..8ac7ca7e2b 100644 --- a/src/simgrid/sg_config.cpp +++ b/src/simgrid/sg_config.cpp @@ -384,17 +384,15 @@ void sg_config_init(int *argc, char **argv) simgrid::config::bindFlag(sg_tcp_gamma, { "network/TCP-gamma", "network/TCP_gamma" }, "Size of the biggest TCP window (cat /proc/sys/net/ipv4/tcp_[rw]mem for recv/send window; Use the last given value, which is the max window size)"); - sg_surf_precision = 0.00001; simgrid::config::bindFlag(sg_surf_precision, "surf/precision", "Numerical precision used when updating simulation times (in seconds)"); - sg_maxmin_precision = 0.00001; simgrid::config::bindFlag(sg_maxmin_precision, "maxmin/precision", - "Numerical precision used when computing resource sharing (in ops/sec or bytes/sec)"); + "Numerical precision used when computing resource sharing (in flops/sec or bytes/sec)"); - sg_concurrency_limit = 100; simgrid::config::bindFlag(sg_concurrency_limit, "maxmin/concurrency_limit", - "Maximum number of concurrent variables in the maxmim system. Also limits the number of processes on each host, at higher level"); + "Maximum number of concurrent variables in the maxmim system. Also limits the number of " + "processes on each host, at higher level. (default: -1 means no such limitation)"); /* The parameters of network models */ diff --git a/src/surf/maxmin.cpp b/src/surf/maxmin.cpp index 0c7d57a4dc..253ebd1ee5 100644 --- a/src/surf/maxmin.cpp +++ b/src/surf/maxmin.cpp @@ -22,9 +22,9 @@ typedef struct s_dyn_light { int size; } s_dyn_light_t, *dyn_light_t; -double sg_maxmin_precision = 0.00001; -double sg_surf_precision = 0.00001; -int sg_concurrency_limit= 100; +double sg_maxmin_precision = 0.00001; /* Change this with --cfg=maxmin/precision:VALUE */ +double sg_surf_precision = 0.00001; /* Change this with --cfg=surf/precision:VALUE */ +int sg_concurrency_limit = -1; /* Change this with --cfg=maxmin/concurrency_limit:VALUE */ static void *lmm_variable_mallocator_new_f(); static void lmm_variable_mallocator_free_f(void *var); @@ -198,7 +198,7 @@ lmm_constraint_t lmm_constraint_new(lmm_system_t sys, void *id, double bound_val cnst->bound = bound_value; cnst->concurrency_maximum=0; cnst->concurrency_current=0; - cnst->concurrency_limit=sg_concurrency_limit; + cnst->concurrency_limit = sg_concurrency_limit; cnst->usage = 0; cnst->sharing_policy = 1; /* FIXME: don't hardcode the value */ insert_constraint(sys, cnst); @@ -1053,23 +1053,20 @@ void lmm_disable_var(lmm_system_t sys, lmm_variable_t var){ * And then add it to enabled variables */ void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr){ - lmm_element_t elem; - lmm_element_t nextelem; - int numelem; if(cnstr->concurrency_limit<0) return; - numelem=xbt_swag_size(&(cnstr->disabled_element_set)); + int numelem = xbt_swag_size(&(cnstr->disabled_element_set)); if(!numelem) return; - elem= (lmm_element_t) xbt_swag_getFirst(&(cnstr->disabled_element_set)); + lmm_element_t elem = (lmm_element_t)xbt_swag_getFirst(&(cnstr->disabled_element_set)); //Cannot use xbt_swag_foreach, because lmm_enable_var will modify disabled_element_set.. within the loop - while(numelem-- && elem ){ + while (numelem-- && elem) { - nextelem = (lmm_element_t) xbt_swag_getNext(elem, cnstr->disabled_element_set.offset); + lmm_element_t nextelem = (lmm_element_t)xbt_swag_getNext(elem, cnstr->disabled_element_set.offset); if (elem->variable->staged_weight>0 ){ //Found a staged variable @@ -1098,7 +1095,6 @@ void lmm_on_disabled_var(lmm_system_t sys, lmm_constraint_t cnstr){ */ void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var, double weight) { - int minslack; xbt_assert(weight>=0,"Variable weight should not be negative!"); @@ -1115,8 +1111,8 @@ void lmm_update_variable_weight(lmm_system_t sys, lmm_variable_t var, double wei //Are we enabling this variable? if (enabling_var){ var->staged_weight = weight; - minslack=lmm_cnstrs_min_concurrency_slack(var); - if(minslackconcurrency_share){ + int minslack = lmm_cnstrs_min_concurrency_slack(var); + if (minslack < var->concurrency_share) { XBT_DEBUG("Staging var (instead of enabling) because min concurrency slack %i, with weight %f and concurrency" " share %i", minslack, weight, var->concurrency_share); return; -- 2.20.1