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. */
11 #include "xbt/dynar.h"
15 #include "xbt/config.h"
16 #include "surf/datatypes.h"
20 int ROUTING_HOST_LEVEL; //Routing level
21 int SURF_CPU_LEVEL; //Surf cpu level
22 int SURF_WKS_LEVEL; //Surf workstation level
23 int SIMIX_HOST_LEVEL; //Simix level
24 int MSG_HOST_LEVEL; //Msg level
25 int SD_HOST_LEVEL; //Simdag level
26 int COORD_HOST_LEVEL; //Coordinates level
29 int SD_LINK_LEVEL; //Simdag level
30 int SURF_LINK_LEVEL; //Surf level
32 xbt_lib_t as_router_lib;
33 int ROUTING_ASR_LEVEL; //Routing level
34 int COORD_ASR_LEVEL; //Coordinates level
37 /* Actions and models are highly connected structures... */
39 SURF_RESOURCE_ON = 1, /**< Up & ready */
40 SURF_RESOURCE_OFF = 0 /**< Down & broken */
41 } e_surf_resource_state_t;
44 SURF_LINK_FULLDUPLEX = 2,
47 } e_surf_link_sharing_policy_t;
49 /** @Brief Specify that we use that action */
50 XBT_PUBLIC(void) surf_action_ref(surf_action_t action);
51 /** @brief Creates a new action.
53 * @param size The size is the one of the subtype you want to create
54 * @param cost initial value
55 * @param model to which model we should attach this action
56 * @param failed whether we should start this action in failed mode
58 XBT_PUBLIC(void *) surf_action_new(size_t size, double cost,
59 surf_model_t model, int failed);
61 /** \brief Resource model description
63 typedef struct surf_model_description {
65 const char *description;
67 void (*model_init_preparse) (const char *filename);
68 void (*model_init_postparse) (void);
69 } s_surf_model_description_t, *surf_model_description_t;
71 XBT_PUBLIC(void) update_model_description(s_surf_model_description_t *
72 table, const char *name,
74 XBT_PUBLIC(int) find_model_description(s_surf_model_description_t * table,
76 XBT_PUBLIC(void) model_help(const char *category,
77 s_surf_model_description_t * table);
79 /** \brief Action structure
80 * \ingroup SURF_actions
82 * Never create s_surf_action_t by yourself ! The actions are created
83 * on the fly when you call execute or communicate on a model.
85 * \see e_surf_action_state_t
87 typedef struct surf_action {
88 s_xbt_swag_hookup_t state_hookup;
90 double cost; /**< cost */
91 double priority; /**< priority (1.0 by default) */
92 double max_duration; /**< max_duration (may fluctuate until
93 the task is completed) */
94 double remains; /**< How much of that cost remains to
95 * be done in the currently running task */
96 #ifdef HAVE_LATENCY_BOUND_TRACKING
97 int latency_limited; /**< Set to 1 if is limited by latency, 0 otherwise */
100 double start; /**< start time */
101 double finish; /**< finish time : this is modified during the run
102 * and fluctuates until the task is completed */
103 void *data; /**< for your convenience */
105 surf_model_t model_type;
107 char *category; /**< tracing category for categorized resource utilization monitoring */
111 typedef struct surf_action_lmm {
112 s_surf_action_t generic_action;
113 lmm_variable_t variable;
115 } s_surf_action_lmm_t, *surf_action_lmm_t;
117 /** \brief Action states
118 * \ingroup SURF_actions
122 * \see surf_action_t, surf_action_state_t
125 SURF_ACTION_READY = 0, /**< Ready */
126 SURF_ACTION_RUNNING, /**< Running */
127 SURF_ACTION_FAILED, /**< Task Failure */
128 SURF_ACTION_DONE, /**< Completed */
129 SURF_ACTION_TO_FREE, /**< Action to free in next cleanup */
130 SURF_ACTION_NOT_IN_THE_SYSTEM
131 /**< Not in the system anymore. Why did you ask ? */
132 } e_surf_action_state_t;
134 /** \brief Action state sets
135 * \ingroup SURF_actions
137 * This structure contains some sets of actions.
138 * It provides a fast access to the actions in each state.
140 * \see surf_action_t, e_surf_action_state_t
142 typedef struct surf_action_state {
143 xbt_swag_t ready_action_set;
144 /**< Actions in state SURF_ACTION_READY */
145 xbt_swag_t running_action_set;
146 /**< Actions in state SURF_ACTION_RUNNING */
147 xbt_swag_t failed_action_set;
148 /**< Actions in state SURF_ACTION_FAILED */
149 xbt_swag_t done_action_set;
150 /**< Actions in state SURF_ACTION_DONE */
151 } s_surf_action_state_t, *surf_action_state_t;
153 /***************************/
154 /* Generic model object */
155 /***************************/
156 typedef struct s_routing_global s_routing_global_t, *routing_global_t;
157 XBT_PUBLIC_DATA(routing_global_t) global_routing;
160 /** \brief Private data available on all models
161 * \ingroup SURF_models
163 typedef struct surf_model_private *surf_model_private_t;
167 /** \brief CPU model extension public
168 * \ingroup SURF_models
170 * Public functions specific to the CPU model.
172 typedef struct surf_cpu_model_extension_public {
173 surf_action_t(*execute) (void *cpu, double size);
174 surf_action_t(*sleep) (void *cpu, double duration);
175 e_surf_resource_state_t(*get_state) (void *cpu);
176 double (*get_speed) (void *cpu, double load);
177 double (*get_available_speed) (void *cpu);
178 void (*create_resource) (char *name, double power_peak,
180 tmgr_trace_t power_trace,
182 e_surf_resource_state_t state_initial,
183 tmgr_trace_t state_trace,
184 xbt_dict_t cpu_properties);
185 void (*add_traces) (void);
186 } s_surf_model_extension_cpu_t;
190 /** \brief Network model extension public
191 * \ingroup SURF_models
193 * Public functions specific to the network model
195 typedef struct surf_network_model_extension_public {
196 surf_action_t(*communicate) (const char *src_name,
197 const char *dst_name,
198 double size, double rate);
199 xbt_dynar_t(*get_route) (const char *src_name, const char *dst_name);
200 double (*get_link_bandwidth) (const void *link);
201 double (*get_link_latency) (const void *link);
202 int (*link_shared) (const void *link);
203 void (*add_traces) (void);
204 void (*create_resource) (char *name,
206 tmgr_trace_t bw_trace,
208 tmgr_trace_t lat_trace,
209 e_surf_resource_state_t
211 tmgr_trace_t state_trace,
212 e_surf_link_sharing_policy_t policy,
213 xbt_dict_t properties);
214 } s_surf_model_extension_network_t;
216 /** \brief Workstation model extension public
217 * \ingroup SURF_models
219 * Public functions specific to the workstation model.
221 typedef struct surf_workstation_model_extension_public {
222 surf_action_t(*execute) (void *workstation, double size); /**< Execute a computation amount on a workstation
223 and create the corresponding action */
224 surf_action_t(*sleep) (void *workstation, double duration); /**< Make a workstation sleep during a given duration */
225 e_surf_resource_state_t(*get_state) (void *workstation); /**< Return the CPU state of a workstation */
226 double (*get_speed) (void *workstation, double load); /**< Return the speed of a workstation */
227 double (*get_available_speed) (void *workstation); /**< Return tha available speed of a workstation */
228 surf_action_t(*communicate) (void *workstation_src, /**< Execute a communication amount between two workstations */
229 void *workstation_dst, double size,
231 xbt_dynar_t(*get_route) (void *workstation_src, void *workstation_dst); /**< Get the list of links between two ws */
233 surf_action_t(*execute_parallel_task) (int workstation_nb, /**< Execute a parallel task on several workstations */
234 void **workstation_list,
235 double *computation_amount,
236 double *communication_amount,
237 double amount, double rate);
238 double (*get_link_bandwidth) (const void *link); /**< Return the current bandwidth of a network link */
239 double (*get_link_latency) (const void *link); /**< Return the current latency of a network link */
240 int (*link_shared) (const void *link);
241 xbt_dict_t(*get_properties) (const void *resource);
242 void (*link_create_resource) (char *name,
244 tmgr_trace_t bw_trace,
246 tmgr_trace_t lat_trace,
247 e_surf_resource_state_t
249 tmgr_trace_t state_trace,
250 e_surf_link_sharing_policy_t
251 policy, xbt_dict_t properties);
252 void (*cpu_create_resource) (char *name, double power_peak,
254 tmgr_trace_t power_trace,
255 e_surf_resource_state_t state_initial,
256 tmgr_trace_t state_trace,
257 xbt_dict_t cpu_properties);
258 void (*add_traces) (void);
260 } s_surf_model_extension_workstation_t;
265 /** \brief Model datatype
266 * \ingroup SURF_models
268 * Generic data structure for a model. The workstations,
269 * the CPUs and the network links are examples of models.
271 typedef struct surf_model {
272 const char *name; /**< Name of this model */
273 s_surf_action_state_t states; /**< Any living action on this model */
275 e_surf_action_state_t(*action_state_get) (surf_action_t action);
276 /**< Return the state of an action */
277 void (*action_state_set) (surf_action_t action,
278 e_surf_action_state_t state);
279 /**< Change an action state*/
281 double (*action_get_start_time) (surf_action_t action); /**< Return the start time of an action */
282 double (*action_get_finish_time) (surf_action_t action); /**< Return the finish time of an action */
283 int (*action_unref) (surf_action_t action); /**< Specify that we don't use that action anymore */
284 void (*action_cancel) (surf_action_t action); /**< Cancel a running action */
285 void (*action_recycle) (surf_action_t action); /**< Recycle an action */
286 void (*action_data_set) (surf_action_t action, void *data); /**< Set the user data of an action */
287 void (*suspend) (surf_action_t action); /**< Suspend an action */
288 void (*resume) (surf_action_t action); /**< Resume a suspended action */
289 int (*is_suspended) (surf_action_t action); /**< Return whether an action is suspended */
290 void (*set_max_duration) (surf_action_t action, double duration); /**< Set the max duration of an action*/
291 void (*set_priority) (surf_action_t action, double priority); /**< Set the priority of an action */
293 void (*set_category) (surf_action_t action, const char *category); /**< Set the category of an action */
295 double (*get_remains) (surf_action_t action); /**< Get the remains of an action */
296 #ifdef HAVE_LATENCY_BOUND_TRACKING
297 int (*get_latency_limited) (surf_action_t action); /**< Return 1 if action is limited by latency, 0 otherwise */
300 xbt_dict_t resource_set;
303 surf_model_private_t model_private;
307 s_surf_model_extension_cpu_t cpu;
308 s_surf_model_extension_network_t network;
309 s_surf_model_extension_workstation_t workstation;
313 surf_model_t surf_model_init(void);
314 void surf_model_exit(surf_model_t model);
316 void *surf_model_resource_by_name(surf_model_t model, const char *name);
317 #define surf_model_resource_set(model) (model)->resource_set
319 typedef struct surf_resource {
322 xbt_dict_t properties;
323 } s_surf_resource_t, *surf_resource_t;
328 * Resource which have a metric handled by a maxmin system
333 tmgr_trace_event_t event;
336 typedef struct surf_resource_lmm {
337 s_surf_resource_t generic_resource;
338 lmm_constraint_t constraint;
339 e_surf_resource_state_t state_current;
340 tmgr_trace_event_t state_event;
341 s_surf_metric_t power;
342 } s_surf_resource_lmm_t, *surf_resource_lmm_t;
344 /**************************************/
345 /* Implementations of model object */
346 /**************************************/
349 /** \brief The CPU model
350 * \ingroup SURF_models
352 XBT_PUBLIC_DATA(surf_model_t) surf_cpu_model;
354 /** \brief Initializes the CPU model with the model Cas01
355 * \ingroup SURF_models
357 * This function is called by surf_workstation_model_init_CLM03
358 * so you shouldn't have to call it by yourself.
360 * \see surf_workstation_model_init_CLM03()
362 XBT_PUBLIC(void) surf_cpu_model_init_Cas01(const char *filename);
364 /** \brief Initializes the CPU model with trace integration
365 * \ingroup SURF_models
368 XBT_PUBLIC(void) surf_cpu_model_init_ti(const char *filename);
370 /** \brief Initializes the CPU model with the model Cas01 Improved. This model uses a heap to order the events, decreasing the time complexity to get the minimum next event.
371 * \ingroup SURF_models
373 * This function is called by surf_workstation_model_init_CLM03
374 * so you shouldn't have to call it by yourself.
376 * \see surf_workstation_model_init_CLM03()
378 XBT_PUBLIC(void) surf_cpu_model_init_Cas01_im(const char *filename);
380 /** \brief The list of all available cpu model models
381 * \ingroup SURF_models
383 XBT_PUBLIC_DATA(s_surf_model_description_t) surf_cpu_model_description[];
385 XBT_PUBLIC(void) create_workstations(void);
387 /**\brief create new host bypass the parser
392 /** \brief The network model
393 * \ingroup SURF_models
395 * When creating a new API on top on SURF, you shouldn't use the
396 * network model unless you know what you are doing. Only the workstation
397 * model should be accessed because depending on the platform model,
398 * the network model can be NULL.
400 XBT_PUBLIC_DATA(surf_model_t) surf_network_model;
402 /** \brief Same as network model 'LagrangeVelho', only with different correction factors.
403 * \ingroup SURF_models
404 * \param filename XML platform file name
406 * This model is proposed by Pierre-Nicolas Clauss and Martin Quinson and Stéphane Génaud
407 * based on the model 'LV08' and different correction factors depending on the communication
408 * size (< 1KiB, < 64KiB, >= 64KiB).
410 * \see surf_workstation_model_init_SMPI()
412 XBT_PUBLIC(void) surf_network_model_init_SMPI(const char *filename);
414 /** \brief Initializes the platform with the network model 'LagrangeVelho'
415 * \ingroup SURF_models
416 * \param filename XML platform file name
418 * This model is proposed by Arnaud Legrand and Pedro Velho based on
419 * the results obtained with the GTNets simulator for onelink and
420 * dogbone sharing scenarios.
422 * \see surf_workstation_model_init_LegrandVelho()
424 XBT_PUBLIC(void) surf_network_model_init_LegrandVelho(const char
428 /** \brief Initializes the platform with the network model 'LV08_im'
429 * \ingroup SURF_models
430 * \param filename XML platform file name
432 * This model is adds the lazy management improvement to Legrand and
433 * Velho model. This improvement essentially replaces the list of actions
434 * inside the simulation kernel by a heap in order to reduce the complexity
435 * at each iteration of the simulation kernel.
437 * \see surf_workstation_model_init_LegrandVelho()
439 XBT_PUBLIC(void) im_surf_network_model_init_LegrandVelho(const char
442 /** \brief Initializes the platform with the network model 'Constant'
443 * \ingroup SURF_models
444 * \param filename XML platform file name
446 * In this model, the communication time between two network cards is
447 * constant, hence no need for a routing table. This is particularly
448 * usefull when simulating huge distributed algorithms where
449 * scalability is really an issue. This function is called in
450 * conjunction with surf_workstation_model_init_compound.
452 * \see surf_workstation_model_init_compound()
454 XBT_PUBLIC(void) surf_network_model_init_Constant(const char *filename);
456 /** \brief Initializes the platform with the network model CM02
457 * \ingroup SURF_models
458 * \param filename XML platform file name
460 * This function is called by surf_workstation_model_init_CLM03
461 * or by yourself only if you plan using surf_workstation_model_init_compound
463 * \see surf_workstation_model_init_CLM03()
465 XBT_PUBLIC(void) surf_network_model_init_CM02(const char *filename);
468 * brief initialize the the network model bypassing the XML parser
470 XBT_PUBLIC(void) surf_network_model_init_bypass(const char *id,
475 /** \brief Initializes the platform with the network model GTNETS
476 * \ingroup SURF_models
477 * \param filename XML platform file name
479 * This function is called by surf_workstation_model_init_GTNETS
480 * or by yourself only if you plan using surf_workstation_model_init_compound
482 * \see surf_workstation_model_init_GTNETS()
484 XBT_PUBLIC(void) surf_network_model_init_GTNETS(const char *filename);
487 /** \brief Initializes the platform with the network model Reno
488 * \ingroup SURF_models
489 * \param filename XML platform file name
491 * The problem is related to max( sum( arctan(C * Df * xi) ) ).
494 * [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
495 * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
497 * Call this function only if you plan using surf_workstation_model_init_compound.
500 XBT_PUBLIC(void) surf_network_model_init_Reno(const char *filename);
502 /** \brief Initializes the platform with the network model Reno2
503 * \ingroup SURF_models
504 * \param filename XML platform file name
506 * The problem is related to max( sum( arctan(C * Df * xi) ) ).
509 * [LOW01] S. H. Low. A duality model of TCP and queue management algorithms.
510 * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
512 * Call this function only if you plan using surf_workstation_model_init_compound.
515 XBT_PUBLIC(void) surf_network_model_init_Reno2(const char *filename);
517 /** \brief Initializes the platform with the network model Vegas
518 * \ingroup SURF_models
519 * \param filename XML platform file name
521 * This problem is related to max( sum( a * Df * ln(xi) ) ) which is equivalent
522 * to the proportional fairness.
525 * [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
526 * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
528 * Call this function only if you plan using surf_workstation_model_init_compound.
531 XBT_PUBLIC(void) surf_network_model_init_Vegas(const char *filename);
533 /** \brief The list of all available network model models
534 * \ingroup SURF_models
536 XBT_PUBLIC_DATA(s_surf_model_description_t)
537 surf_network_model_description[];
540 /** \brief The workstation model
541 * \ingroup SURF_models
543 * Note that when you create an API on top of SURF,
544 * the workstation model should be the only one you use
545 * because depending on the platform model, the network model and the CPU model
548 XBT_PUBLIC_DATA(surf_model_t) surf_workstation_model;
550 /** \brief Initializes the platform with a compound workstation model
551 * \ingroup SURF_models
552 * \param filename XML platform file name
554 * This function should be called after a cpu_model and a
555 * network_model have been set up.
558 XBT_PUBLIC(void) surf_workstation_model_init_compound(const char
561 /** \brief Initializes the platform with the workstation model CLM03
562 * \ingroup SURF_models
563 * \param filename XML platform file name
565 * This platform model seperates the workstation model and the network model.
566 * The workstation model will be initialized with the model CLM03, the network
567 * model with the model CM02 and the CPU model with the model Cas01.
568 * In future releases, some other network models will be implemented and will be
569 * combined with the workstation model CLM03.
571 * \see surf_workstation_model_init_KCCFLN05()
573 XBT_PUBLIC(void) surf_workstation_model_init_CLM03(const char *filename);
575 /** \brief Initializes the platform with the model KCCFLN05
576 * \ingroup SURF_models
577 * \param filename XML platform file name
579 * With this model, the workstations and the network are handled
580 * together. The network model is roughly the same as in CM02 but
581 * interference between computations and communications can be taken
582 * into account. This platform model is the default one for MSG and
586 XBT_PUBLIC(void) surf_workstation_model_init_KCCFLN05(const char
589 /** \brief Initializes the platform with the model KCCFLN05
590 * \ingroup SURF_models
591 * \param filename XML platform file name
593 * With this model, only parallel tasks can be used. Resource sharing
594 * is done by identifying bottlenecks and giving an equal share of
595 * the model to each action.
598 XBT_PUBLIC(void) surf_workstation_model_init_ptask_L07(const char
601 /** \brief The list of all available workstation model models
602 * \ingroup SURF_models
604 XBT_PUBLIC_DATA(s_surf_model_description_t)
605 surf_workstation_model_description[];
607 /** \brief List of initialized models
608 * \ingroup SURF_models
610 XBT_PUBLIC_DATA(xbt_dynar_t) model_list;
612 /*******************************************/
613 /*** SURF Globals **************************/
614 /*******************************************/
615 XBT_PUBLIC_DATA(xbt_cfg_t) _surf_cfg_set;
617 /** \brief Initialize SURF
618 * \ingroup SURF_simulation
619 * \param argc argument number
620 * \param argv arguments
622 * This function has to be called to initialize the common
623 * structures. Then you will have to create the environment by
625 * e.g. surf_workstation_model_init_CLM03() or
626 * surf_workstation_model_init_KCCFLN05().
628 * \see surf_workstation_model_init_CLM03(),
629 * surf_workstation_model_init_KCCFLN05(), surf_workstation_model_init_compound(), surf_exit()
631 XBT_PUBLIC(void) surf_init(int *argc, char **argv); /* initialize common structures */
633 /** \brief Initialize the used models.
635 * Must be called after the surf_init so that configuration infrastructure is created
636 * Must be called before parsing/creating the environment
637 * Must not be called within the initialization process so that the use get a chance to change the settings from
638 * its code between, say, MSG_init and MSG_create_environment using MSG_config
640 XBT_PUBLIC(void) surf_config_models_setup(const char *platform_file);
642 /** \brief create the elements of the models
644 * Must be called after parsing the platform file and before using any elements
646 XBT_PUBLIC(void) surf_config_models_create_elms(void);
648 /** \brief Finish simulation initialization
649 * \ingroup SURF_simulation
651 * This function must be called before the first call to surf_solve()
653 XBT_PUBLIC(void) surf_presolve(void);
655 /** \brief Performs a part of the simulation
656 * \ingroup SURF_simulation
657 * \param max_date Maximum date to update the simulation to, or -1
658 * \return the elapsed time, or -1.0 if no event could be executed
660 * This function execute all possible events, update the action states
661 * and returns the time elapsed.
662 * When you call execute or communicate on a model, the corresponding actions
663 * are not executed immediately but only when you call surf_solve.
664 * Note that the returned elapsed time can be zero.
666 XBT_PUBLIC(double) surf_solve(double max_date);
668 /** \brief Return the current time
669 * \ingroup SURF_simulation
671 * Return the current time in millisecond.
673 XBT_INLINE XBT_PUBLIC(double) surf_get_clock(void);
676 * \ingroup SURF_simulation
682 XBT_PUBLIC(void) surf_exit(void);
684 /* Prototypes of the functions that handle the properties */
685 XBT_PUBLIC_DATA(xbt_dict_t) current_property_set; /* the prop set for the currently parsed element (also used in SIMIX) */
686 XBT_PUBLIC_DATA(void) parse_properties(void);
688 /* surf parse file related (public because called from a test suite) */
689 XBT_PUBLIC(void) parse_platform_file(const char *file);
691 /* Stores the sets */
692 XBT_PUBLIC_DATA(xbt_dict_t) set_list;
694 /* For the trace and trace:connect tag (store their content till the end of the parsing) */
695 XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
696 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_host_avail;
697 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_power;
698 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_link_avail;
699 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_bandwidth;
700 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_latency;
703 XBT_PUBLIC(double) get_cpu_power(const char *power);
705 /*public interface to create resource bypassing the parser via cpu/network model
707 * see surfxml_parse.c
709 XBT_PUBLIC(void) surf_host_create_resource(char *name, double power_peak,
711 tmgr_trace_t power_trace,
713 e_surf_resource_state_t
715 tmgr_trace_t state_trace,
716 xbt_dict_t cpu_properties);
718 /*public interface to create resource bypassing the parser via workstation_ptask_L07 model
720 * see surfxml_parse.c
722 XBT_PUBLIC(void) surf_wsL07_host_create_resource(char *name,
725 tmgr_trace_t power_trace,
726 e_surf_resource_state_t
728 tmgr_trace_t state_trace,
732 * create link resource
733 * see surfxml_parse.c
735 XBT_PUBLIC(void) surf_link_create_resource(char *name,
737 tmgr_trace_t bw_trace,
739 tmgr_trace_t lat_trace,
740 e_surf_resource_state_t
742 tmgr_trace_t state_trace,
743 e_surf_link_sharing_policy_t
744 policy, xbt_dict_t properties);
747 XBT_PUBLIC(void) surf_wsL07_link_create_resource(char *name,
749 tmgr_trace_t bw_trace,
751 tmgr_trace_t lat_trace,
752 e_surf_resource_state_t
754 tmgr_trace_t state_trace,
755 e_surf_link_sharing_policy_t
757 xbt_dict_t properties);
759 * add route element (link_ctn) bypassing the parser
761 * see surfxml_parse.c
764 XBT_PUBLIC(void) surf_add_route_element(char *link_ctn_id);
767 * set route src_id,dest_id, and create a route resource
769 * see surf_routing.c && surfxml_parse.c
772 XBT_PUBLIC(void) surf_set_routes(void);
777 * see surfxml_parse.c
779 XBT_PUBLIC(void) surf_add_host_traces(void);
780 XBT_PUBLIC(void) surf_add_link_traces(void);
781 XBT_PUBLIC(void) surf_wsL07_add_traces(void);
784 * init AS from lua console
787 XBT_PUBLIC(void) routing_AS_init(const char *id, const char *mode);
788 XBT_PUBLIC(void) routing_AS_end(const char *id);
789 // add host to network element list
790 XBT_PUBLIC(void) routing_add_host(const char *host_id);
791 //Set a new link on the actual list of link for a route or ASroute
792 XBT_PUBLIC(void) routing_add_link(const char *link_id);
793 //Set the endpoints for a route
794 XBT_PUBLIC(void) routing_set_route(const char *src_id, const char *dst_id);
796 XBT_PUBLIC(void) routing_store_route(void);
799 * interface between surf and lua bindings
800 * see surfxml_parse.c
802 XBT_PUBLIC(void) surf_AS_new(const char *id, const char *mode);
803 XBT_PUBLIC(void) surf_AS_finalize(const char *id);
804 XBT_PUBLIC(void) surf_route_add_host(const char *id);
805 XBT_PUBLIC(void) surf_routing_add_route(const char *src_id,
807 xbt_dynar_t links_id);
809 #include "surf/surf_resource.h"
810 #include "surf/surf_resource_lmm.h"
813 #endif /* _SURF_SURF_H */