1 /* Copyright (c) 2004, 2005, 2006, 2007, 2008, 2009, 2010. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "network_private.h"
11 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
12 "Logging specific to the SURF network module");
14 surf_model_t surf_network_model = NULL;
15 static lmm_system_t network_maxmin_system = NULL;
16 static void (*network_solve) (lmm_system_t) = NULL;
18 double sg_latency_factor = 1.0; /* default value; can be set by model or from command line */
19 double sg_bandwidth_factor = 1.0; /* default value; can be set by model or from command line */
20 double sg_weight_S_parameter = 0.0; /* default value; can be set by model or from command line */
22 double sg_tcp_gamma = 0.0;
23 int sg_network_fullduplex = 0;
26 /******************************************************************************/
27 /* Factors callbacks */
28 /******************************************************************************/
29 static double constant_latency_factor(double size)
31 return sg_latency_factor;
34 static double constant_bandwidth_factor(double size)
36 return sg_bandwidth_factor;
39 static double constant_bandwidth_constraint(double rate, double bound,
45 /**********************/
47 /**********************/
48 static double smpi_latency_factor(double size)
50 /* 1 B <= size <= 1 KiB */
55 /* 2 KiB <= size <= 32 KiB */
56 if (size <= 32768.0) {
60 /* 64 KiB <= size <= 4 MiB */
64 static double smpi_bandwidth_factor(double size)
66 /* 1 B <= size <= 1 KiB */
71 /* 2 KiB <= size <= 32 KiB */
72 if (size <= 32768.0) {
76 /* 64 KiB <= size <= 4 MiB */
80 static double smpi_bandwidth_constraint(double rate, double bound,
83 return rate < 0 ? bound : min(bound, rate * smpi_bandwidth_factor(size));
87 static double (*latency_factor_callback) (double) =
88 &constant_latency_factor;
89 static double (*bandwidth_factor_callback) (double) =
90 &constant_bandwidth_factor;
91 static double (*bandwidth_constraint_callback) (double, double, double) =
92 &constant_bandwidth_constraint;
95 static link_CM02_t net_link_new(char *name,
97 tmgr_trace_t bw_trace,
99 tmgr_trace_t lat_trace,
100 e_surf_resource_state_t
102 tmgr_trace_t state_trace,
103 e_surf_link_sharing_policy_t
104 policy, xbt_dict_t properties)
106 link_CM02_t nw_link = (link_CM02_t)
107 surf_resource_lmm_new(sizeof(s_link_CM02_t),
108 surf_network_model, name, properties,
109 network_maxmin_system,
110 sg_bandwidth_factor * bw_initial,
112 state_initial, state_trace,
113 bw_initial, bw_trace);
115 xbt_assert1(!xbt_dict_get_or_null
116 (surf_network_model->resource_set, name),
117 "Link '%s' declared several times in the platform file.",
120 nw_link->lat_current = lat_initial;
123 tmgr_history_add_trace(history, lat_trace, 0.0, 0, nw_link);
125 if (policy == SURF_LINK_FATPIPE)
126 lmm_constraint_shared(nw_link->lmm_resource.constraint);
128 xbt_dict_set(surf_network_model->resource_set, name, nw_link,
131 TRACE_surf_link_declaration(nw_link, name, bw_initial, lat_initial);
137 static void net_parse_link_init(void)
141 tmgr_trace_t bw_trace;
143 tmgr_trace_t lat_trace;
144 e_surf_resource_state_t state_initial_link = SURF_RESOURCE_ON;
145 e_surf_link_sharing_policy_t policy_initial_link = SURF_LINK_SHARED;
146 tmgr_trace_t state_trace;
148 name_link = xbt_strdup(A_surfxml_link_id);
149 surf_parse_get_double(&bw_initial, A_surfxml_link_bandwidth);
150 bw_trace = tmgr_trace_new(A_surfxml_link_bandwidth_file);
151 surf_parse_get_double(&lat_initial, A_surfxml_link_latency);
152 lat_trace = tmgr_trace_new(A_surfxml_link_latency_file);
154 xbt_assert0((A_surfxml_link_state == A_surfxml_link_state_ON)
155 || (A_surfxml_link_state ==
156 A_surfxml_link_state_OFF), "Invalid state");
157 if (A_surfxml_link_state == A_surfxml_link_state_ON)
158 state_initial_link = SURF_RESOURCE_ON;
159 else if (A_surfxml_link_state == A_surfxml_link_state_OFF)
160 state_initial_link = SURF_RESOURCE_OFF;
162 if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_SHARED)
163 policy_initial_link = SURF_LINK_SHARED;
166 if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FATPIPE)
167 policy_initial_link = SURF_LINK_FATPIPE;
168 else if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX)
169 policy_initial_link = SURF_LINK_FULLDUPLEX;
172 state_trace = tmgr_trace_new(A_surfxml_link_state_file);
174 if(policy_initial_link == SURF_LINK_FULLDUPLEX)
176 net_link_new(bprintf("%s_UP",name_link), bw_initial, bw_trace,
177 lat_initial, lat_trace, state_initial_link, state_trace,
178 policy_initial_link, xbt_dict_new());
179 net_link_new(bprintf("%s_DOWN",name_link), bw_initial, bw_trace,
180 lat_initial, lat_trace, state_initial_link, state_trace,
181 policy_initial_link, xbt_dict_new());
185 net_link_new(name_link, bw_initial, bw_trace,
186 lat_initial, lat_trace, state_initial_link, state_trace,
187 policy_initial_link, xbt_dict_new());
192 static void net_create_resource(char *name,
194 tmgr_trace_t bw_trace,
196 tmgr_trace_t lat_trace,
197 e_surf_resource_state_t
199 tmgr_trace_t state_trace,
200 e_surf_link_sharing_policy_t policy,
201 xbt_dict_t properties)
203 net_link_new(name, bw_initial, bw_trace,
204 lat_initial, lat_trace, state_initial, state_trace,
205 policy, xbt_dict_new());
208 static void net_add_traces(void)
210 xbt_dict_cursor_t cursor = NULL;
211 char *trace_name, *elm;
213 static int called = 0;
218 /* connect all traces relative to network */
219 xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
220 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
222 xbt_dict_get_or_null(surf_network_model->resource_set, elm);
224 xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
227 "Cannot connect trace %s to link %s: trace undefined",
230 link->lmm_resource.state_event =
231 tmgr_history_add_trace(history, trace, 0.0, 0, link);
234 xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
235 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
237 xbt_dict_get_or_null(surf_network_model->resource_set, elm);
239 xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
242 "Cannot connect trace %s to link %s: trace undefined",
245 link->lmm_resource.power.event =
246 tmgr_history_add_trace(history, trace, 0.0, 0, link);
249 xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
250 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
252 xbt_dict_get_or_null(surf_network_model->resource_set, elm);
254 xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
257 "Cannot connect trace %s to link %s: trace undefined",
260 link->lat_event = tmgr_history_add_trace(history, trace, 0.0, 0, link);
264 static void net_define_callbacks(const char *file)
266 /* Figuring out the network links */
267 surfxml_add_callback(STag_surfxml_link_cb_list, &net_parse_link_init);
268 surfxml_add_callback(ETag_surfxml_platform_cb_list, &net_add_traces);
271 static int net_resource_used(void *resource_id)
273 return lmm_constraint_used(network_maxmin_system,
274 ((surf_resource_lmm_t)
275 resource_id)->constraint);
278 static int net_action_unref(surf_action_t action)
281 if (!action->refcount) {
282 xbt_swag_remove(action, action->state_set);
283 if (((surf_action_network_CM02_t) action)->variable)
284 lmm_variable_free(network_maxmin_system,
285 ((surf_action_network_CM02_t) action)->variable);
287 xbt_free(((surf_action_network_CM02_t) action)->src_name);
288 xbt_free(((surf_action_network_CM02_t) action)->dst_name);
289 if (action->category)
290 xbt_free(action->category);
298 static void net_action_cancel(surf_action_t action)
300 surf_network_model->action_state_set(action, SURF_ACTION_FAILED);
303 void net_action_recycle(surf_action_t action)
308 #ifdef HAVE_LATENCY_BOUND_TRACKING
309 int net_get_link_latency_limited(surf_action_t action)
311 return action->latency_limited;
315 double net_action_get_remains(surf_action_t action)
317 return action->remains;
320 static double net_share_resources(double now)
322 s_surf_action_network_CM02_t s_action;
323 surf_action_network_CM02_t action = NULL;
324 xbt_swag_t running_actions =
325 surf_network_model->states.running_action_set;
328 min = generic_maxmin_share_resources(running_actions,
329 xbt_swag_offset(s_action,
331 network_maxmin_system,
334 #define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + xbt_swag_offset(s_action, variable) )))
336 xbt_swag_foreach(action, running_actions) {
337 #ifdef HAVE_LATENCY_BOUND_TRACKING
338 if (lmm_is_variable_limited_by_latency(action->variable)) {
339 (action->generic_action).latency_limited = 1;
341 (action->generic_action).latency_limited = 0;
344 if (action->latency > 0) {
346 min = action->latency;
347 else if (action->latency < min)
348 min = action->latency;
355 static void net_update_actions_state(double now, double delta)
358 surf_action_network_CM02_t action = NULL;
359 surf_action_network_CM02_t next_action = NULL;
360 xbt_swag_t running_actions =
361 surf_network_model->states.running_action_set;
363 xbt_swag_t failed_actions =
364 surf_network_model->states.failed_action_set;
367 xbt_swag_foreach_safe(action, next_action, running_actions) {
369 if (action->latency > 0) {
370 if (action->latency > deltap) {
371 double_update(&(action->latency), deltap);
374 double_update(&(deltap), action->latency);
375 action->latency = 0.0;
377 if ((action->latency == 0.0) && !(action->suspended))
378 lmm_update_variable_weight(network_maxmin_system, action->variable,
383 global_routing->get_route(action->src_name, action->dst_name);
386 xbt_dynar_foreach(route, i, link) {
387 TRACE_surf_link_set_utilization(link,
388 action->generic_action.data,
389 (surf_action_t) action,
390 lmm_variable_getvalue
391 (action->variable), now - delta,
395 double_update(&(action->generic_action.remains),
396 lmm_variable_getvalue(action->variable) * deltap);
397 if (action->generic_action.max_duration != NO_MAX_DURATION)
398 double_update(&(action->generic_action.max_duration), delta);
400 if ((action->generic_action.remains <= 0) &&
401 (lmm_get_variable_weight(action->variable) > 0)) {
402 action->generic_action.finish = surf_get_clock();
403 surf_network_model->action_state_set((surf_action_t) action,
405 } else if ((action->generic_action.max_duration != NO_MAX_DURATION)
406 && (action->generic_action.max_duration <= 0)) {
407 action->generic_action.finish = surf_get_clock();
408 surf_network_model->action_state_set((surf_action_t) action,
416 static void net_update_resource_state(void *id,
417 tmgr_trace_event_t event_type,
418 double value, double date)
420 link_CM02_t nw_link = id;
421 /* printf("[" "%lg" "] Asking to update network card \"%s\" with value " */
422 /* "%lg" " for event %p\n", surf_get_clock(), nw_link->name, */
423 /* value, event_type); */
425 if (event_type == nw_link->lmm_resource.power.event) {
427 sg_weight_S_parameter / value - sg_weight_S_parameter /
428 (nw_link->lmm_resource.power.peak *
429 nw_link->lmm_resource.power.scale);
430 lmm_variable_t var = NULL;
431 lmm_element_t elem = NULL;
432 surf_action_network_CM02_t action = NULL;
434 nw_link->lmm_resource.power.peak = value;
435 lmm_update_constraint_bound(network_maxmin_system,
436 nw_link->lmm_resource.constraint,
437 sg_bandwidth_factor *
438 (nw_link->lmm_resource.power.peak *
439 nw_link->lmm_resource.power.scale));
441 TRACE_surf_link_set_bandwidth(date, nw_link,
442 sg_bandwidth_factor *
443 (nw_link->lmm_resource.power.peak *
444 nw_link->lmm_resource.power.scale));
446 if (sg_weight_S_parameter > 0) {
447 while ((var = lmm_get_var_from_cnst
448 (network_maxmin_system, nw_link->lmm_resource.constraint,
450 action = lmm_variable_id(var);
451 action->weight += delta;
452 if (!(action->suspended))
453 lmm_update_variable_weight(network_maxmin_system,
454 action->variable, action->weight);
457 if (tmgr_trace_event_free(event_type))
458 nw_link->lmm_resource.power.event = NULL;
459 } else if (event_type == nw_link->lat_event) {
460 double delta = value - nw_link->lat_current;
461 lmm_variable_t var = NULL;
462 lmm_element_t elem = NULL;
463 surf_action_network_CM02_t action = NULL;
465 nw_link->lat_current = value;
466 while ((var = lmm_get_var_from_cnst
467 (network_maxmin_system, nw_link->lmm_resource.constraint,
469 action = lmm_variable_id(var);
470 action->lat_current += delta;
471 action->weight += delta;
472 if (action->rate < 0)
473 lmm_update_variable_bound(network_maxmin_system, action->variable,
474 sg_tcp_gamma / (2.0 *
475 action->lat_current));
477 lmm_update_variable_bound(network_maxmin_system, action->variable,
479 sg_tcp_gamma / (2.0 *
480 action->lat_current)));
482 if (action->rate < sg_tcp_gamma / (2.0 * action->lat_current)) {
483 INFO0("Flow is limited BYBANDWIDTH");
485 INFO1("Flow is limited BYLATENCY, latency of flow is %f",
486 action->lat_current);
489 if (!(action->suspended))
490 lmm_update_variable_weight(network_maxmin_system, action->variable,
494 if (tmgr_trace_event_free(event_type))
495 nw_link->lat_event = NULL;
496 } else if (event_type == nw_link->lmm_resource.state_event) {
498 nw_link->lmm_resource.state_current = SURF_RESOURCE_ON;
500 lmm_constraint_t cnst = nw_link->lmm_resource.constraint;
501 lmm_variable_t var = NULL;
502 lmm_element_t elem = NULL;
504 nw_link->lmm_resource.state_current = SURF_RESOURCE_OFF;
505 while ((var = lmm_get_var_from_cnst
506 (network_maxmin_system, cnst, &elem))) {
507 surf_action_t action = lmm_variable_id(var);
509 if (surf_action_state_get(action) == SURF_ACTION_RUNNING ||
510 surf_action_state_get(action) == SURF_ACTION_READY) {
511 action->finish = date;
512 surf_network_model->action_state_set(action, SURF_ACTION_FAILED);
516 if (tmgr_trace_event_free(event_type))
517 nw_link->lmm_resource.state_event = NULL;
519 CRITICAL0("Unknown event ! \n");
527 static surf_action_t net_communicate(const char *src_name,
528 const char *dst_name, double size,
534 surf_action_network_CM02_t action = NULL;
535 double bandwidth_bound;
536 /* LARGE PLATFORMS HACK:
537 Add a link_CM02_t *link and a int link_nb to network_card_CM02_t. It will represent local links for this node
538 Use the cluster_id for ->id */
540 xbt_dynar_t route = global_routing->get_route(src_name, dst_name);
541 xbt_dynar_t back_route = NULL;
542 int constraints_per_variable = 0;
544 if (sg_network_fullduplex == 1) {
545 back_route = global_routing->get_route(src_name, dst_name);
548 /* LARGE PLATFORMS HACK:
549 total_route_size = route_size + src->link_nb + dst->nb */
551 XBT_IN4("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
552 /* LARGE PLATFORMS HACK:
553 assert on total_route_size */
554 xbt_assert2(xbt_dynar_length(route),
555 "You're trying to send data from %s to %s but there is no connection between these two hosts.",
558 xbt_dynar_foreach(route, i, link) {
559 if (link->lmm_resource.state_current == SURF_RESOURCE_OFF) {
565 surf_action_new(sizeof(s_surf_action_network_CM02_t), size,
566 surf_network_model, failed);
567 #ifdef HAVE_LATENCY_BOUND_TRACKING
568 (action->generic_action).latency_limited = 0;
571 xbt_swag_insert(action, action->generic_action.state_set);
574 action->latency = 0.0;
575 action->weight = 0.0;
576 bandwidth_bound = -1.0;
577 xbt_dynar_foreach(route, i, link) {
578 action->latency += link->lat_current;
581 sg_weight_S_parameter /
582 (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
583 if (bandwidth_bound < 0.0)
585 (*bandwidth_factor_callback) (size) *
586 (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
590 (*bandwidth_factor_callback) (size) *
591 (link->lmm_resource.power.peak *
592 link->lmm_resource.power.scale));
594 /* LARGE PLATFORMS HACK:
595 Add src->link and dst->link latencies */
596 action->lat_current = action->latency;
597 action->latency *= (*latency_factor_callback) (size);
599 (*bandwidth_constraint_callback) (action->rate, bandwidth_bound,
602 /* LARGE PLATFORMS HACK:
603 lmm_variable_new(..., total_route_size) */
604 if (back_route != NULL) {
605 constraints_per_variable =
606 xbt_dynar_length(route) + xbt_dynar_length(back_route);
608 constraints_per_variable = xbt_dynar_length(route);
611 if (action->latency > 0)
613 lmm_variable_new(network_maxmin_system, action, 0.0, -1.0,
614 constraints_per_variable);
617 lmm_variable_new(network_maxmin_system, action, 1.0, -1.0,
618 constraints_per_variable);
620 if (action->rate < 0) {
621 if (action->lat_current > 0)
622 lmm_update_variable_bound(network_maxmin_system, action->variable,
623 sg_tcp_gamma / (2.0 *
624 action->lat_current));
626 lmm_update_variable_bound(network_maxmin_system, action->variable,
629 if (action->lat_current > 0)
630 lmm_update_variable_bound(network_maxmin_system, action->variable,
632 sg_tcp_gamma / (2.0 *
633 action->lat_current)));
635 lmm_update_variable_bound(network_maxmin_system, action->variable,
639 xbt_dynar_foreach(route, i, link) {
640 lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
641 action->variable, 1.0);
644 if (sg_network_fullduplex == 1) {
645 DEBUG1("Fullduplex active adding backward flow using 5%c", '%');
646 xbt_dynar_foreach(back_route, i, link) {
647 lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
648 action->variable, .05);
651 /* LARGE PLATFORMS HACK:
652 expand also with src->link and dst->link */
654 action->src_name = xbt_new(char, strlen(src_name) + 1);
655 strncpy(action->src_name, src_name, strlen(src_name) + 1);
657 action->dst_name = xbt_new(char, strlen(dst_name) + 1);
658 strncpy(action->dst_name, dst_name, strlen(dst_name) + 1);
663 return (surf_action_t) action;
666 static xbt_dynar_t net_get_route(const char *src, const char *dst)
668 return global_routing->get_route(src, dst);
671 static double net_get_link_bandwidth(const void *link)
673 surf_resource_lmm_t lmm = (surf_resource_lmm_t) link;
674 return lmm->power.peak * lmm->power.scale;
677 static double net_get_link_latency(const void *link)
679 return ((link_CM02_t) link)->lat_current;
682 static int net_link_shared(const void *link)
685 lmm_constraint_is_shared(((surf_resource_lmm_t) link)->constraint);
688 static void net_action_suspend(surf_action_t action)
690 ((surf_action_network_CM02_t) action)->suspended = 1;
691 lmm_update_variable_weight(network_maxmin_system,
692 ((surf_action_network_CM02_t)
693 action)->variable, 0.0);
696 static void net_action_resume(surf_action_t action)
698 if (((surf_action_network_CM02_t) action)->suspended) {
699 lmm_update_variable_weight(network_maxmin_system,
700 ((surf_action_network_CM02_t)
702 ((surf_action_network_CM02_t)
704 ((surf_action_network_CM02_t) action)->suspended = 0;
708 static int net_action_is_suspended(surf_action_t action)
710 return ((surf_action_network_CM02_t) action)->suspended;
713 void net_action_set_max_duration(surf_action_t action, double duration)
715 action->max_duration = duration;
718 static void net_finalize(void)
720 surf_model_exit(surf_network_model);
721 surf_network_model = NULL;
723 global_routing->finalize();
725 lmm_system_free(network_maxmin_system);
726 network_maxmin_system = NULL;
729 static void surf_network_model_init_internal(void)
731 surf_network_model = surf_model_init();
733 surf_network_model->name = "network";
734 surf_network_model->action_unref = net_action_unref;
735 surf_network_model->action_cancel = net_action_cancel;
736 surf_network_model->action_recycle = net_action_recycle;
737 surf_network_model->get_remains = net_action_get_remains;
738 #ifdef HAVE_LATENCY_BOUND_TRACKING
739 surf_network_model->get_latency_limited = net_get_link_latency_limited;
742 surf_network_model->model_private->resource_used = net_resource_used;
743 surf_network_model->model_private->share_resources = net_share_resources;
744 surf_network_model->model_private->update_actions_state =
745 net_update_actions_state;
746 surf_network_model->model_private->update_resource_state =
747 net_update_resource_state;
748 surf_network_model->model_private->finalize = net_finalize;
750 surf_network_model->suspend = net_action_suspend;
751 surf_network_model->resume = net_action_resume;
752 surf_network_model->is_suspended = net_action_is_suspended;
753 surf_cpu_model->set_max_duration = net_action_set_max_duration;
755 surf_network_model->extension.network.communicate = net_communicate;
756 surf_network_model->extension.network.get_route = net_get_route;
757 surf_network_model->extension.network.get_link_bandwidth =
758 net_get_link_bandwidth;
759 surf_network_model->extension.network.get_link_latency =
760 net_get_link_latency;
761 surf_network_model->extension.network.link_shared = net_link_shared;
762 surf_network_model->extension.network.add_traces = net_add_traces;
763 surf_network_model->extension.network.create_resource =
766 if (!network_maxmin_system)
767 network_maxmin_system = lmm_system_new();
769 routing_model_create(sizeof(link_CM02_t),
770 net_link_new(xbt_strdup("__loopback__"),
771 498000000, NULL, 0.000015, NULL,
772 SURF_RESOURCE_ON, NULL,
773 SURF_LINK_FATPIPE, NULL));
778 /************************************************************************/
779 /* New model based on LV08 and experimental results of MPI ping-pongs */
780 /************************************************************************/
781 void surf_network_model_init_SMPI(const char *filename)
784 if (surf_network_model)
786 surf_network_model_init_internal();
787 latency_factor_callback = &smpi_latency_factor;
788 bandwidth_factor_callback = &smpi_bandwidth_factor;
789 bandwidth_constraint_callback = &smpi_bandwidth_constraint;
790 net_define_callbacks(filename);
791 xbt_dynar_push(model_list, &surf_network_model);
792 network_solve = lmm_solve;
794 xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
796 update_model_description(surf_network_model_description,
797 "SMPI", surf_network_model);
800 /************************************************************************/
801 /* New model based on optimizations discussed during this thesis */
802 /************************************************************************/
803 void surf_network_model_init_LegrandVelho(const char *filename)
806 if (surf_network_model)
808 surf_network_model_init_internal();
809 net_define_callbacks(filename);
810 xbt_dynar_push(model_list, &surf_network_model);
811 network_solve = lmm_solve;
813 xbt_cfg_setdefault_double(_surf_cfg_set, "network/latency_factor", 10.4);
814 xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",
816 xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
818 update_model_description(surf_network_model_description,
819 "LV08", surf_network_model);
822 /***************************************************************************/
823 /* The nice TCP sharing model designed by Loris Marchal and Henri Casanova */
824 /***************************************************************************/
825 /* @TechReport{ rr-lip2002-40, */
826 /* author = {Henri Casanova and Loris Marchal}, */
827 /* institution = {LIP}, */
828 /* title = {A Network Model for Simulation of Grid Application}, */
829 /* number = {2002-40}, */
833 void surf_network_model_init_CM02(const char *filename)
836 if (surf_network_model)
838 surf_network_model_init_internal();
839 net_define_callbacks(filename);
840 xbt_dynar_push(model_list, &surf_network_model);
841 network_solve = lmm_solve;
843 update_model_description(surf_network_model_description,
844 "CM02", surf_network_model);
847 void surf_network_model_init_Reno(const char *filename)
849 if (surf_network_model)
851 surf_network_model_init_internal();
852 net_define_callbacks(filename);
854 xbt_dynar_push(model_list, &surf_network_model);
855 lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
857 network_solve = lagrange_solve;
859 xbt_cfg_setdefault_double(_surf_cfg_set, "network/latency_factor", 10.4);
860 xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",
862 xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
864 update_model_description(surf_network_model_description,
865 "Reno", surf_network_model);
869 void surf_network_model_init_Reno2(const char *filename)
871 if (surf_network_model)
873 surf_network_model_init_internal();
874 net_define_callbacks(filename);
876 xbt_dynar_push(model_list, &surf_network_model);
877 lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
879 network_solve = lagrange_solve;
881 xbt_cfg_setdefault_double(_surf_cfg_set, "network/latency_factor", 10.4);
882 xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",
884 xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S_parameter",
887 update_model_description(surf_network_model_description,
888 "Reno2", surf_network_model);
891 void surf_network_model_init_Vegas(const char *filename)
893 if (surf_network_model)
895 surf_network_model_init_internal();
896 net_define_callbacks(filename);
898 xbt_dynar_push(model_list, &surf_network_model);
899 lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
901 network_solve = lagrange_solve;
903 xbt_cfg_setdefault_double(_surf_cfg_set, "network/latency_factor", 10.4);
904 xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",
906 xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
908 update_model_description(surf_network_model_description,
909 "Vegas", surf_network_model);