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 = 1;
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_add_traces(void)
171 xbt_dict_cursor_t cursor = NULL;
172 char *trace_name, *elm;
174 static int called = 0;
179 /* connect all traces relative to network */
180 xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
181 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
183 xbt_dict_get_or_null(surf_network_model->resource_set, elm);
185 xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
187 xbt_assert2(trace, "Cannot connect trace %s to link %s: trace undefined",
190 link->lmm_resource.state_event =
191 tmgr_history_add_trace(history, trace, 0.0, 0, link);
194 xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
195 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
197 xbt_dict_get_or_null(surf_network_model->resource_set, elm);
199 xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
201 xbt_assert2(trace, "Cannot connect trace %s to link %s: trace undefined",
204 link->lmm_resource.power.event =
205 tmgr_history_add_trace(history, trace, 0.0, 0, link);
208 xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
209 tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
211 xbt_dict_get_or_null(surf_network_model->resource_set, elm);
213 xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
215 xbt_assert2(trace, "Cannot connect trace %s to link %s: trace undefined",
218 link->lat_event = tmgr_history_add_trace(history, trace, 0.0, 0, link);
222 static void net_define_callbacks(const char *file)
224 /* Figuring out the network links */
225 surfxml_add_callback(STag_surfxml_link_cb_list, &net_parse_link_init);
226 surfxml_add_callback(ETag_surfxml_platform_cb_list, &net_add_traces);
229 static int net_resource_used(void *resource_id)
231 return lmm_constraint_used(network_maxmin_system,
232 ((surf_resource_lmm_t) resource_id)->constraint);
235 static int net_action_unref(surf_action_t action)
238 if (!action->refcount) {
239 xbt_swag_remove(action, action->state_set);
240 if (((surf_action_network_CM02_t) action)->variable)
241 lmm_variable_free(network_maxmin_system,
242 ((surf_action_network_CM02_t) action)->variable);
249 static void net_action_cancel(surf_action_t action)
251 surf_network_model->action_state_set((surf_action_t) action,
256 static void net_action_recycle(surf_action_t action)
261 static int net_get_link_latency(surf_action_t action)
263 return action->latency_limited;
266 static double net_action_get_remains(surf_action_t action)
268 return action->remains;
271 static double net_share_resources(double now)
273 s_surf_action_network_CM02_t s_action;
274 surf_action_network_CM02_t action = NULL;
275 xbt_swag_t running_actions = surf_network_model->states.running_action_set;
278 min = generic_maxmin_share_resources(running_actions,
279 xbt_swag_offset(s_action,
281 network_maxmin_system, network_solve);
283 #define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + xbt_swag_offset(s_action, variable) )))
285 xbt_swag_foreach(action, running_actions) {
286 if( lmm_is_variable_limited_by_latency(action->variable) ){
287 (action->generic_action).latency_limited = 1;
289 (action->generic_action).latency_limited = 0;
291 if (action->latency > 0) {
293 min = action->latency;
294 else if (action->latency < min)
295 min = action->latency;
302 static void net_update_actions_state(double now, double delta)
305 surf_action_network_CM02_t action = NULL;
306 surf_action_network_CM02_t next_action = NULL;
307 xbt_swag_t running_actions = surf_network_model->states.running_action_set;
309 xbt_swag_t failed_actions =
310 surf_network_model->states.failed_action_set;
313 xbt_swag_foreach_safe(action, next_action, running_actions) {
316 xbt_dynar_t route = used_routing->get_route(action->src, action->dst);
319 xbt_dynar_foreach(route, i, link) {
320 TRACE_surf_link_set_utilization (link->lmm_resource.generic_resource.name,
321 action->generic_action.data, lmm_variable_getvalue(action->variable), now-delta, delta);
326 if (action->latency > 0) {
327 if (action->latency > deltap) {
328 double_update(&(action->latency), deltap);
331 double_update(&(deltap), action->latency);
332 action->latency = 0.0;
334 if ((action->latency == 0.0) && !(action->suspended))
335 lmm_update_variable_weight(network_maxmin_system, action->variable,
338 double_update(&(action->generic_action.remains),
339 lmm_variable_getvalue(action->variable) * deltap);
340 if (action->generic_action.max_duration != NO_MAX_DURATION)
341 double_update(&(action->generic_action.max_duration), delta);
343 if ((action->generic_action.remains <= 0) &&
344 (lmm_get_variable_weight(action->variable) > 0)) {
345 action->generic_action.finish = surf_get_clock();
346 surf_network_model->action_state_set((surf_action_t) action,
348 } else if ((action->generic_action.max_duration != NO_MAX_DURATION)
349 && (action->generic_action.max_duration <= 0)) {
350 action->generic_action.finish = surf_get_clock();
351 surf_network_model->action_state_set((surf_action_t) action,
359 static void net_update_resource_state(void *id,
360 tmgr_trace_event_t event_type,
361 double value, double date)
363 link_CM02_t nw_link = id;
364 /* printf("[" "%lg" "] Asking to update network card \"%s\" with value " */
365 /* "%lg" " for event %p\n", surf_get_clock(), nw_link->name, */
366 /* value, event_type); */
368 if (event_type == nw_link->lmm_resource.power.event) {
370 sg_weight_S_parameter / value - sg_weight_S_parameter /
371 (nw_link->lmm_resource.power.peak * nw_link->lmm_resource.power.scale);
372 lmm_variable_t var = NULL;
373 lmm_element_t elem = NULL;
374 surf_action_network_CM02_t action = NULL;
376 nw_link->lmm_resource.power.peak = value;
377 lmm_update_constraint_bound(network_maxmin_system,
378 nw_link->lmm_resource.constraint,
379 sg_bandwidth_factor *
380 (nw_link->lmm_resource.power.peak *
381 nw_link->lmm_resource.power.scale));
383 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));
385 if (sg_weight_S_parameter > 0) {
386 while ((var = lmm_get_var_from_cnst
387 (network_maxmin_system, nw_link->lmm_resource.constraint,
389 action = lmm_variable_id(var);
390 action->weight += delta;
391 if (!(action->suspended))
392 lmm_update_variable_weight(network_maxmin_system, action->variable,
396 if (tmgr_trace_event_free(event_type))
397 nw_link->lmm_resource.power.event = NULL;
398 } else if (event_type == nw_link->lat_event) {
399 double delta = value - nw_link->lat_current;
400 lmm_variable_t var = NULL;
401 lmm_element_t elem = NULL;
402 surf_action_network_CM02_t action = NULL;
404 nw_link->lat_current = value;
405 while ((var = lmm_get_var_from_cnst
406 (network_maxmin_system, nw_link->lmm_resource.constraint,
408 action = lmm_variable_id(var);
409 action->lat_current += delta;
410 action->weight += delta;
411 if (action->rate < 0)
412 lmm_update_variable_bound(network_maxmin_system, action->variable,
413 sg_tcp_gamma / (2.0 * action->lat_current));
415 lmm_update_variable_bound(network_maxmin_system, action->variable,
417 sg_tcp_gamma / (2.0 *
418 action->lat_current)));
420 if(action->rate < sg_tcp_gamma / (2.0 * action->lat_current) ){
421 INFO0("Flow is limited BYBANDWIDTH");
423 INFO1("Flow is limited BYLATENCY, latency of flow is %f",action->lat_current);
426 if (!(action->suspended))
427 lmm_update_variable_weight(network_maxmin_system, action->variable,
431 if (tmgr_trace_event_free(event_type))
432 nw_link->lat_event = NULL;
433 } else if (event_type == nw_link->lmm_resource.state_event) {
435 nw_link->lmm_resource.state_current = SURF_RESOURCE_ON;
437 lmm_constraint_t cnst = nw_link->lmm_resource.constraint;
438 lmm_variable_t var = NULL;
439 lmm_element_t elem = NULL;
441 nw_link->lmm_resource.state_current = SURF_RESOURCE_OFF;
442 while ((var = lmm_get_var_from_cnst
443 (network_maxmin_system, cnst, &elem))) {
444 surf_action_t action = lmm_variable_id(var);
446 if (surf_action_state_get(action) == SURF_ACTION_RUNNING ||
447 surf_action_state_get(action) == SURF_ACTION_READY) {
448 action->finish = date;
449 surf_network_model->action_state_set(action, SURF_ACTION_FAILED);
453 if (tmgr_trace_event_free(event_type))
454 nw_link->lmm_resource.state_event = NULL;
456 CRITICAL0("Unknown event ! \n");
464 static surf_action_t net_communicate(const char *src_name, const char *dst_name,
465 int src, int dst, double size, double rate)
470 surf_action_network_CM02_t action = NULL;
471 double bandwidth_bound;
472 /* LARGE PLATFORMS HACK:
473 Add a link_CM02_t *link and a int link_nb to network_card_CM02_t. It will represent local links for this node
474 Use the cluster_id for ->id */
475 xbt_dynar_t route = used_routing->get_route(src, dst);
476 xbt_dynar_t back_route = NULL;
477 int constraints_per_variable = 0;
479 if( sg_network_fullduplex == 1){
480 back_route = used_routing->get_route(dst, src);
483 /* LARGE PLATFORMS HACK:
484 total_route_size = route_size + src->link_nb + dst->nb */
486 XBT_IN4("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
487 /* LARGE PLATFORMS HACK:
488 assert on total_route_size */
489 xbt_assert2(xbt_dynar_length(route),
490 "You're trying to send data from %s to %s but there is no connection between these two hosts.",
493 xbt_dynar_foreach(route, i, link) {
494 if (link->lmm_resource.state_current == SURF_RESOURCE_OFF) {
500 surf_action_new(sizeof(s_surf_action_network_CM02_t), size,
501 surf_network_model, failed);
502 (action->generic_action).latency_limited = 0;
504 xbt_swag_insert(action, action->generic_action.state_set);
507 action->latency = 0.0;
508 action->weight = 0.0;
509 bandwidth_bound = -1.0;
510 xbt_dynar_foreach(route, i, link) {
511 action->latency += link->lat_current;
514 sg_weight_S_parameter /
515 (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
516 if(bandwidth_bound < 0.0)
517 bandwidth_bound = (*bandwidth_factor_callback)(size) * (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
519 bandwidth_bound = min(bandwidth_bound, (*bandwidth_factor_callback)(size) * (link->lmm_resource.power.peak * link->lmm_resource.power.scale));
521 /* LARGE PLATFORMS HACK:
522 Add src->link and dst->link latencies */
523 action->lat_current = action->latency;
524 action->latency *= (*latency_factor_callback)(size);
525 action->rate = (*bandwidth_constraint_callback)(action->rate, bandwidth_bound, size);
527 /* LARGE PLATFORMS HACK:
528 lmm_variable_new(..., total_route_size) */
529 if(back_route != NULL){
530 constraints_per_variable = xbt_dynar_length(route)+xbt_dynar_length(back_route);
532 constraints_per_variable = xbt_dynar_length(route);
535 if (action->latency > 0)
537 lmm_variable_new(network_maxmin_system, action, 0.0, -1.0,constraints_per_variable);
540 lmm_variable_new(network_maxmin_system, action, 1.0, -1.0,constraints_per_variable);
542 if (action->rate < 0) {
543 if (action->lat_current > 0)
544 lmm_update_variable_bound(network_maxmin_system, action->variable,
545 sg_tcp_gamma / (2.0 * action->lat_current));
547 lmm_update_variable_bound(network_maxmin_system, action->variable,
550 if (action->lat_current > 0)
551 lmm_update_variable_bound(network_maxmin_system, action->variable,
553 sg_tcp_gamma / (2.0 *
554 action->lat_current)));
556 lmm_update_variable_bound(network_maxmin_system, action->variable,
560 xbt_dynar_foreach(route, i, link) {
561 lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
562 action->variable, 1.0);
565 if( sg_network_fullduplex == 1){
566 DEBUG1("Fullduplex active adding backward flow using 5%c", '%');
567 xbt_dynar_foreach(back_route, i, link) {
568 lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
569 action->variable, .05);
571 } /* LARGE PLATFORMS HACK:
572 expand also with src->link and dst->link */
574 /* saving the src and dst of this communication */
580 return (surf_action_t) action;
583 static double net_get_link_bandwidth(const void *link)
585 surf_resource_lmm_t lmm = (surf_resource_lmm_t) link;
586 return lmm->power.peak * lmm->power.scale;
589 static int net_link_shared(const void *link)
591 return lmm_constraint_is_shared(((surf_resource_lmm_t) link)->constraint);
594 static void net_action_suspend(surf_action_t action)
596 ((surf_action_network_CM02_t) action)->suspended = 1;
597 lmm_update_variable_weight(network_maxmin_system,
598 ((surf_action_network_CM02_t) action)->variable,
602 static void net_action_resume(surf_action_t action)
604 if (((surf_action_network_CM02_t) action)->suspended) {
605 lmm_update_variable_weight(network_maxmin_system,
606 ((surf_action_network_CM02_t)
608 ((surf_action_network_CM02_t) action)->weight);
609 ((surf_action_network_CM02_t) action)->suspended = 0;
613 static int net_action_is_suspended(surf_action_t action)
615 return ((surf_action_network_CM02_t) action)->suspended;
618 static void net_action_set_max_duration(surf_action_t action, double duration)
620 action->max_duration = duration;
625 * FIXME : this should be done in the binding code !!
627 void network_create_resource(char *name,
628 double initial_bandwidth,double initial_latency)
633 tmgr_trace_t bw_trace;
635 tmgr_trace_t lat_trace;
636 e_surf_resource_state_t state_initial_link = SURF_RESOURCE_ON;
637 e_surf_link_sharing_policy_t policy_initial_link = SURF_LINK_SHARED;
638 tmgr_trace_t state_trace;
640 name_link = xbt_strdup(name);
641 bw_initial = initial_bandwidth;
642 bw_trace = tmgr_trace_new("");
643 lat_initial = initial_latency;
644 lat_trace = tmgr_trace_new("");
645 // FIXME Hard Coded Values
646 //state_initial_link = SURF_RESOURCE_ON;
647 //policy_initial_link = SURF_LINK_SHARED;
648 state_trace = tmgr_trace_new("");
650 net_link_new(name_link, bw_initial, bw_trace,
651 lat_initial, lat_trace, state_initial_link, state_trace,
652 policy_initial_link, xbt_dict_new());
655 static void net_finalize(void)
657 surf_model_exit(surf_network_model);
658 surf_network_model = NULL;
660 used_routing->finalize();
661 lmm_system_free(network_maxmin_system);
662 network_maxmin_system = NULL;
665 static void surf_network_model_init_internal(void)
667 surf_network_model = surf_model_init();
669 surf_network_model->name = "network";
670 surf_network_model->action_unref = net_action_unref;
671 surf_network_model->action_cancel = net_action_cancel;
672 surf_network_model->action_recycle = net_action_recycle;
673 surf_network_model->get_remains = net_action_get_remains;
674 surf_network_model->get_latency_limited = net_get_link_latency;
676 surf_network_model->model_private->resource_used = net_resource_used;
677 surf_network_model->model_private->share_resources = net_share_resources;
678 surf_network_model->model_private->update_actions_state =
679 net_update_actions_state;
680 surf_network_model->model_private->update_resource_state =
681 net_update_resource_state;
682 surf_network_model->model_private->finalize = net_finalize;
684 surf_network_model->suspend = net_action_suspend;
685 surf_network_model->resume = net_action_resume;
686 surf_network_model->is_suspended = net_action_is_suspended;
687 surf_cpu_model->set_max_duration = net_action_set_max_duration;
689 surf_network_model->extension.network.communicate = net_communicate;
690 surf_network_model->extension.network.get_link_bandwidth =
691 net_get_link_bandwidth;
692 surf_network_model->extension.network.link_shared = net_link_shared;
693 surf_network_model->extension.network.create_resource = network_create_resource;
694 surf_network_model->extension.network.add_traces = net_add_traces;
696 if (!network_maxmin_system)
697 network_maxmin_system = lmm_system_new();
699 routing_model_create(sizeof(link_CM02_t),
700 net_link_new(xbt_strdup("__loopback__"),
701 498000000, NULL, 0.000015, NULL,
702 SURF_RESOURCE_ON, NULL, SURF_LINK_FATPIPE,
708 /************************************************************************/
709 /* New model based on LV08 and experimental results of MPI ping-pongs */
710 /************************************************************************/
711 void surf_network_model_init_SMPI(const char *filename)
714 if (surf_network_model)
716 surf_network_model_init_internal();
717 latency_factor_callback = &smpi_latency_factor;
718 bandwidth_factor_callback = &smpi_bandwidth_factor;
719 bandwidth_constraint_callback = &smpi_bandwidth_constraint;
720 net_define_callbacks(filename);
721 xbt_dynar_push(model_list, &surf_network_model);
722 network_solve = lmm_solve;
724 xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
726 update_model_description(surf_network_model_description,
727 "SMPI", surf_network_model);
730 /************************************************************************/
731 /* New model based on optimizations discussed during this thesis */
732 /************************************************************************/
733 void surf_network_model_init_LegrandVelho(const char *filename)
736 if (surf_network_model)
738 surf_network_model_init_internal();
739 net_define_callbacks(filename);
740 xbt_dynar_push(model_list, &surf_network_model);
741 network_solve = lmm_solve;
743 xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor",10.4);
744 xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
745 xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
747 update_model_description(surf_network_model_description,
748 "LV08", surf_network_model);
751 /***************************************************************************/
752 /* The nice TCP sharing model designed by Loris Marchal and Henri Casanova */
753 /***************************************************************************/
754 /* @TechReport{ rr-lip2002-40, */
755 /* author = {Henri Casanova and Loris Marchal}, */
756 /* institution = {LIP}, */
757 /* title = {A Network Model for Simulation of Grid Application}, */
758 /* number = {2002-40}, */
762 void surf_network_model_init_CM02(const char *filename)
765 if (surf_network_model)
767 surf_network_model_init_internal();
768 net_define_callbacks(filename);
769 xbt_dynar_push(model_list, &surf_network_model);
770 network_solve = lmm_solve;
772 update_model_description(surf_network_model_description,
773 "CM02", surf_network_model);
776 void surf_network_model_init_Reno(const char *filename)
778 if (surf_network_model)
780 surf_network_model_init_internal();
781 net_define_callbacks(filename);
783 xbt_dynar_push(model_list, &surf_network_model);
784 lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
785 network_solve = lagrange_solve;
787 xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
788 xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
789 xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
791 update_model_description(surf_network_model_description,
792 "Reno", surf_network_model);
796 void surf_network_model_init_Reno2(const char *filename)
798 if (surf_network_model)
800 surf_network_model_init_internal();
801 net_define_callbacks(filename);
803 xbt_dynar_push(model_list, &surf_network_model);
804 lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
806 network_solve = lagrange_solve;
808 xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
809 xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
810 xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S_parameter", 8775);
812 update_model_description(surf_network_model_description,
813 "Reno2", surf_network_model);
816 void surf_network_model_init_Vegas(const char *filename)
818 if (surf_network_model)
820 surf_network_model_init_internal();
821 net_define_callbacks(filename);
823 xbt_dynar_push(model_list, &surf_network_model);
824 lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
826 network_solve = lagrange_solve;
828 xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
829 xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
830 xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
832 update_model_description(surf_network_model_description,
833 "Vegas", surf_network_model);