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, double size)
44 /**********************/
46 /**********************/
47 static double smpi_latency_factor(double size)
49 /* 1 B <= size <= 1 KiB */
54 /* 2 KiB <= size <= 32 KiB */
55 if (size <= 32768.0) {
59 /* 64 KiB <= size <= 4 MiB */
63 static double smpi_bandwidth_factor(double size)
65 /* 1 B <= size <= 1 KiB */
70 /* 2 KiB <= size <= 32 KiB */
71 if (size <= 32768.0) {
75 /* 64 KiB <= size <= 4 MiB */
79 static double smpi_bandwidth_constraint(double rate, double bound, double size)
81 return rate < 0 ? bound : min(bound, rate * smpi_bandwidth_factor(size));
85 static double (*latency_factor_callback)(double) = &constant_latency_factor;
86 static double (*bandwidth_factor_callback)(double) = &constant_bandwidth_factor;
87 static double (*bandwidth_constraint_callback)(double, double, double) = &constant_bandwidth_constraint;
90 static link_CM02_t net_link_new(char *name,
92 tmgr_trace_t bw_trace,
94 tmgr_trace_t lat_trace,
95 e_surf_resource_state_t
97 tmgr_trace_t state_trace,
98 e_surf_link_sharing_policy_t
99 policy, xbt_dict_t properties)
101 link_CM02_t nw_link = (link_CM02_t)
102 surf_resource_lmm_new(sizeof(s_link_CM02_t),
103 surf_network_model, name, properties,
104 network_maxmin_system,
105 sg_bandwidth_factor * bw_initial,
107 state_initial, state_trace,
108 bw_initial, bw_trace);
110 xbt_assert1(!xbt_dict_get_or_null(surf_network_model->resource_set, name),
111 "Link '%s' declared several times in the platform file.", name);
113 nw_link->lat_current = lat_initial;
116 tmgr_history_add_trace(history, lat_trace, 0.0, 0, nw_link);
118 if (policy == SURF_LINK_FATPIPE)
119 lmm_constraint_shared(nw_link->lmm_resource.constraint);
121 xbt_dict_set(surf_network_model->resource_set, name, nw_link,
124 TRACE_surf_link_declaration (name, bw_initial, lat_initial);
130 static void net_parse_link_init(void)
134 tmgr_trace_t bw_trace;
136 tmgr_trace_t lat_trace;
137 e_surf_resource_state_t state_initial_link = SURF_RESOURCE_ON;
138 e_surf_link_sharing_policy_t policy_initial_link = SURF_LINK_SHARED;
139 tmgr_trace_t state_trace;
141 name_link = xbt_strdup(A_surfxml_link_id);
142 surf_parse_get_double(&bw_initial, A_surfxml_link_bandwidth);
143 bw_trace = tmgr_trace_new(A_surfxml_link_bandwidth_file);
144 surf_parse_get_double(&lat_initial, A_surfxml_link_latency);
145 lat_trace = tmgr_trace_new(A_surfxml_link_latency_file);
147 xbt_assert0((A_surfxml_link_state == A_surfxml_link_state_ON)
148 || (A_surfxml_link_state ==
149 A_surfxml_link_state_OFF), "Invalid state");
150 if (A_surfxml_link_state == A_surfxml_link_state_ON)
151 state_initial_link = SURF_RESOURCE_ON;
152 else if (A_surfxml_link_state == A_surfxml_link_state_OFF)
153 state_initial_link = SURF_RESOURCE_OFF;
155 if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_SHARED)
156 policy_initial_link = SURF_LINK_SHARED;
157 else if (A_surfxml_link_sharing_policy ==
158 A_surfxml_link_sharing_policy_FATPIPE)
159 policy_initial_link = SURF_LINK_FATPIPE;
161 state_trace = tmgr_trace_new(A_surfxml_link_state_file);
163 net_link_new(name_link, bw_initial, bw_trace,
164 lat_initial, lat_trace, state_initial_link, state_trace,
165 policy_initial_link, xbt_dict_new());
169 static void net_create_resource(char *name,
171 tmgr_trace_t bw_trace,
173 tmgr_trace_t lat_trace,
174 e_surf_resource_state_t
176 tmgr_trace_t state_trace,
177 e_surf_link_sharing_policy_t policy,
178 xbt_dict_t properties)
180 net_link_new(name, bw_initial, bw_trace,
181 lat_initial, lat_trace, state_initial, state_trace,
182 policy, xbt_dict_new());
184 static void net_add_traces(void)
186 xbt_dict_cursor_t cursor = NULL;
187 char *trace_name, *elm;
189 static int called = 0;
194 /* connect all traces relative to network */
195 xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
196 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
198 xbt_dict_get_or_null(surf_network_model->resource_set, elm);
200 xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
202 xbt_assert2(trace, "Cannot connect trace %s to link %s: trace undefined",
205 link->lmm_resource.state_event =
206 tmgr_history_add_trace(history, trace, 0.0, 0, link);
209 xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
210 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
212 xbt_dict_get_or_null(surf_network_model->resource_set, elm);
214 xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
216 xbt_assert2(trace, "Cannot connect trace %s to link %s: trace undefined",
219 link->lmm_resource.power.event =
220 tmgr_history_add_trace(history, trace, 0.0, 0, link);
223 xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
224 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
226 xbt_dict_get_or_null(surf_network_model->resource_set, elm);
228 xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
230 xbt_assert2(trace, "Cannot connect trace %s to link %s: trace undefined",
233 link->lat_event = tmgr_history_add_trace(history, trace, 0.0, 0, link);
237 static void net_define_callbacks(const char *file)
239 /* Figuring out the network links */
240 surfxml_add_callback(STag_surfxml_link_cb_list, &net_parse_link_init);
241 surfxml_add_callback(ETag_surfxml_platform_cb_list, &net_add_traces);
244 static int net_resource_used(void *resource_id)
246 return lmm_constraint_used(network_maxmin_system,
247 ((surf_resource_lmm_t) resource_id)->constraint);
250 static int net_action_unref(surf_action_t action)
253 if (!action->refcount) {
254 xbt_swag_remove(action, action->state_set);
255 if (((surf_action_network_CM02_t) action)->variable)
256 lmm_variable_free(network_maxmin_system,
257 ((surf_action_network_CM02_t) action)->variable);
259 xbt_free (((surf_action_network_CM02_t)action)->src_name);
260 xbt_free (((surf_action_network_CM02_t)action)->dst_name);
268 static void net_action_cancel(surf_action_t action)
270 surf_network_model->action_state_set(action, SURF_ACTION_FAILED);
273 void net_action_recycle(surf_action_t action)
278 int net_get_link_latency(surf_action_t action)
280 return action->latency_limited;
283 double net_action_get_remains(surf_action_t action)
285 return action->remains;
288 static double net_share_resources(double now)
290 s_surf_action_network_CM02_t s_action;
291 surf_action_network_CM02_t action = NULL;
292 xbt_swag_t running_actions = surf_network_model->states.running_action_set;
295 min = generic_maxmin_share_resources(running_actions,
296 xbt_swag_offset(s_action,
298 network_maxmin_system, network_solve);
300 #define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + xbt_swag_offset(s_action, variable) )))
302 xbt_swag_foreach(action, running_actions) {
303 if( lmm_is_variable_limited_by_latency(action->variable) ){
304 (action->generic_action).latency_limited = 1;
306 (action->generic_action).latency_limited = 0;
308 if (action->latency > 0) {
310 min = action->latency;
311 else if (action->latency < min)
312 min = action->latency;
319 static void net_update_actions_state(double now, double delta)
322 surf_action_network_CM02_t action = NULL;
323 surf_action_network_CM02_t next_action = NULL;
324 xbt_swag_t running_actions = surf_network_model->states.running_action_set;
326 xbt_swag_t failed_actions =
327 surf_network_model->states.failed_action_set;
330 xbt_swag_foreach_safe(action, next_action, running_actions) {
332 if (action->latency > 0) {
333 if (action->latency > deltap) {
334 double_update(&(action->latency), deltap);
337 double_update(&(deltap), action->latency);
338 action->latency = 0.0;
340 if ((action->latency == 0.0) && !(action->suspended))
341 lmm_update_variable_weight(network_maxmin_system, action->variable,
345 xbt_dynar_t route = used_routing->get_route(action->src, action->dst);
348 xbt_dynar_foreach(route, i, link) {
349 TRACE_surf_link_set_utilization (link->lmm_resource.generic_resource.name,
350 action->generic_action.data, lmm_variable_getvalue(action->variable), now-delta, delta);
353 double_update(&(action->generic_action.remains),
354 lmm_variable_getvalue(action->variable) * deltap);
355 if (action->generic_action.max_duration != NO_MAX_DURATION)
356 double_update(&(action->generic_action.max_duration), delta);
358 if ((action->generic_action.remains <= 0) &&
359 (lmm_get_variable_weight(action->variable) > 0)) {
360 action->generic_action.finish = surf_get_clock();
361 surf_network_model->action_state_set((surf_action_t) action,
363 } else if ((action->generic_action.max_duration != NO_MAX_DURATION)
364 && (action->generic_action.max_duration <= 0)) {
365 action->generic_action.finish = surf_get_clock();
366 surf_network_model->action_state_set((surf_action_t) action,
374 static void net_update_resource_state(void *id,
375 tmgr_trace_event_t event_type,
376 double value, double date)
378 link_CM02_t nw_link = id;
379 /* printf("[" "%lg" "] Asking to update network card \"%s\" with value " */
380 /* "%lg" " for event %p\n", surf_get_clock(), nw_link->name, */
381 /* value, event_type); */
383 if (event_type == nw_link->lmm_resource.power.event) {
385 sg_weight_S_parameter / value - sg_weight_S_parameter /
386 (nw_link->lmm_resource.power.peak * nw_link->lmm_resource.power.scale);
387 lmm_variable_t var = NULL;
388 lmm_element_t elem = NULL;
389 surf_action_network_CM02_t action = NULL;
391 nw_link->lmm_resource.power.peak = value;
392 lmm_update_constraint_bound(network_maxmin_system,
393 nw_link->lmm_resource.constraint,
394 sg_bandwidth_factor *
395 (nw_link->lmm_resource.power.peak *
396 nw_link->lmm_resource.power.scale));
398 TRACE_surf_link_set_bandwidth (date, nw_link->lmm_resource.generic_resource.name, sg_bandwidth_factor * (nw_link->lmm_resource.power.peak * nw_link->lmm_resource.power.scale));
400 if (sg_weight_S_parameter > 0) {
401 while ((var = lmm_get_var_from_cnst
402 (network_maxmin_system, nw_link->lmm_resource.constraint,
404 action = lmm_variable_id(var);
405 action->weight += delta;
406 if (!(action->suspended))
407 lmm_update_variable_weight(network_maxmin_system, action->variable,
411 if (tmgr_trace_event_free(event_type))
412 nw_link->lmm_resource.power.event = NULL;
413 } else if (event_type == nw_link->lat_event) {
414 double delta = value - nw_link->lat_current;
415 lmm_variable_t var = NULL;
416 lmm_element_t elem = NULL;
417 surf_action_network_CM02_t action = NULL;
419 nw_link->lat_current = value;
420 while ((var = lmm_get_var_from_cnst
421 (network_maxmin_system, nw_link->lmm_resource.constraint,
423 action = lmm_variable_id(var);
424 action->lat_current += delta;
425 action->weight += delta;
426 if (action->rate < 0)
427 lmm_update_variable_bound(network_maxmin_system, action->variable,
428 sg_tcp_gamma / (2.0 * action->lat_current));
430 lmm_update_variable_bound(network_maxmin_system, action->variable,
432 sg_tcp_gamma / (2.0 *
433 action->lat_current)));
435 if(action->rate < sg_tcp_gamma / (2.0 * action->lat_current) ){
436 INFO0("Flow is limited BYBANDWIDTH");
438 INFO1("Flow is limited BYLATENCY, latency of flow is %f",action->lat_current);
441 if (!(action->suspended))
442 lmm_update_variable_weight(network_maxmin_system, action->variable,
446 if (tmgr_trace_event_free(event_type))
447 nw_link->lat_event = NULL;
448 } else if (event_type == nw_link->lmm_resource.state_event) {
450 nw_link->lmm_resource.state_current = SURF_RESOURCE_ON;
452 lmm_constraint_t cnst = nw_link->lmm_resource.constraint;
453 lmm_variable_t var = NULL;
454 lmm_element_t elem = NULL;
456 nw_link->lmm_resource.state_current = SURF_RESOURCE_OFF;
457 while ((var = lmm_get_var_from_cnst
458 (network_maxmin_system, cnst, &elem))) {
459 surf_action_t action = lmm_variable_id(var);
461 if (surf_action_state_get(action) == SURF_ACTION_RUNNING ||
462 surf_action_state_get(action) == SURF_ACTION_READY) {
463 action->finish = date;
464 surf_network_model->action_state_set(action, SURF_ACTION_FAILED);
468 if (tmgr_trace_event_free(event_type))
469 nw_link->lmm_resource.state_event = NULL;
471 CRITICAL0("Unknown event ! \n");
479 static surf_action_t net_communicate(const char *src_name, const char *dst_name,
480 double size, double rate)
485 surf_action_network_CM02_t action = NULL;
486 double bandwidth_bound;
487 /* LARGE PLATFORMS HACK:
488 Add a link_CM02_t *link and a int link_nb to network_card_CM02_t. It will represent local links for this node
489 Use the cluster_id for ->id */
491 xbt_dynar_t route = global_routing->get_route(src_name, dst_name);
492 xbt_dynar_t back_route = NULL;
493 int constraints_per_variable = 0;
495 if( sg_network_fullduplex == 1){
496 back_route = global_routing->get_route(src_name, dst_name);
499 /* LARGE PLATFORMS HACK:
500 total_route_size = route_size + src->link_nb + dst->nb */
502 XBT_IN4("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
503 /* LARGE PLATFORMS HACK:
504 assert on total_route_size */
505 xbt_assert2(xbt_dynar_length(route),
506 "You're trying to send data from %s to %s but there is no connection between these two hosts.",
509 xbt_dynar_foreach(route, i, link) {
510 if (link->lmm_resource.state_current == SURF_RESOURCE_OFF) {
516 surf_action_new(sizeof(s_surf_action_network_CM02_t), size,
517 surf_network_model, failed);
518 (action->generic_action).latency_limited = 0;
520 xbt_swag_insert(action, action->generic_action.state_set);
523 action->latency = 0.0;
524 action->weight = 0.0;
525 bandwidth_bound = -1.0;
526 xbt_dynar_foreach(route, i, link) {
527 action->latency += link->lat_current;
530 sg_weight_S_parameter /
531 (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
532 if(bandwidth_bound < 0.0)
533 bandwidth_bound = (*bandwidth_factor_callback)(size) * (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
535 bandwidth_bound = min(bandwidth_bound, (*bandwidth_factor_callback)(size) * (link->lmm_resource.power.peak * link->lmm_resource.power.scale));
537 /* LARGE PLATFORMS HACK:
538 Add src->link and dst->link latencies */
539 action->lat_current = action->latency;
540 action->latency *= (*latency_factor_callback)(size);
541 action->rate = (*bandwidth_constraint_callback)(action->rate, bandwidth_bound, size);
543 /* LARGE PLATFORMS HACK:
544 lmm_variable_new(..., total_route_size) */
545 if(back_route != NULL){
546 constraints_per_variable = xbt_dynar_length(route)+xbt_dynar_length(back_route);
548 constraints_per_variable = xbt_dynar_length(route);
551 if (action->latency > 0)
553 lmm_variable_new(network_maxmin_system, action, 0.0, -1.0,constraints_per_variable);
556 lmm_variable_new(network_maxmin_system, action, 1.0, -1.0,constraints_per_variable);
558 if (action->rate < 0) {
559 if (action->lat_current > 0)
560 lmm_update_variable_bound(network_maxmin_system, action->variable,
561 sg_tcp_gamma / (2.0 * action->lat_current));
563 lmm_update_variable_bound(network_maxmin_system, action->variable,
566 if (action->lat_current > 0)
567 lmm_update_variable_bound(network_maxmin_system, action->variable,
569 sg_tcp_gamma / (2.0 *
570 action->lat_current)));
572 lmm_update_variable_bound(network_maxmin_system, action->variable,
576 xbt_dynar_foreach(route, i, link) {
577 lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
578 action->variable, 1.0);
581 if( sg_network_fullduplex == 1){
582 DEBUG1("Fullduplex active adding backward flow using 5%c", '%');
583 xbt_dynar_foreach(back_route, i, link) {
584 lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
585 action->variable, .05);
587 } /* LARGE PLATFORMS HACK:
588 expand also with src->link and dst->link */
591 action->src_name = xbt_new (char, strlen(src_name)+1);
592 strncpy (action->src_name, src_name, strlen(src_name)+1);
594 action->dst_name = xbt_new (char, strlen(dst_name)+1);
595 strncpy (action->dst_name, dst_name, strlen(dst_name)+1);
600 return (surf_action_t) action;
603 static double net_get_link_bandwidth(const void *link)
605 surf_resource_lmm_t lmm = (surf_resource_lmm_t) link;
606 return lmm->power.peak * lmm->power.scale;
609 static int net_link_shared(const void *link)
611 return lmm_constraint_is_shared(((surf_resource_lmm_t) link)->constraint);
614 static void net_action_suspend(surf_action_t action)
616 ((surf_action_network_CM02_t) action)->suspended = 1;
617 lmm_update_variable_weight(network_maxmin_system,
618 ((surf_action_network_CM02_t) action)->variable,
622 static void net_action_resume(surf_action_t action)
624 if (((surf_action_network_CM02_t) action)->suspended) {
625 lmm_update_variable_weight(network_maxmin_system,
626 ((surf_action_network_CM02_t)
628 ((surf_action_network_CM02_t) action)->weight);
629 ((surf_action_network_CM02_t) action)->suspended = 0;
633 static int net_action_is_suspended(surf_action_t action)
635 return ((surf_action_network_CM02_t) action)->suspended;
638 void net_action_set_max_duration(surf_action_t action, double duration)
640 action->max_duration = duration;
643 static void net_finalize(void)
645 surf_model_exit(surf_network_model);
646 surf_network_model = NULL;
648 global_routing->finalize();
650 lmm_system_free(network_maxmin_system);
651 network_maxmin_system = NULL;
654 static void surf_network_model_init_internal(void)
656 surf_network_model = surf_model_init();
658 surf_network_model->name = "network";
659 surf_network_model->action_unref = net_action_unref;
660 surf_network_model->action_cancel = net_action_cancel;
661 surf_network_model->action_recycle = net_action_recycle;
662 surf_network_model->get_remains = net_action_get_remains;
663 surf_network_model->get_latency_limited = net_get_link_latency;
665 surf_network_model->model_private->resource_used = net_resource_used;
666 surf_network_model->model_private->share_resources = net_share_resources;
667 surf_network_model->model_private->update_actions_state =
668 net_update_actions_state;
669 surf_network_model->model_private->update_resource_state =
670 net_update_resource_state;
671 surf_network_model->model_private->finalize = net_finalize;
673 surf_network_model->suspend = net_action_suspend;
674 surf_network_model->resume = net_action_resume;
675 surf_network_model->is_suspended = net_action_is_suspended;
676 surf_cpu_model->set_max_duration = net_action_set_max_duration;
678 surf_network_model->extension.network.communicate = net_communicate;
679 surf_network_model->extension.network.get_link_bandwidth =
680 net_get_link_bandwidth;
681 surf_network_model->extension.network.link_shared = net_link_shared;
682 surf_network_model->extension.network.add_traces = net_add_traces;
683 surf_network_model->extension.network.create_resource = net_create_resource;
685 if (!network_maxmin_system)
686 network_maxmin_system = lmm_system_new();
688 routing_model_create(sizeof(link_CM02_t),
689 net_link_new(xbt_strdup("__loopback__"),
690 498000000, NULL, 0.000015, NULL,
691 SURF_RESOURCE_ON, NULL, SURF_LINK_FATPIPE,
697 /************************************************************************/
698 /* New model based on LV08 and experimental results of MPI ping-pongs */
699 /************************************************************************/
700 void surf_network_model_init_SMPI(const char *filename)
703 if (surf_network_model)
705 surf_network_model_init_internal();
706 latency_factor_callback = &smpi_latency_factor;
707 bandwidth_factor_callback = &smpi_bandwidth_factor;
708 bandwidth_constraint_callback = &smpi_bandwidth_constraint;
709 net_define_callbacks(filename);
710 xbt_dynar_push(model_list, &surf_network_model);
711 network_solve = lmm_solve;
713 xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
715 update_model_description(surf_network_model_description,
716 "SMPI", surf_network_model);
719 /************************************************************************/
720 /* New model based on optimizations discussed during this thesis */
721 /************************************************************************/
722 void surf_network_model_init_LegrandVelho(const char *filename)
725 if (surf_network_model)
727 surf_network_model_init_internal();
728 net_define_callbacks(filename);
729 xbt_dynar_push(model_list, &surf_network_model);
730 network_solve = lmm_solve;
732 xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor",10.4);
733 xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
734 xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
736 update_model_description(surf_network_model_description,
737 "LV08", surf_network_model);
740 /***************************************************************************/
741 /* The nice TCP sharing model designed by Loris Marchal and Henri Casanova */
742 /***************************************************************************/
743 /* @TechReport{ rr-lip2002-40, */
744 /* author = {Henri Casanova and Loris Marchal}, */
745 /* institution = {LIP}, */
746 /* title = {A Network Model for Simulation of Grid Application}, */
747 /* number = {2002-40}, */
751 void surf_network_model_init_CM02(const char *filename)
754 if (surf_network_model)
756 surf_network_model_init_internal();
757 net_define_callbacks(filename);
758 xbt_dynar_push(model_list, &surf_network_model);
759 network_solve = lmm_solve;
761 update_model_description(surf_network_model_description,
762 "CM02", surf_network_model);
765 void surf_network_model_init_Reno(const char *filename)
767 if (surf_network_model)
769 surf_network_model_init_internal();
770 net_define_callbacks(filename);
772 xbt_dynar_push(model_list, &surf_network_model);
773 lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
774 network_solve = lagrange_solve;
776 xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
777 xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
778 xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
780 update_model_description(surf_network_model_description,
781 "Reno", surf_network_model);
785 void surf_network_model_init_Reno2(const char *filename)
787 if (surf_network_model)
789 surf_network_model_init_internal();
790 net_define_callbacks(filename);
792 xbt_dynar_push(model_list, &surf_network_model);
793 lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
795 network_solve = lagrange_solve;
797 xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
798 xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
799 xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S_parameter", 8775);
801 update_model_description(surf_network_model_description,
802 "Reno2", surf_network_model);
805 void surf_network_model_init_Vegas(const char *filename)
807 if (surf_network_model)
809 surf_network_model_init_internal();
810 net_define_callbacks(filename);
812 xbt_dynar_push(model_list, &surf_network_model);
813 lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
815 network_solve = lagrange_solve;
817 xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
818 xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
819 xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
821 update_model_description(surf_network_model_description,
822 "Vegas", surf_network_model);