double sg_weight_S_parameter = 0.0; /* default value; can be set by model or from command line */
double sg_tcp_gamma = 0.0;
-int sg_network_fullduplex = 0;
+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 */
}
}
-static double net_share_resources(double now)
+static double net_share_resources_full(double now)
{
s_surf_action_network_CM02_im_t s_action;
surf_action_network_CM02_im_t action = NULL;
return min;
}
-static double im_net_share_resources(double now)
+static double net_share_resources_lazy(double now)
{
surf_action_network_CM02_im_t action = NULL;
double min=-1;
return min;
}
-static double generic_net_share_resources(double now)
-{
- if(network_update_mechanism == UM_LAZY)
- return im_net_share_resources(now);
- else if (network_update_mechanism == UM_FULL)
- {
- return net_share_resources(now);
- } else {
- xbt_die("Invalide update mechanism!");
- return 0;
- }
-}
-
-static void net_update_actions_state(double now, double delta)
+static void net_update_actions_state_full(double now, double delta)
{
double deltap = 0.0;
surf_action_network_CM02_im_t action = NULL;
return;
}
-static void im_net_update_actions_state(double now, double delta)
+static void net_update_actions_state_lazy(double now, double delta)
{
surf_action_network_CM02_im_t action = NULL;
return;
}
-static void generic_net_update_actions_state(double now, double delta)
-{
- if(network_update_mechanism == UM_LAZY)
- im_net_update_actions_state(now,delta);
- else if (network_update_mechanism == UM_FULL)
- {
- net_update_actions_state(now,delta);
- } else {
- xbt_die("Invalide update mechanism!");
- }
-}
-
-static void im_net_update_resource_state(void *id,
+static void net_update_resource_state(void *id,
tmgr_trace_event_t event_type,
double value, double date)
{
xbt_dynar_t route=xbt_dynar_new(global_routing->size_of_link,NULL);
routing_get_route_and_latency(src_name, dst_name, &route, &latency);
- if (sg_network_fullduplex == 1) {
+ if (sg_network_crosstraffic == 1) {
// FIXME: fill route directly (unclear: check with blame who put the FIXME)
routing_get_route_and_latency(dst_name, src_name, &back_route,NULL);
}
break;
}
}
+ if (sg_network_crosstraffic == 1) {
+ xbt_dynar_foreach(back_route, i, link) {
+ if (link->lmm_resource.state_current == SURF_RESOURCE_OFF) {
+ failed = 1;
+ break;
+ }
+ }
+ }
+
action =
surf_action_new(sizeof(s_surf_action_network_CM02_im_t), size,
surf_network_model, failed);
action->variable, 1.0);
}
- if (sg_network_fullduplex == 1) {
+ if (sg_network_crosstraffic == 1) {
XBT_DEBUG("Fullduplex active adding backward flow using 5%c", '%');
xbt_dynar_foreach(back_route, i, link) {
lmm_expand(network_im_maxmin_system, link->lmm_resource.constraint,
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";
#endif
surf_network_model->model_private->resource_used = im_net_resource_used;
- surf_network_model->model_private->share_resources = generic_net_share_resources;
- surf_network_model->model_private->update_actions_state =
- generic_net_update_actions_state;
+ if(network_update_mechanism == UM_LAZY) {
+ surf_network_model->model_private->share_resources = net_share_resources_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->share_resources = net_share_resources_full;
+ surf_network_model->model_private->update_actions_state = net_update_actions_state_full;
+ }
+
surf_network_model->model_private->update_resource_state =
- im_net_update_resource_state;
+ net_update_resource_state;
surf_network_model->model_private->finalize = im_net_finalize;
surf_network_model->suspend = im_net_action_suspend;
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__",
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 =
}
}
+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);
+ }
+}
+
/************************************************************************/
/* 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)
{
if (surf_network_model)
return;
+ set_update_mechanism();
+
im_surf_network_model_init_internal();
im_latency_factor_callback = &smpi_latency_factor;
im_bandwidth_factor_callback = &smpi_bandwidth_factor;
xbt_cfg_setdefault_double(_surf_cfg_set, "network/sender_gap", 10e-6);
xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
-
}
/************************************************************************/
-/* 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)
{
- if( strcmp(xbt_cfg_get_string(_surf_cfg_set, "network/model"),"LV08"))
- network_update_mechanism = UM_LAZY;
- else
- network_update_mechanism = UM_FULL;
+ char *model = xbt_cfg_get_string(_surf_cfg_set, "network/model");
if (surf_network_model)
return;
+
+ if(!strcmp(model,"LV08_fullupdate")) {
+ XBT_WARN("[*Deprecated*. Use --cfg=network/model:LV08 with option --cfg=network/optim:Full instead.]");
+ }
+ set_update_mechanism();
+
im_surf_network_model_init_internal();
im_net_define_callbacks();
xbt_dynar_push(model_list, &surf_network_model);
network_im_solve = lmm_solve;
- xbt_cfg_setdefault_double(_surf_cfg_set, "network/latency_factor", 10.4);
- xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",
- 0.92);
- xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
+ xbt_cfg_setdefault_double(_surf_cfg_set, "network/latency_factor", 10.4); // 13.01 when callibration is done without phase effects
+ xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",0.92);// 0.97 when callibration is done without phase effects
+ xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775); // 20537 when callibration is done without phase effects
}
/***************************************************************************/
if (surf_network_model)
return;
+
+ set_update_mechanism();
im_surf_network_model_init_internal();
im_net_define_callbacks();
xbt_dynar_push(model_list, &surf_network_model);
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)
return;
+
+ set_update_mechanism();
im_surf_network_model_init_internal();
im_net_define_callbacks();
{
if (surf_network_model)
return;
+
+ set_update_mechanism();
im_surf_network_model_init_internal();
im_net_define_callbacks();
{
if (surf_network_model)
return;
+
+ set_update_mechanism();
im_surf_network_model_init_internal();
im_net_define_callbacks();