X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/79ef316bb2a1188e46d1a7984e3b868dac416b75..1ba1897117e2815dbadab50c538dad87427aef14:/src/surf/network_im.c diff --git a/src/surf/network_im.c b/src/surf/network_im.c index 06f07c18bc..162adb95c7 100644 --- a/src/surf/network_im.c +++ b/src/surf/network_im.c @@ -45,7 +45,8 @@ int sg_network_crosstraffic = 0; xbt_dict_t gap_lookup = NULL; -e_UM_t network_update_mechanism = UM_FULL; +e_UM_t network_update_mechanism = UM_UNDEFINED; +static int selective_update = 0; typedef struct network_link_CM02_im { s_surf_resource_lmm_t lmm_resource; /* must remain first to be added to a trace */ @@ -1059,7 +1060,6 @@ static void gap_remove(surf_action_network_CM02_im_t action) { static void im_surf_network_model_init_internal(void) { s_surf_action_network_CM02_im_t comm; - surf_network_model = surf_model_init(); surf_network_model->name = "network"; @@ -1072,15 +1072,13 @@ static void im_surf_network_model_init_internal(void) #endif surf_network_model->model_private->resource_used = im_net_resource_used; - if(network_update_mechanism == UM_LAZY) + if(network_update_mechanism == UM_LAZY) { surf_network_model->model_private->share_resources = net_share_resources_lazy; - else if(network_update_mechanism == UM_FULL) + surf_network_model->model_private->update_actions_state = net_update_actions_state_lazy; + } else if(network_update_mechanism == UM_FULL) { surf_network_model->model_private->share_resources = net_share_resources_full; - - if(network_update_mechanism == UM_LAZY) - surf_network_model->model_private->update_actions_state =net_update_actions_state_lazy; - else if(network_update_mechanism == UM_FULL) - surf_network_model->model_private->update_actions_state =net_update_actions_state_full; + surf_network_model->model_private->update_actions_state = net_update_actions_state_full; + } surf_network_model->model_private->update_resource_state = net_update_resource_state; @@ -1102,8 +1100,8 @@ static void im_surf_network_model_init_internal(void) surf_network_model->extension.network.create_resource = im_net_create_resource; - if (!network_im_maxmin_system) - network_im_maxmin_system = lmm_system_new(); + if (!network_im_maxmin_system) + network_im_maxmin_system = lmm_system_new(selective_update); routing_model_create(sizeof(link_CM02_im_t), im_net_create_resource("__loopback__", @@ -1112,7 +1110,6 @@ static void im_surf_network_model_init_internal(void) SURF_LINK_FATPIPE, NULL)); if(network_update_mechanism == UM_LAZY){ - sg_maxmin_selective_update = 1; im_net_action_heap = xbt_heap_new(8,NULL); xbt_heap_set_update_callback(im_net_action_heap, im_net_action_update_index_heap); im_net_modified_set = @@ -1122,11 +1119,16 @@ static void im_surf_network_model_init_internal(void) static void set_update_mechanism(void) { char *optim = xbt_cfg_get_string(_surf_cfg_set, "network/optim"); + int select = xbt_cfg_get_int(_surf_cfg_set, "network/maxmin_selective_update"); if(!strcmp(optim,"Full")) { network_update_mechanism = UM_FULL; + selective_update = select; } else if (!strcmp(optim,"Lazy")) { network_update_mechanism = UM_LAZY; + selective_update = 1; + xbt_assert((select==1) || (xbt_cfg_is_default_value(_surf_cfg_set,"network/maxmin_selective_update")), + "Disabling selective update while using the lazy update mechanism is dumb!"); } else { xbt_die("Unsupported optimization (%s) for this model",optim); } @@ -1135,6 +1137,14 @@ static void set_update_mechanism(void) { /************************************************************************/ /* New model based on LV08 and experimental results of MPI ping-pongs */ /************************************************************************/ +/* @Inproceedings{smpi_ipdps, */ +/* author={Pierre-Nicolas Clauss and Mark Stillwell and Stéphane Genaud and Frédéric Suter and Henri Casanova and Martin Quinson}, */ +/* title={Single Node On-Line Simulation of {MPI} Applications with SMPI}, */ +/* booktitle={25th IEEE International Parallel and Distributed Processing Symposium (IPDPS'11)}, */ +/* address={Anchorage (Alaska) USA}, */ +/* month=may, */ +/* year={2011} */ +/* } */ void surf_network_model_init_SMPI(void) { @@ -1155,8 +1165,19 @@ void surf_network_model_init_SMPI(void) } /************************************************************************/ -/* New model based on optimizations discussed during this thesis */ +/* New model based on optimizations discussed during Pedro Velho's thesis*/ /************************************************************************/ +/* @techreport{VELHO:2011:HAL-00646896:1, */ +/* url = {http://hal.inria.fr/hal-00646896/en/}, */ +/* title = {{Flow-level network models: have we reached the limits?}}, */ +/* author = {Velho, Pedro and Schnorr, Lucas and Casanova, Henri and Legrand, Arnaud}, */ +/* type = {Rapport de recherche}, */ +/* institution = {INRIA}, */ +/* number = {RR-7821}, */ +/* year = {2011}, */ +/* month = Nov, */ +/* pdf = {http://hal.inria.fr/hal-00646896/PDF/rr-validity.pdf}, */ +/* } */ void im_surf_network_model_init_LegrandVelho(void) { char *model = xbt_cfg_get_string(_surf_cfg_set, "network/model"); @@ -1207,6 +1228,16 @@ void surf_network_model_init_CM02(void) xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 0.0); } +/***************************************************************************/ +/* The models from Steven H. Low */ +/***************************************************************************/ +/* @article{Low03, */ +/* author={Steven H. Low}, */ +/* title={A Duality Model of {TCP} and Queue Management Algorithms}, */ +/* year={2003}, */ +/* journal={{IEEE/ACM} Transactions on Networking}, */ +/* volume={11}, number={4}, */ +/* } */ void surf_network_model_init_Reno(void) { if (surf_network_model)