Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
removing code that was used to trace every single surf action
[simgrid.git] / src / surf / network.c
1 /*      $Id$     */
2
3 /* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #include "network_private.h"
9 #include "xbt/log.h"
10 #include "xbt/str.h"
11
12 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network, surf,
13                                 "Logging specific to the SURF network module");
14
15 surf_model_t surf_network_model = NULL;
16 static lmm_system_t network_maxmin_system = NULL;
17 static void (*network_solve) (lmm_system_t) = NULL;
18
19 double sg_latency_factor = 1.0;    /* default value; can be set by model or from command line */
20 double sg_bandwidth_factor = 1.0;  /* default value; can be set by model or from command line */
21 double sg_weight_S_parameter = 0.0;/* default value; can be set by model or from command line */
22
23 double sg_tcp_gamma = 0.0;
24
25
26 static link_CM02_t net_link_new(char *name,
27                             double bw_initial,
28                             tmgr_trace_t bw_trace,
29                             double lat_initial,
30                             tmgr_trace_t lat_trace,
31                             e_surf_resource_state_t
32                             state_initial,
33                             tmgr_trace_t state_trace,
34                             e_surf_link_sharing_policy_t
35                             policy, xbt_dict_t properties)
36 {
37   link_CM02_t nw_link = (link_CM02_t)
38     surf_resource_lmm_new(sizeof(s_link_CM02_t),
39                           surf_network_model, name, properties,
40                           network_maxmin_system,
41                           sg_bandwidth_factor * bw_initial,
42                           history,
43                           state_initial, state_trace,
44                           bw_initial, bw_trace);
45
46   xbt_assert1(!xbt_dict_get_or_null(surf_network_model->resource_set, name),
47               "Link '%s' declared several times in the platform file.", name);
48
49   nw_link->lat_current = lat_initial;
50   if (lat_trace)
51     nw_link->lat_event =
52       tmgr_history_add_trace(history, lat_trace, 0.0, 0, nw_link);
53
54   if (policy == SURF_LINK_FATPIPE)
55     lmm_constraint_shared(nw_link->lmm_resource.constraint);
56
57   xbt_dict_set(surf_network_model->resource_set, name, nw_link,
58                surf_resource_free);
59 #ifdef HAVE_TRACING
60   TRACE_surf_link_declaration (name, bw_initial, lat_initial);
61 #endif
62
63   return nw_link;
64 }
65
66 static void net_parse_link_init(void)
67 {
68   char *name_link;
69   double bw_initial;
70   tmgr_trace_t bw_trace;
71   double lat_initial;
72   tmgr_trace_t lat_trace;
73   e_surf_resource_state_t state_initial_link = SURF_RESOURCE_ON;
74   e_surf_link_sharing_policy_t policy_initial_link = SURF_LINK_SHARED;
75   tmgr_trace_t state_trace;
76
77   name_link = xbt_strdup(A_surfxml_link_id);
78   surf_parse_get_double(&bw_initial, A_surfxml_link_bandwidth);
79   bw_trace = tmgr_trace_new(A_surfxml_link_bandwidth_file);
80   surf_parse_get_double(&lat_initial, A_surfxml_link_latency);
81   lat_trace = tmgr_trace_new(A_surfxml_link_latency_file);
82
83   xbt_assert0((A_surfxml_link_state == A_surfxml_link_state_ON)
84               || (A_surfxml_link_state ==
85                   A_surfxml_link_state_OFF), "Invalid state");
86   if (A_surfxml_link_state == A_surfxml_link_state_ON)
87     state_initial_link = SURF_RESOURCE_ON;
88   else if (A_surfxml_link_state == A_surfxml_link_state_OFF)
89     state_initial_link = SURF_RESOURCE_OFF;
90
91   if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_SHARED)
92     policy_initial_link = SURF_LINK_SHARED;
93   else if (A_surfxml_link_sharing_policy ==
94            A_surfxml_link_sharing_policy_FATPIPE)
95     policy_initial_link = SURF_LINK_FATPIPE;
96
97   state_trace = tmgr_trace_new(A_surfxml_link_state_file);
98
99   net_link_new(name_link, bw_initial, bw_trace,
100            lat_initial, lat_trace, state_initial_link, state_trace,
101            policy_initial_link, xbt_dict_new());
102
103 }
104
105 static void net_add_traces(void)
106 {
107   xbt_dict_cursor_t cursor = NULL;
108   char *trace_name, *elm;
109
110   static int called = 0;
111   if (called)
112     return;
113   called = 1;
114
115   /* connect all traces relative to network */
116   xbt_dict_foreach(trace_connect_list_link_avail, cursor, trace_name, elm) {
117     tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
118     link_CM02_t link =
119       xbt_dict_get_or_null(surf_network_model->resource_set, elm);
120
121     xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
122                 trace_name, elm);
123     xbt_assert2(trace, "Cannot connect trace %s to link %s: trace undefined",
124                 trace_name, elm);
125
126     link->lmm_resource.state_event =
127       tmgr_history_add_trace(history, trace, 0.0, 0, link);
128   }
129
130   xbt_dict_foreach(trace_connect_list_bandwidth, cursor, trace_name, elm) {
131     tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
132     link_CM02_t link =
133       xbt_dict_get_or_null(surf_network_model->resource_set, elm);
134
135     xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
136                 trace_name, elm);
137     xbt_assert2(trace, "Cannot connect trace %s to link %s: trace undefined",
138                 trace_name, elm);
139
140     link->lmm_resource.power.event =
141       tmgr_history_add_trace(history, trace, 0.0, 0, link);
142   }
143
144   xbt_dict_foreach(trace_connect_list_latency, cursor, trace_name, elm) {
145     tmgr_trace_t trace = xbt_dict_get_or_null(traces_set_list, trace_name);
146     link_CM02_t link =
147       xbt_dict_get_or_null(surf_network_model->resource_set, elm);
148
149     xbt_assert2(link, "Cannot connect trace %s to link %s: link undefined",
150                 trace_name, elm);
151     xbt_assert2(trace, "Cannot connect trace %s to link %s: trace undefined",
152                 trace_name, elm);
153
154     link->lat_event = tmgr_history_add_trace(history, trace, 0.0, 0, link);
155   }
156 }
157
158 static void net_define_callbacks(const char *file)
159 {
160   /* Figuring out the network links */
161   surfxml_add_callback(STag_surfxml_link_cb_list, &net_parse_link_init);
162   surfxml_add_callback(ETag_surfxml_platform_cb_list, &net_add_traces);
163 }
164
165 static int net_resource_used(void *resource_id)
166 {
167   return lmm_constraint_used(network_maxmin_system,
168                              ((surf_resource_lmm_t) resource_id)->constraint);
169 }
170
171 static int net_action_unref(surf_action_t action)
172 {
173   action->refcount--;
174   if (!action->refcount) {
175     xbt_swag_remove(action, action->state_set);
176     if (((surf_action_network_CM02_t) action)->variable)
177       lmm_variable_free(network_maxmin_system,
178                         ((surf_action_network_CM02_t) action)->variable);
179     free(action);
180     return 1;
181   }
182   return 0;
183 }
184
185 static void net_action_cancel(surf_action_t action)
186 {
187   surf_network_model->action_state_set((surf_action_t) action,
188                                        SURF_ACTION_FAILED);
189   return;
190 }
191
192 static void net_action_recycle(surf_action_t action)
193 {
194   return;
195 }
196
197 static double net_action_get_remains(surf_action_t action)
198 {
199   return action->remains;
200 }
201
202 static double net_share_resources(double now)
203 {
204   s_surf_action_network_CM02_t s_action;
205   surf_action_network_CM02_t action = NULL;
206   xbt_swag_t running_actions = surf_network_model->states.running_action_set;
207   double min;
208
209   min = generic_maxmin_share_resources(running_actions,
210                                        xbt_swag_offset(s_action,
211                                                        variable),
212                                        network_maxmin_system, network_solve);
213
214 #define VARIABLE(action) (*((lmm_variable_t*)(((char *) (action)) + xbt_swag_offset(s_action, variable)  )))
215
216   xbt_swag_foreach(action, running_actions) {
217     if (action->latency > 0) {
218       if (min < 0)
219         min = action->latency;
220       else if (action->latency < min)
221         min = action->latency;
222     }
223   }
224
225   return min;
226 }
227
228 static void net_update_actions_state(double now, double delta)
229 {
230   double deltap = 0.0;
231   surf_action_network_CM02_t action = NULL;
232   surf_action_network_CM02_t next_action = NULL;
233   xbt_swag_t running_actions = surf_network_model->states.running_action_set;
234   /*
235      xbt_swag_t failed_actions =
236      surf_network_model->states.failed_action_set;
237    */
238
239   xbt_swag_foreach_safe(action, next_action, running_actions) {
240
241 #ifdef HAVE_TRACING
242     xbt_dynar_t route = used_routing->get_route(action->src, action->dst);
243     link_CM02_t link;
244     unsigned int i;
245     xbt_dynar_foreach(route, i, link) {
246       TRACE_surf_update_action_state_net_resource (link->lmm_resource.generic_resource.name,
247           action->generic_action.data, lmm_variable_getvalue(action->variable), now-delta, delta);
248     }
249 #endif
250
251     deltap = delta;
252     if (action->latency > 0) {
253       if (action->latency > deltap) {
254         double_update(&(action->latency), deltap);
255         deltap = 0.0;
256       } else {
257         double_update(&(deltap), action->latency);
258         action->latency = 0.0;
259       }
260       if ((action->latency == 0.0) && !(action->suspended))
261         lmm_update_variable_weight(network_maxmin_system, action->variable,
262                                    action->weight);
263     }
264     double_update(&(action->generic_action.remains),
265                   lmm_variable_getvalue(action->variable) * deltap);
266     if (action->generic_action.max_duration != NO_MAX_DURATION)
267       double_update(&(action->generic_action.max_duration), delta);
268
269     if ((action->generic_action.remains <= 0) &&
270         (lmm_get_variable_weight(action->variable) > 0)) {
271       action->generic_action.finish = surf_get_clock();
272       surf_network_model->action_state_set((surf_action_t) action,
273                                            SURF_ACTION_DONE);
274     } else if ((action->generic_action.max_duration != NO_MAX_DURATION)
275                && (action->generic_action.max_duration <= 0)) {
276       action->generic_action.finish = surf_get_clock();
277       surf_network_model->action_state_set((surf_action_t) action,
278                                            SURF_ACTION_DONE);
279     }
280   }
281
282   return;
283 }
284
285 static void net_update_resource_state(void *id,
286                                   tmgr_trace_event_t event_type,
287                                   double value, double date)
288 {
289   link_CM02_t nw_link = id;
290   /*   printf("[" "%lg" "] Asking to update network card \"%s\" with value " */
291   /*     "%lg" " for event %p\n", surf_get_clock(), nw_link->name, */
292   /*     value, event_type); */
293
294   if (event_type == nw_link->lmm_resource.power.event) {
295     double delta =
296       sg_weight_S_parameter / value - sg_weight_S_parameter /
297       (nw_link->lmm_resource.power.peak * nw_link->lmm_resource.power.scale);
298     lmm_variable_t var = NULL;
299     lmm_element_t elem = NULL;
300     surf_action_network_CM02_t action = NULL;
301
302     nw_link->lmm_resource.power.peak = value;
303     lmm_update_constraint_bound(network_maxmin_system,
304                                 nw_link->lmm_resource.constraint,
305                                 sg_bandwidth_factor *
306                                 (nw_link->lmm_resource.power.peak *
307                                  nw_link->lmm_resource.power.scale));
308 #ifdef HAVE_TRACING
309     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));
310 #endif
311     if (sg_weight_S_parameter > 0) {
312       while ((var = lmm_get_var_from_cnst
313               (network_maxmin_system, nw_link->lmm_resource.constraint,
314                &elem))) {
315         action = lmm_variable_id(var);
316         action->weight += delta;
317         if (!(action->suspended))
318           lmm_update_variable_weight(network_maxmin_system, action->variable,
319                                      action->weight);
320       }
321     }
322     if (tmgr_trace_event_free(event_type))
323       nw_link->lmm_resource.power.event = NULL;
324   } else if (event_type == nw_link->lat_event) {
325     double delta = value - nw_link->lat_current;
326     lmm_variable_t var = NULL;
327     lmm_element_t elem = NULL;
328     surf_action_network_CM02_t action = NULL;
329
330     nw_link->lat_current = value;
331     while ((var = lmm_get_var_from_cnst
332             (network_maxmin_system, nw_link->lmm_resource.constraint,
333              &elem))) {
334       action = lmm_variable_id(var);
335       action->lat_current += delta;
336       action->weight += delta;
337       if (action->rate < 0)
338         lmm_update_variable_bound(network_maxmin_system, action->variable,
339                                   sg_tcp_gamma / (2.0 * action->lat_current));
340       else
341         lmm_update_variable_bound(network_maxmin_system, action->variable,
342                                   min(action->rate,
343                                       sg_tcp_gamma / (2.0 *
344                                                       action->lat_current)));
345       if (!(action->suspended))
346         lmm_update_variable_weight(network_maxmin_system, action->variable,
347                                    action->weight);
348
349     }
350     if (tmgr_trace_event_free(event_type))
351       nw_link->lat_event = NULL;
352   } else if (event_type == nw_link->lmm_resource.state_event) {
353     if (value > 0)
354       nw_link->lmm_resource.state_current = SURF_RESOURCE_ON;
355     else {
356       lmm_constraint_t cnst = nw_link->lmm_resource.constraint;
357       lmm_variable_t var = NULL;
358       lmm_element_t elem = NULL;
359
360       nw_link->lmm_resource.state_current = SURF_RESOURCE_OFF;
361       while ((var = lmm_get_var_from_cnst
362               (network_maxmin_system, cnst, &elem))) {
363         surf_action_t action = lmm_variable_id(var);
364
365         if (surf_action_state_get(action) == SURF_ACTION_RUNNING ||
366             surf_action_state_get(action) == SURF_ACTION_READY) {
367           action->finish = date;
368           surf_network_model->action_state_set(action, SURF_ACTION_FAILED);
369         }
370       }
371     }
372     if (tmgr_trace_event_free(event_type))
373       nw_link->lmm_resource.state_event = NULL;
374   } else {
375     CRITICAL0("Unknown event ! \n");
376     xbt_abort();
377   }
378
379   return;
380 }
381
382 static surf_action_t net_communicate(const char *src_name, const char *dst_name,
383                                  int src, int dst, double size, double rate)
384 {
385   surf_action_network_CM02_t action = NULL;
386   /* LARGE PLATFORMS HACK:
387      Add a link_CM02_t *link and a int link_nb to network_card_CM02_t. It will represent local links for this node
388      Use the cluster_id for ->id */
389   xbt_dynar_t route = used_routing->get_route(src, dst);
390   /* LARGE PLATFORMS HACK:
391      total_route_size = route_size + src->link_nb + dst->nb */
392   unsigned int i;
393
394   XBT_IN4("(%s,%s,%g,%g)", src_name, dst_name, size, rate);
395   /* LARGE PLATFORMS HACK:
396      assert on total_route_size */
397   xbt_assert2(xbt_dynar_length(route),
398               "You're trying to send data from %s to %s but there is no connection between these two hosts.",
399               src_name, dst_name);
400
401   link_CM02_t link;
402   int failed = 0;
403   xbt_dynar_foreach(route, i, link) {
404     if (link->lmm_resource.state_current == SURF_RESOURCE_OFF) {
405       failed = 1;
406       break;
407     }
408   }
409   action =
410     surf_action_new(sizeof(s_surf_action_network_CM02_t), size,
411                     surf_network_model, failed);
412
413   xbt_swag_insert(action, action->generic_action.state_set);
414   action->rate = rate;
415
416   action->latency = 0.0;
417   action->weight = 0.0;
418   xbt_dynar_foreach(route, i, link) {
419     action->latency += link->lat_current;
420     action->weight +=
421       link->lat_current +
422       sg_weight_S_parameter /
423       (link->lmm_resource.power.peak * link->lmm_resource.power.scale);
424   }
425   /* LARGE PLATFORMS HACK:
426      Add src->link and dst->link latencies */
427   action->lat_current = action->latency;
428   action->latency *= sg_latency_factor;
429
430   /* LARGE PLATFORMS HACK:
431      lmm_variable_new(..., total_route_size) */
432   if (action->latency > 0)
433     action->variable =
434       lmm_variable_new(network_maxmin_system, action, 0.0, -1.0,
435                        xbt_dynar_length(route));
436   else
437     action->variable =
438       lmm_variable_new(network_maxmin_system, action, 1.0, -1.0,
439                        xbt_dynar_length(route));
440
441   if (action->rate < 0) {
442     if (action->lat_current > 0)
443       lmm_update_variable_bound(network_maxmin_system, action->variable,
444                                 sg_tcp_gamma / (2.0 * action->lat_current));
445     else
446       lmm_update_variable_bound(network_maxmin_system, action->variable,
447                                 -1.0);
448   } else {
449     if (action->lat_current > 0)
450       lmm_update_variable_bound(network_maxmin_system, action->variable,
451                                 min(action->rate,
452                                     sg_tcp_gamma / (2.0 *
453                                                     action->lat_current)));
454     else
455       lmm_update_variable_bound(network_maxmin_system, action->variable,
456                                 action->rate);
457   }
458
459   xbt_dynar_foreach(route, i, link) {
460     lmm_expand(network_maxmin_system, link->lmm_resource.constraint,
461                action->variable, 1.0);
462   }
463   /* LARGE PLATFORMS HACK:
464      expand also with src->link and dst->link */
465
466   /* saving the src and dst of this communication */
467   action->src = src;
468   action->dst = dst;
469
470   XBT_OUT;
471
472   return (surf_action_t) action;
473 }
474
475 static double net_get_link_bandwidth(const void *link)
476 {
477   surf_resource_lmm_t lmm = (surf_resource_lmm_t) link;
478   return lmm->power.peak * lmm->power.scale;
479 }
480
481 static double net_get_link_latency(const void *link)
482 {
483   return ((link_CM02_t) link)->lat_current;
484 }
485
486 static int net_link_shared(const void *link)
487 {
488   return lmm_constraint_is_shared(((surf_resource_lmm_t) link)->constraint);
489 }
490
491 static void net_action_suspend(surf_action_t action)
492 {
493   ((surf_action_network_CM02_t) action)->suspended = 1;
494   lmm_update_variable_weight(network_maxmin_system,
495                              ((surf_action_network_CM02_t) action)->variable,
496                              0.0);
497 }
498
499 static void net_action_resume(surf_action_t action)
500 {
501   if (((surf_action_network_CM02_t) action)->suspended) {
502     lmm_update_variable_weight(network_maxmin_system,
503                                ((surf_action_network_CM02_t)
504                                 action)->variable,
505                                ((surf_action_network_CM02_t) action)->weight);
506     ((surf_action_network_CM02_t) action)->suspended = 0;
507   }
508 }
509
510 static int net_action_is_suspended(surf_action_t action)
511 {
512   return ((surf_action_network_CM02_t) action)->suspended;
513 }
514
515 static void net_action_set_max_duration(surf_action_t action, double duration)
516 {
517   action->max_duration = duration;
518 }
519
520 static void net_finalize(void)
521 {
522   surf_model_exit(surf_network_model);
523   surf_network_model = NULL;
524
525   used_routing->finalize();
526   lmm_system_free(network_maxmin_system);
527   network_maxmin_system = NULL;
528 }
529
530 static void surf_network_model_init_internal(void)
531 {
532   surf_network_model = surf_model_init();
533
534   surf_network_model->name = "network";
535   surf_network_model->action_unref = net_action_unref;
536   surf_network_model->action_cancel = net_action_cancel;
537   surf_network_model->action_recycle = net_action_recycle;
538   surf_network_model->get_remains = net_action_get_remains;
539
540   surf_network_model->model_private->resource_used = net_resource_used;
541   surf_network_model->model_private->share_resources = net_share_resources;
542   surf_network_model->model_private->update_actions_state =
543     net_update_actions_state;
544   surf_network_model->model_private->update_resource_state =
545     net_update_resource_state;
546   surf_network_model->model_private->finalize = net_finalize;
547
548   surf_network_model->suspend = net_action_suspend;
549   surf_network_model->resume = net_action_resume;
550   surf_network_model->is_suspended = net_action_is_suspended;
551   surf_cpu_model->set_max_duration = net_action_set_max_duration;
552
553   surf_network_model->extension.network.communicate = net_communicate;
554   surf_network_model->extension.network.get_link_bandwidth =
555     net_get_link_bandwidth;
556   surf_network_model->extension.network.get_link_latency = net_get_link_latency;
557   surf_network_model->extension.network.link_shared = net_link_shared;
558
559   if (!network_maxmin_system)
560     network_maxmin_system = lmm_system_new();
561
562   routing_model_create(sizeof(link_CM02_t),
563                        net_link_new(xbt_strdup("__loopback__"),
564                                 498000000, NULL, 0.000015, NULL,
565                                 SURF_RESOURCE_ON, NULL, SURF_LINK_FATPIPE,
566                                 NULL));
567 }
568
569 /************************************************************************/
570 /* New model based on optimizations discussed during this thesis        */
571 /************************************************************************/
572 void surf_network_model_init_LegrandVelho(const char *filename)
573 {
574
575   if (surf_network_model)
576     return;
577   surf_network_model_init_internal();
578   net_define_callbacks(filename);
579   xbt_dynar_push(model_list, &surf_network_model);
580   network_solve = lmm_solve;
581
582   xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor",10.4);
583   xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
584   xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
585
586   update_model_description(surf_network_model_description,
587                            "LV08", surf_network_model);
588 }
589
590 /***************************************************************************/
591 /* The nice TCP sharing model designed by Loris Marchal and Henri Casanova */
592 /***************************************************************************/
593 /* @TechReport{      rr-lip2002-40, */
594 /*   author        = {Henri Casanova and Loris Marchal}, */
595 /*   institution   = {LIP}, */
596 /*   title         = {A Network Model for Simulation of Grid Application}, */
597 /*   number        = {2002-40}, */
598 /*   month         = {oct}, */
599 /*   year          = {2002} */
600 /* } */
601 void surf_network_model_init_CM02(const char *filename)
602 {
603
604   if (surf_network_model)
605     return;
606   surf_network_model_init_internal();
607   net_define_callbacks(filename);
608   xbt_dynar_push(model_list, &surf_network_model);
609   network_solve = lmm_solve;
610
611   update_model_description(surf_network_model_description,
612                            "CM02", surf_network_model);
613 }
614
615 void surf_network_model_init_Reno(const char *filename)
616 {
617   if (surf_network_model)
618     return;
619   surf_network_model_init_internal();
620   net_define_callbacks(filename);
621
622   xbt_dynar_push(model_list, &surf_network_model);
623   lmm_set_default_protocol_function(func_reno_f, func_reno_fp, func_reno_fpi);
624   network_solve = lagrange_solve;
625
626   xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
627   xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
628   xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
629
630   update_model_description(surf_network_model_description,
631                            "Reno", surf_network_model);
632 }
633
634
635 void surf_network_model_init_Reno2(const char *filename)
636 {
637   if (surf_network_model)
638     return;
639   surf_network_model_init_internal();
640   net_define_callbacks(filename);
641
642   xbt_dynar_push(model_list, &surf_network_model);
643   lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
644                                     func_reno2_fpi);
645   network_solve = lagrange_solve;
646
647   xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
648   xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
649   xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S_parameter", 8775);
650
651   update_model_description(surf_network_model_description,
652                            "Reno2", surf_network_model);
653 }
654
655 void surf_network_model_init_Vegas(const char *filename)
656 {
657   if (surf_network_model)
658     return;
659   surf_network_model_init_internal();
660   net_define_callbacks(filename);
661
662   xbt_dynar_push(model_list, &surf_network_model);
663   lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
664                                     func_vegas_fpi);
665   network_solve = lagrange_solve;
666
667   xbt_cfg_setdefault_double(_surf_cfg_set,"network/latency_factor", 10.4);
668   xbt_cfg_setdefault_double(_surf_cfg_set,"network/bandwidth_factor", 0.92);
669   xbt_cfg_setdefault_double(_surf_cfg_set,"network/weight_S", 8775);
670
671   update_model_description(surf_network_model_description,
672                            "Vegas", surf_network_model);
673 }