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 surf_model_private_t model_private;
303 s_surf_model_extension_cpu_t cpu;
304 s_surf_model_extension_network_t network;
305 s_surf_model_extension_workstation_t workstation;
309 surf_model_t surf_model_init(void);
310 void surf_model_exit(surf_model_t model);
312 static inline void *surf_cpu_resource_by_name(const char *name) {
313 return xbt_lib_get_or_null(host_lib, name, SURF_CPU_LEVEL);
315 static inline void *surf_workstation_resource_by_name(const char *name){
316 return xbt_lib_get_or_null(host_lib, name, SURF_WKS_LEVEL);
318 static inline void *surf_network_resource_by_name(const char *name){
319 return xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL);
322 typedef struct surf_resource {
325 xbt_dict_t properties;
326 } s_surf_resource_t, *surf_resource_t;
331 * Resource which have a metric handled by a maxmin system
336 tmgr_trace_event_t event;
339 typedef struct surf_resource_lmm {
340 s_surf_resource_t generic_resource;
341 lmm_constraint_t constraint;
342 e_surf_resource_state_t state_current;
343 tmgr_trace_event_t state_event;
344 s_surf_metric_t power;
345 } s_surf_resource_lmm_t, *surf_resource_lmm_t;
347 /**************************************/
348 /* Implementations of model object */
349 /**************************************/
352 /** \brief The CPU model
353 * \ingroup SURF_models
355 XBT_PUBLIC_DATA(surf_model_t) surf_cpu_model;
357 /** \brief Initializes the CPU model with the model Cas01
358 * \ingroup SURF_models
360 * This function is called by surf_workstation_model_init_CLM03
361 * so you shouldn't have to call it by yourself.
363 * \see surf_workstation_model_init_CLM03()
365 XBT_PUBLIC(void) surf_cpu_model_init_Cas01(const char *filename);
367 /** \brief Initializes the CPU model with trace integration
368 * \ingroup SURF_models
371 XBT_PUBLIC(void) surf_cpu_model_init_ti(const char *filename);
373 /** \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.
374 * \ingroup SURF_models
376 * This function is called by surf_workstation_model_init_CLM03
377 * so you shouldn't have to call it by yourself.
379 * \see surf_workstation_model_init_CLM03()
381 XBT_PUBLIC(void) surf_cpu_model_init_Cas01_im(const char *filename);
383 /** \brief The list of all available cpu model models
384 * \ingroup SURF_models
386 XBT_PUBLIC_DATA(s_surf_model_description_t) surf_cpu_model_description[];
388 XBT_PUBLIC(void) create_workstations(void);
390 /**\brief create new host bypass the parser
395 /** \brief The network model
396 * \ingroup SURF_models
398 * When creating a new API on top on SURF, you shouldn't use the
399 * network model unless you know what you are doing. Only the workstation
400 * model should be accessed because depending on the platform model,
401 * the network model can be NULL.
403 XBT_PUBLIC_DATA(surf_model_t) surf_network_model;
405 /** \brief Same as network model 'LagrangeVelho', only with different correction factors.
406 * \ingroup SURF_models
407 * \param filename XML platform file name
409 * This model is proposed by Pierre-Nicolas Clauss and Martin Quinson and Stéphane Génaud
410 * based on the model 'LV08' and different correction factors depending on the communication
411 * size (< 1KiB, < 64KiB, >= 64KiB).
413 * \see surf_workstation_model_init_SMPI()
415 XBT_PUBLIC(void) surf_network_model_init_SMPI(const char *filename);
417 /** \brief Initializes the platform with the network model 'LagrangeVelho'
418 * \ingroup SURF_models
419 * \param filename XML platform file name
421 * This model is proposed by Arnaud Legrand and Pedro Velho based on
422 * the results obtained with the GTNets simulator for onelink and
423 * dogbone sharing scenarios.
425 * \see surf_workstation_model_init_LegrandVelho()
427 XBT_PUBLIC(void) surf_network_model_init_LegrandVelho(const char
431 /** \brief Initializes the platform with the network model 'LV08_im'
432 * \ingroup SURF_models
433 * \param filename XML platform file name
435 * This model is adds the lazy management improvement to Legrand and
436 * Velho model. This improvement essentially replaces the list of actions
437 * inside the simulation kernel by a heap in order to reduce the complexity
438 * at each iteration of the simulation kernel.
440 * \see surf_workstation_model_init_LegrandVelho()
442 XBT_PUBLIC(void) im_surf_network_model_init_LegrandVelho(const char
445 /** \brief Initializes the platform with the network model 'Constant'
446 * \ingroup SURF_models
447 * \param filename XML platform file name
449 * In this model, the communication time between two network cards is
450 * constant, hence no need for a routing table. This is particularly
451 * usefull when simulating huge distributed algorithms where
452 * scalability is really an issue. This function is called in
453 * conjunction with surf_workstation_model_init_compound.
455 * \see surf_workstation_model_init_compound()
457 XBT_PUBLIC(void) surf_network_model_init_Constant(const char *filename);
459 /** \brief Initializes the platform with the network model CM02
460 * \ingroup SURF_models
461 * \param filename XML platform file name
463 * This function is called by surf_workstation_model_init_CLM03
464 * or by yourself only if you plan using surf_workstation_model_init_compound
466 * \see surf_workstation_model_init_CLM03()
468 XBT_PUBLIC(void) surf_network_model_init_CM02(const char *filename);
471 * brief initialize the the network model bypassing the XML parser
473 XBT_PUBLIC(void) surf_network_model_init_bypass(const char *id,
478 /** \brief Initializes the platform with the network model GTNETS
479 * \ingroup SURF_models
480 * \param filename XML platform file name
482 * This function is called by surf_workstation_model_init_GTNETS
483 * or by yourself only if you plan using surf_workstation_model_init_compound
485 * \see surf_workstation_model_init_GTNETS()
487 XBT_PUBLIC(void) surf_network_model_init_GTNETS(const char *filename);
490 /** \brief Initializes the platform with the network model Reno
491 * \ingroup SURF_models
492 * \param filename XML platform file name
494 * The problem is related to max( sum( arctan(C * Df * xi) ) ).
497 * [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
498 * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
500 * Call this function only if you plan using surf_workstation_model_init_compound.
503 XBT_PUBLIC(void) surf_network_model_init_Reno(const char *filename);
505 /** \brief Initializes the platform with the network model Reno2
506 * \ingroup SURF_models
507 * \param filename XML platform file name
509 * The problem is related to max( sum( arctan(C * Df * xi) ) ).
512 * [LOW01] S. H. Low. A duality model of TCP and queue management algorithms.
513 * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
515 * Call this function only if you plan using surf_workstation_model_init_compound.
518 XBT_PUBLIC(void) surf_network_model_init_Reno2(const char *filename);
520 /** \brief Initializes the platform with the network model Vegas
521 * \ingroup SURF_models
522 * \param filename XML platform file name
524 * This problem is related to max( sum( a * Df * ln(xi) ) ) which is equivalent
525 * to the proportional fairness.
528 * [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
529 * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
531 * Call this function only if you plan using surf_workstation_model_init_compound.
534 XBT_PUBLIC(void) surf_network_model_init_Vegas(const char *filename);
536 /** \brief The list of all available network model models
537 * \ingroup SURF_models
539 XBT_PUBLIC_DATA(s_surf_model_description_t)
540 surf_network_model_description[];
543 /** \brief The workstation model
544 * \ingroup SURF_models
546 * Note that when you create an API on top of SURF,
547 * the workstation model should be the only one you use
548 * because depending on the platform model, the network model and the CPU model
551 XBT_PUBLIC_DATA(surf_model_t) surf_workstation_model;
553 /** \brief Initializes the platform with a compound workstation model
554 * \ingroup SURF_models
555 * \param filename XML platform file name
557 * This function should be called after a cpu_model and a
558 * network_model have been set up.
561 XBT_PUBLIC(void) surf_workstation_model_init_compound(const char
564 /** \brief Initializes the platform with the workstation model CLM03
565 * \ingroup SURF_models
566 * \param filename XML platform file name
568 * This platform model seperates the workstation model and the network model.
569 * The workstation model will be initialized with the model CLM03, the network
570 * model with the model CM02 and the CPU model with the model Cas01.
571 * In future releases, some other network models will be implemented and will be
572 * combined with the workstation model CLM03.
574 * \see surf_workstation_model_init_KCCFLN05()
576 XBT_PUBLIC(void) surf_workstation_model_init_CLM03(const char *filename);
578 /** \brief Initializes the platform with the model KCCFLN05
579 * \ingroup SURF_models
580 * \param filename XML platform file name
582 * With this model, the workstations and the network are handled
583 * together. The network model is roughly the same as in CM02 but
584 * interference between computations and communications can be taken
585 * into account. This platform model is the default one for MSG and
589 XBT_PUBLIC(void) surf_workstation_model_init_KCCFLN05(const char
592 /** \brief Initializes the platform with the model KCCFLN05
593 * \ingroup SURF_models
594 * \param filename XML platform file name
596 * With this model, only parallel tasks can be used. Resource sharing
597 * is done by identifying bottlenecks and giving an equal share of
598 * the model to each action.
601 XBT_PUBLIC(void) surf_workstation_model_init_ptask_L07(const char
604 /** \brief The list of all available workstation model models
605 * \ingroup SURF_models
607 XBT_PUBLIC_DATA(s_surf_model_description_t)
608 surf_workstation_model_description[];
610 /** \brief List of initialized models
611 * \ingroup SURF_models
613 XBT_PUBLIC_DATA(xbt_dynar_t) model_list;
615 /*******************************************/
616 /*** SURF Globals **************************/
617 /*******************************************/
618 XBT_PUBLIC_DATA(xbt_cfg_t) _surf_cfg_set;
620 /** \brief Initialize SURF
621 * \ingroup SURF_simulation
622 * \param argc argument number
623 * \param argv arguments
625 * This function has to be called to initialize the common
626 * structures. Then you will have to create the environment by
628 * e.g. surf_workstation_model_init_CLM03() or
629 * surf_workstation_model_init_KCCFLN05().
631 * \see surf_workstation_model_init_CLM03(),
632 * surf_workstation_model_init_KCCFLN05(), surf_workstation_model_init_compound(), surf_exit()
634 XBT_PUBLIC(void) surf_init(int *argc, char **argv); /* initialize common structures */
636 /** \brief Initialize the used models.
638 * Must be called after the surf_init so that configuration infrastructure is created
639 * Must be called before parsing/creating the environment
640 * Must not be called within the initialization process so that the use get a chance to change the settings from
641 * its code between, say, MSG_init and MSG_create_environment using MSG_config
643 XBT_PUBLIC(void) surf_config_models_setup(const char *platform_file);
645 /** \brief create the elements of the models
647 * Must be called after parsing the platform file and before using any elements
649 XBT_PUBLIC(void) surf_config_models_create_elms(void);
651 /** \brief Finish simulation initialization
652 * \ingroup SURF_simulation
654 * This function must be called before the first call to surf_solve()
656 XBT_PUBLIC(void) surf_presolve(void);
658 /** \brief Performs a part of the simulation
659 * \ingroup SURF_simulation
660 * \param max_date Maximum date to update the simulation to, or -1
661 * \return the elapsed time, or -1.0 if no event could be executed
663 * This function execute all possible events, update the action states
664 * and returns the time elapsed.
665 * When you call execute or communicate on a model, the corresponding actions
666 * are not executed immediately but only when you call surf_solve.
667 * Note that the returned elapsed time can be zero.
669 XBT_PUBLIC(double) surf_solve(double max_date);
671 /** \brief Return the current time
672 * \ingroup SURF_simulation
674 * Return the current time in millisecond.
676 XBT_INLINE XBT_PUBLIC(double) surf_get_clock(void);
679 * \ingroup SURF_simulation
685 XBT_PUBLIC(void) surf_exit(void);
687 /* Prototypes of the functions that handle the properties */
688 XBT_PUBLIC_DATA(xbt_dict_t) current_property_set; /* the prop set for the currently parsed element (also used in SIMIX) */
689 XBT_PUBLIC_DATA(void) parse_properties(void);
691 /* surf parse file related (public because called from a test suite) */
692 XBT_PUBLIC(void) parse_platform_file(const char *file);
694 /* Stores the sets */
695 XBT_PUBLIC_DATA(xbt_dict_t) set_list;
697 /* For the trace and trace:connect tag (store their content till the end of the parsing) */
698 XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
699 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_host_avail;
700 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_power;
701 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_link_avail;
702 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_bandwidth;
703 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_latency;
706 XBT_PUBLIC(double) get_cpu_power(const char *power);
708 /*public interface to create resource bypassing the parser via cpu/network model
710 * see surfxml_parse.c
712 XBT_PUBLIC(void) surf_host_create_resource(char *name, double power_peak,
714 tmgr_trace_t power_trace,
716 e_surf_resource_state_t
718 tmgr_trace_t state_trace,
719 xbt_dict_t cpu_properties);
721 /*public interface to create resource bypassing the parser via workstation_ptask_L07 model
723 * see surfxml_parse.c
725 XBT_PUBLIC(void) surf_wsL07_host_create_resource(char *name,
728 tmgr_trace_t power_trace,
729 e_surf_resource_state_t
731 tmgr_trace_t state_trace,
735 * create link resource
736 * see surfxml_parse.c
738 XBT_PUBLIC(void) surf_link_create_resource(char *name,
740 tmgr_trace_t bw_trace,
742 tmgr_trace_t lat_trace,
743 e_surf_resource_state_t
745 tmgr_trace_t state_trace,
746 e_surf_link_sharing_policy_t
747 policy, xbt_dict_t properties);
750 XBT_PUBLIC(void) surf_wsL07_link_create_resource(char *name,
752 tmgr_trace_t bw_trace,
754 tmgr_trace_t lat_trace,
755 e_surf_resource_state_t
757 tmgr_trace_t state_trace,
758 e_surf_link_sharing_policy_t
760 xbt_dict_t properties);
762 * add route element (link_ctn) bypassing the parser
764 * see surfxml_parse.c
767 XBT_PUBLIC(void) surf_add_route_element(char *link_ctn_id);
770 * set route src_id,dest_id, and create a route resource
772 * see surf_routing.c && surfxml_parse.c
775 XBT_PUBLIC(void) surf_set_routes(void);
780 * see surfxml_parse.c
782 XBT_PUBLIC(void) surf_add_host_traces(void);
783 XBT_PUBLIC(void) surf_add_link_traces(void);
784 XBT_PUBLIC(void) surf_wsL07_add_traces(void);
787 * init AS from lua console
790 XBT_PUBLIC(void) routing_AS_init(const char *id, const char *mode);
791 XBT_PUBLIC(void) routing_AS_end(const char *id);
792 // add host to network element list
793 XBT_PUBLIC(void) routing_add_host(const char *host_id);
794 //Set a new link on the actual list of link for a route or ASroute
795 XBT_PUBLIC(void) routing_add_link(const char *link_id);
796 //Set the endpoints for a route
797 XBT_PUBLIC(void) routing_set_route(const char *src_id, const char *dst_id);
799 XBT_PUBLIC(void) routing_store_route(void);
802 * interface between surf and lua bindings
803 * see surfxml_parse.c
805 XBT_PUBLIC(void) surf_AS_new(const char *id, const char *mode);
806 XBT_PUBLIC(void) surf_AS_finalize(const char *id);
807 XBT_PUBLIC(void) surf_route_add_host(const char *id);
808 XBT_PUBLIC(void) surf_routing_add_route(const char *src_id,
810 xbt_dynar_t links_id);
812 #include "surf/surf_resource.h"
813 #include "surf/surf_resource_lmm.h"
816 #endif /* _SURF_SURF_H */