From: Augustin Degomme Date: Fri, 17 Oct 2014 11:29:08 +0000 (+0200) Subject: Add option to configure the factors used for IB model X-Git-Tag: v3_12~732^2~285^2~3 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/2cd9e71df345af226c55aa7f1d46c8ec03828757 Add option to configure the factors used for IB model --- diff --git a/src/simgrid/sg_config.c b/src/simgrid/sg_config.c index 5bf6c4aa7a..efe5bf246d 100644 --- a/src/simgrid/sg_config.c +++ b/src/simgrid/sg_config.c @@ -836,7 +836,12 @@ void sg_config_init(int *argc, char **argv) "Latency factors for smpi.", xbt_cfgelm_string, 1, 1, NULL, NULL); xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/lat_factor", "65472:11.6436;15424:3.48845;9376:2.59299;5776:2.18796;3484:1.88101;1426:1.61075;732:1.9503;257:1.95341;0:2.01467"); - + + xbt_cfg_register(&_sg_cfg_set, "smpi/IB_penalty_factors", + "Correction factor to communications using Infiniband model with contention (default value based on Stampede cluster profiling)", + xbt_cfgelm_string, 1, 1, NULL, NULL); + xbt_cfg_setdefault_string(_sg_cfg_set, "smpi/IB_penalty_factors", "0.965;0.925;1.35"); + xbt_cfg_register(&_sg_cfg_set, "smpi/os", "Small messages timings (MPI_Send minimum time for small messages)", xbt_cfgelm_string, 1, 1, NULL, NULL); diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index e85e54866e..f19aa4b2e9 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -10,11 +10,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network); -double Bs=0.925; -double Be=0.965; -double ys=1.35; - - static void IB_create_host_callback(sg_platf_host_cbarg_t t){ static int id=0; @@ -93,12 +88,23 @@ void surf_network_model_init_IB(void) sg_platf_host_add_cb(IB_create_host_callback); xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775); + } NetworkIBModel::NetworkIBModel() : NetworkSmpiModel() { m_haveGap=false; active_nodes=NULL; + + const char* IB_factors_string=sg_cfg_get_string("smpi/IB_penalty_factors"); + xbt_dynar_t radical_elements = xbt_str_split(IB_factors_string, ";"); + + if(xbt_dynar_length(radical_elements)!=3) + surf_parse_error("smpi/IB_penalty_factors should be provided and contain 3 elements, semi-colon separated : for example 0.965;0.925;1.35"); + + Be = atof(xbt_dynar_get_as(radical_elements, 0, char *)); + Bs = atof(xbt_dynar_get_as(radical_elements, 1, char *)); + ys = atof(xbt_dynar_get_as(radical_elements, 2, char *)); } NetworkIBModel::~NetworkIBModel() diff --git a/src/surf/network_ib.hpp b/src/surf/network_ib.hpp index 8adaf4af6d..7328b97234 100644 --- a/src/surf/network_ib.hpp +++ b/src/surf/network_ib.hpp @@ -46,6 +46,10 @@ public: xbt_dict_t active_nodes; std::map > active_comms; + + double Bs; + double Be; + double ys; };