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 back_route = NULL;
541 int constraints_per_variable = 0;
542 // I will need this route for some time so let's call get_route_no_cleanup
543 xbt_dynar_t route = global_routing->get_route_no_cleanup(src_name, dst_name);
546 if (sg_network_fullduplex == 1) {
547 back_route = global_routing->get_route(dst_name, src_name);
550 /* LARGE PLATFORMS HACK:
551 total_route_size = route_size + src->link_nb + dst->nb */
553 XBT_IN4("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
554 /* LARGE PLATFORMS HACK:
555 assert on total_route_size */
556 xbt_assert2(xbt_dynar_length(route),
557 "You're trying to send data from %s to %s but there is no connection between these two hosts.",
560 xbt_dynar_foreach(route, i, link) {
561 if (link->lmm_resource.state_current == SURF_RESOURCE_OFF) {
567 surf_action_new(sizeof(s_surf_action_network_CM02_t), size,
568 surf_network_model, failed);
569 #ifdef HAVE_LATENCY_BOUND_TRACKING
570 (action->generic_action).latency_limited = 0;
573 xbt_swag_insert(action, action->generic_action.state_set);
576 action->latency = 0.0;
577 action->weight = 0.0;
578 bandwidth_bound = -1.0;
579 xbt_dynar_foreach(route, i, link) {
580 action->latency += link->lat_current;
583 sg_weight_S_parameter /
584 (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
585 if (bandwidth_bound < 0.0)
587 (*bandwidth_factor_callback) (size) *
588 (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
592 (*bandwidth_factor_callback) (size) *
593 (link->lmm_resource.power.peak *
594 link->lmm_resource.power.scale));
596 /* LARGE PLATFORMS HACK:
597 Add src->link and dst->link latencies */
598 action->lat_current = action->latency;
599 action->latency *= (*latency_factor_callback) (size);
601 (*bandwidth_constraint_callback) (action->rate, bandwidth_bound,
604 /* LARGE PLATFORMS HACK:
605 lmm_variable_new(..., total_route_size) */
606 if (back_route != NULL) {
607 constraints_per_variable =
608 xbt_dynar_length(route) + xbt_dynar_length(back_route);
610 constraints_per_variable = xbt_dynar_length(route);
613 if (action->latency > 0)
615 lmm_variable_new(network_maxmin_system, action, 0.0, -1.0,
616 constraints_per_variable);
619 lmm_variable_new(network_maxmin_system, action, 1.0, -1.0,
620 constraints_per_variable);
622 if (action->rate < 0) {
623 if (action->lat_current > 0)
624 lmm_update_variable_bound(network_maxmin_system, action->variable,
625 sg_tcp_gamma / (2.0 *
626 action->lat_current));
628 lmm_update_variable_bound(network_maxmin_system, action->variable,
631 if (action->lat_current > 0)
632 lmm_update_variable_bound(network_maxmin_system, action->variable,
634 sg_tcp_gamma / (2.0 *
635 action->lat_current)));
637 lmm_update_variable_bound(network_maxmin_system, action->variable,
641 xbt_dynar_foreach(route, i, link) {
642 lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
643 action->variable, 1.0);
646 if (sg_network_fullduplex == 1) {
647 DEBUG1("Fullduplex active adding backward flow using 5%c", '%');
648 xbt_dynar_foreach(back_route, i, link) {
649 lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
650 action->variable, .05);
653 /* LARGE PLATFORMS HACK:
654 expand also with src->link and dst->link */
656 action->src_name = xbt_new(char, strlen(src_name) + 1);
657 strncpy(action->src_name, src_name, strlen(src_name) + 1);
659 action->dst_name = xbt_new(char, strlen(dst_name) + 1);
660 strncpy(action->dst_name, dst_name, strlen(dst_name) + 1);
663 xbt_dynar_free(&route);
666 return (surf_action_t) action;
669 static xbt_dynar_t net_get_route(const char *src, const char *dst)
671 return global_routing->get_route(src, dst);
674 static double net_get_link_bandwidth(const void *link)
676 surf_resource_lmm_t lmm = (surf_resource_lmm_t) link;
677 return lmm->power.peak * lmm->power.scale;
680 static double net_get_link_latency(const void *link)
682 return ((link_CM02_t) link)->lat_current;
685 static int net_link_shared(const void *link)
688 lmm_constraint_is_shared(((surf_resource_lmm_t) link)->constraint);
691 static void net_action_suspend(surf_action_t action)
693 ((surf_action_network_CM02_t) action)->suspended = 1;
694 lmm_update_variable_weight(network_maxmin_system,
695 ((surf_action_network_CM02_t)
696 action)->variable, 0.0);
699 static void net_action_resume(surf_action_t action)
701 if (((surf_action_network_CM02_t) action)->suspended) {
702 lmm_update_variable_weight(network_maxmin_system,
703 ((surf_action_network_CM02_t)
705 ((surf_action_network_CM02_t)
707 ((surf_action_network_CM02_t) action)->suspended = 0;
711 static int net_action_is_suspended(surf_action_t action)
713 return ((surf_action_network_CM02_t) action)->suspended;
716 void net_action_set_max_duration(surf_action_t action, double duration)
718 action->max_duration = duration;
721 static void net_finalize(void)
723 surf_model_exit(surf_network_model);
724 surf_network_model = NULL;
726 global_routing->finalize();
728 lmm_system_free(network_maxmin_system);
729 network_maxmin_system = NULL;
732 static void surf_network_model_init_internal(void)
734 surf_network_model = surf_model_init();
736 surf_network_model->name = "network";
737 surf_network_model->action_unref = net_action_unref;
738 surf_network_model->action_cancel = net_action_cancel;
739 surf_network_model->action_recycle = net_action_recycle;
740 surf_network_model->get_remains = net_action_get_remains;
741 #ifdef HAVE_LATENCY_BOUND_TRACKING
742 surf_network_model->get_latency_limited = net_get_link_latency_limited;
745 surf_network_model->model_private->resource_used = net_resource_used;
746 surf_network_model->model_private->share_resources = net_share_resources;
747 surf_network_model->model_private->update_actions_state =
748 net_update_actions_state;
749 surf_network_model->model_private->update_resource_state =
750 net_update_resource_state;
751 surf_network_model->model_private->finalize = net_finalize;
753 surf_network_model->suspend = net_action_suspend;
754 surf_network_model->resume = net_action_resume;
755 surf_network_model->is_suspended = net_action_is_suspended;
756 surf_cpu_model->set_max_duration = net_action_set_max_duration;
758 surf_network_model->extension.network.communicate = net_communicate;
759 surf_network_model->extension.network.get_route = net_get_route;
760 surf_network_model->extension.network.get_link_bandwidth =
761 net_get_link_bandwidth;
762 surf_network_model->extension.network.get_link_latency =
763 net_get_link_latency;
764 surf_network_model->extension.network.link_shared = net_link_shared;
765 surf_network_model->extension.network.add_traces = net_add_traces;
766 surf_network_model->extension.network.create_resource =
769 if (!network_maxmin_system)
770 network_maxmin_system = lmm_system_new();
772 routing_model_create(sizeof(link_CM02_t),
773 net_link_new(xbt_strdup("__loopback__"),
774 498000000, NULL, 0.000015, NULL,
775 SURF_RESOURCE_ON, NULL,
776 SURF_LINK_FATPIPE, NULL),
777 net_get_link_latency);
782 /************************************************************************/
783 /* New model based on LV08 and experimental results of MPI ping-pongs */
784 /************************************************************************/
785 void surf_network_model_init_SMPI(const char *filename)
788 if (surf_network_model)
790 surf_network_model_init_internal();
791 latency_factor_callback = &smpi_latency_factor;
792 bandwidth_factor_callback = &smpi_bandwidth_factor;
793 bandwidth_constraint_callback = &smpi_bandwidth_constraint;
794 net_define_callbacks(filename);
795 xbt_dynar_push(model_list, &surf_network_model);
796 network_solve = lmm_solve;
798 xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
800 update_model_description(surf_network_model_description,
801 "SMPI", surf_network_model);
804 /************************************************************************/
805 /* New model based on optimizations discussed during this thesis */
806 /************************************************************************/
807 void surf_network_model_init_LegrandVelho(const char *filename)
810 if (surf_network_model)
812 surf_network_model_init_internal();
813 net_define_callbacks(filename);
814 xbt_dynar_push(model_list, &surf_network_model);
815 network_solve = lmm_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",
820 xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
822 update_model_description(surf_network_model_description,
823 "LV08", surf_network_model);
826 /***************************************************************************/
827 /* The nice TCP sharing model designed by Loris Marchal and Henri Casanova */
828 /***************************************************************************/
829 /* @TechReport{ rr-lip2002-40, */
830 /* author = {Henri Casanova and Loris Marchal}, */
831 /* institution = {LIP}, */
832 /* title = {A Network Model for Simulation of Grid Application}, */
833 /* number = {2002-40}, */
837 void surf_network_model_init_CM02(const char *filename)
840 if (surf_network_model)
842 surf_network_model_init_internal();
843 net_define_callbacks(filename);
844 xbt_dynar_push(model_list, &surf_network_model);
845 network_solve = lmm_solve;
847 update_model_description(surf_network_model_description,
848 "CM02", surf_network_model);
851 void surf_network_model_init_Reno(const char *filename)
853 if (surf_network_model)
855 surf_network_model_init_internal();
856 net_define_callbacks(filename);
858 xbt_dynar_push(model_list, &surf_network_model);
859 lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
861 network_solve = lagrange_solve;
863 xbt_cfg_setdefault_double(_surf_cfg_set, "network/latency_factor", 10.4);
864 xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",
866 xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
868 update_model_description(surf_network_model_description,
869 "Reno", surf_network_model);
873 void surf_network_model_init_Reno2(const char *filename)
875 if (surf_network_model)
877 surf_network_model_init_internal();
878 net_define_callbacks(filename);
880 xbt_dynar_push(model_list, &surf_network_model);
881 lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
883 network_solve = lagrange_solve;
885 xbt_cfg_setdefault_double(_surf_cfg_set, "network/latency_factor", 10.4);
886 xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",
888 xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S_parameter",
891 update_model_description(surf_network_model_description,
892 "Reno2", surf_network_model);
895 void surf_network_model_init_Vegas(const char *filename)
897 if (surf_network_model)
899 surf_network_model_init_internal();
900 net_define_callbacks(filename);
902 xbt_dynar_push(model_list, &surf_network_model);
903 lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
905 network_solve = lagrange_solve;
907 xbt_cfg_setdefault_double(_surf_cfg_set, "network/latency_factor", 10.4);
908 xbt_cfg_setdefault_double(_surf_cfg_set, "network/bandwidth_factor",
910 xbt_cfg_setdefault_double(_surf_cfg_set, "network/weight_S", 8775);
912 update_model_description(surf_network_model_description,
913 "Vegas", surf_network_model);