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"
18 #include "surf/surf_routing.h"
19 #include "simgrid/platf_interface.h"
22 /* Actions and models are highly connected structures... */
25 SURF_NETWORK_ELEMENT_NULL = 0, /* NULL */
26 SURF_NETWORK_ELEMENT_HOST, /* host type */
27 SURF_NETWORK_ELEMENT_ROUTER, /* router type */
28 SURF_NETWORK_ELEMENT_AS, /* AS type */
29 } e_surf_network_element_type_t;
31 XBT_PUBLIC(e_surf_network_element_type_t) get_network_element_type(const char
34 /** @Brief Specify that we use that action */
35 XBT_PUBLIC(void) surf_action_ref(surf_action_t action);
36 /** @brief Creates a new action.
38 * @param size The size is the one of the subtype you want to create
39 * @param cost initial value
40 * @param model to which model we should attach this action
41 * @param failed whether we should start this action in failed mode
43 XBT_PUBLIC(void *) surf_action_new(size_t size, double cost,
44 surf_model_t model, int failed);
46 /** \brief Resource model description
48 typedef struct surf_model_description {
50 const char *description;
52 void (*model_init_preparse) (void);
53 void (*model_init_postparse) (void);
54 } s_surf_model_description_t, *surf_model_description_t;
56 XBT_PUBLIC(void) update_model_description(s_surf_model_description_t *
57 table, const char *name,
59 XBT_PUBLIC(int) find_model_description(s_surf_model_description_t * table,
61 XBT_PUBLIC(void) model_help(const char *category,
62 s_surf_model_description_t * table);
64 /** \brief Action structure
65 * \ingroup SURF_actions
67 * Never create s_surf_action_t by yourself ! The actions are created
68 * on the fly when you call execute or communicate on a model.
70 * \see e_surf_action_state_t
72 typedef struct surf_action {
73 s_xbt_swag_hookup_t state_hookup;
75 double cost; /**< cost */
76 double priority; /**< priority (1.0 by default) */
77 double max_duration; /**< max_duration (may fluctuate until
78 the task is completed) */
79 double remains; /**< How much of that cost remains to
80 * be done in the currently running task */
81 #ifdef HAVE_LATENCY_BOUND_TRACKING
82 int latency_limited; /**< Set to 1 if is limited by latency, 0 otherwise */
85 double start; /**< start time */
86 double finish; /**< finish time : this is modified during the run
87 * and fluctuates until the task is completed */
88 void *data; /**< for your convenience */
90 surf_model_t model_type;
92 char *category; /**< tracing category for categorized resource utilization monitoring */
96 typedef struct surf_action_lmm {
97 s_surf_action_t generic_action;
98 lmm_variable_t variable;
100 } s_surf_action_lmm_t, *surf_action_lmm_t;
102 /** \brief Action states
103 * \ingroup SURF_actions
107 * \see surf_action_t, surf_action_state_t
110 SURF_ACTION_READY = 0, /**< Ready */
111 SURF_ACTION_RUNNING, /**< Running */
112 SURF_ACTION_FAILED, /**< Task Failure */
113 SURF_ACTION_DONE, /**< Completed */
114 SURF_ACTION_TO_FREE, /**< Action to free in next cleanup */
115 SURF_ACTION_NOT_IN_THE_SYSTEM
116 /**< Not in the system anymore. Why did you ask ? */
117 } e_surf_action_state_t;
119 /** \brief Action state sets
120 * \ingroup SURF_actions
122 * This structure contains some sets of actions.
123 * It provides a fast access to the actions in each state.
125 * \see surf_action_t, e_surf_action_state_t
127 typedef struct surf_action_state {
128 xbt_swag_t ready_action_set;
129 /**< Actions in state SURF_ACTION_READY */
130 xbt_swag_t running_action_set;
131 /**< Actions in state SURF_ACTION_RUNNING */
132 xbt_swag_t failed_action_set;
133 /**< Actions in state SURF_ACTION_FAILED */
134 xbt_swag_t done_action_set;
135 /**< Actions in state SURF_ACTION_DONE */
136 } s_surf_action_state_t, *surf_action_state_t;
138 /***************************/
139 /* Generic model object */
140 /***************************/
141 typedef struct s_routing_global s_routing_global_t, *routing_global_t;
142 XBT_PUBLIC_DATA(routing_global_t) global_routing;
145 /** \brief Private data available on all models
146 * \ingroup SURF_models
148 typedef struct surf_model_private *surf_model_private_t;
152 /** \brief CPU model extension public
153 * \ingroup SURF_models
155 * Public functions specific to the CPU model.
157 typedef struct surf_cpu_model_extension_public {
158 surf_action_t(*execute) (void *cpu, double size);
159 surf_action_t(*sleep) (void *cpu, double duration);
160 e_surf_resource_state_t(*get_state) (void *cpu);
161 double (*get_speed) (void *cpu, double load);
162 double (*get_available_speed) (void *cpu);
163 void* (*create_resource) (const char *name, double power_peak,
165 tmgr_trace_t power_trace,
167 e_surf_resource_state_t state_initial,
168 tmgr_trace_t state_trace,
169 xbt_dict_t cpu_properties);
170 void (*add_traces) (void);
171 } s_surf_model_extension_cpu_t;
175 /** \brief Network model extension public
176 * \ingroup SURF_models
178 * Public functions specific to the network model
180 typedef struct surf_network_model_extension_public {
181 surf_action_t(*communicate) (const char *src_name,
182 const char *dst_name,
183 double size, double rate);
184 xbt_dynar_t(*get_route) (const char *src_name, const char *dst_name);
185 double (*get_link_bandwidth) (const void *link);
186 double (*get_link_latency) (const void *link);
187 int (*link_shared) (const void *link);
188 void (*add_traces) (void);
189 void* (*create_resource) (const char *name,
191 tmgr_trace_t bw_trace,
193 tmgr_trace_t lat_trace,
194 e_surf_resource_state_t
196 tmgr_trace_t state_trace,
197 e_surf_link_sharing_policy_t policy,
198 xbt_dict_t properties);
199 } s_surf_model_extension_network_t;
201 /** \brief Workstation model extension public
202 * \ingroup SURF_models
204 * Public functions specific to the workstation model.
206 typedef struct surf_workstation_model_extension_public {
207 surf_action_t(*execute) (void *workstation, double size); /**< Execute a computation amount on a workstation
208 and create the corresponding action */
209 surf_action_t(*sleep) (void *workstation, double duration); /**< Make a workstation sleep during a given duration */
210 e_surf_resource_state_t(*get_state) (void *workstation); /**< Return the CPU state of a workstation */
211 double (*get_speed) (void *workstation, double load); /**< Return the speed of a workstation */
212 double (*get_available_speed) (void *workstation); /**< Return tha available speed of a workstation */
213 surf_action_t(*communicate) (void *workstation_src, /**< Execute a communication amount between two workstations */
214 void *workstation_dst, double size,
216 xbt_dynar_t(*get_route) (void *workstation_src, void *workstation_dst); /**< Get the list of links between two ws */
218 surf_action_t(*execute_parallel_task) (int workstation_nb, /**< Execute a parallel task on several workstations */
219 void **workstation_list,
220 double *computation_amount,
221 double *communication_amount,
222 double amount, double rate);
223 double (*get_link_bandwidth) (const void *link); /**< Return the current bandwidth of a network link */
224 double (*get_link_latency) (const void *link); /**< Return the current latency of a network link */
225 int (*link_shared) (const void *link);
226 xbt_dict_t(*get_properties) (const void *resource);
227 void* (*link_create_resource) (const char *name,
229 tmgr_trace_t bw_trace,
231 tmgr_trace_t lat_trace,
232 e_surf_resource_state_t
234 tmgr_trace_t state_trace,
235 e_surf_link_sharing_policy_t
236 policy, xbt_dict_t properties);
237 void* (*cpu_create_resource) (const char *name, double power_peak,
239 tmgr_trace_t power_trace,
240 e_surf_resource_state_t state_initial,
241 tmgr_trace_t state_trace,
242 xbt_dict_t cpu_properties);
243 void (*add_traces) (void);
245 } s_surf_model_extension_workstation_t;
250 /** \brief Model datatype
251 * \ingroup SURF_models
253 * Generic data structure for a model. The workstations,
254 * the CPUs and the network links are examples of models.
256 typedef struct surf_model {
257 const char *name; /**< Name of this model */
258 s_surf_action_state_t states; /**< Any living action on this model */
260 e_surf_action_state_t(*action_state_get) (surf_action_t action);
261 /**< Return the state of an action */
262 void (*action_state_set) (surf_action_t action,
263 e_surf_action_state_t state);
264 /**< Change an action state*/
266 double (*action_get_start_time) (surf_action_t action); /**< Return the start time of an action */
267 double (*action_get_finish_time) (surf_action_t action); /**< Return the finish time of an action */
268 int (*action_unref) (surf_action_t action); /**< Specify that we don't use that action anymore */
269 void (*action_cancel) (surf_action_t action); /**< Cancel a running action */
270 void (*action_recycle) (surf_action_t action); /**< Recycle an action */
271 void (*action_data_set) (surf_action_t action, void *data); /**< Set the user data of an action */
272 void (*suspend) (surf_action_t action); /**< Suspend an action */
273 void (*resume) (surf_action_t action); /**< Resume a suspended action */
274 int (*is_suspended) (surf_action_t action); /**< Return whether an action is suspended */
275 void (*set_max_duration) (surf_action_t action, double duration); /**< Set the max duration of an action*/
276 void (*set_priority) (surf_action_t action, double priority); /**< Set the priority of an action */
278 void (*set_category) (surf_action_t action, const char *category); /**< Set the category of an action */
280 double (*get_remains) (surf_action_t action); /**< Get the remains of an action */
281 #ifdef HAVE_LATENCY_BOUND_TRACKING
282 int (*get_latency_limited) (surf_action_t action); /**< Return 1 if action is limited by latency, 0 otherwise */
285 surf_model_private_t model_private;
288 s_surf_model_extension_cpu_t cpu;
289 s_surf_model_extension_network_t network;
290 s_surf_model_extension_workstation_t workstation;
294 surf_model_t surf_model_init(void);
295 void surf_model_exit(surf_model_t model);
297 static inline void *surf_cpu_resource_by_name(const char *name) {
298 return xbt_lib_get_or_null(host_lib, name, SURF_CPU_LEVEL);
300 static inline void *surf_workstation_resource_by_name(const char *name){
301 return xbt_lib_get_or_null(host_lib, name, SURF_WKS_LEVEL);
303 static inline void *surf_network_resource_by_name(const char *name){
304 return xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL);
307 typedef struct surf_resource {
310 xbt_dict_t properties;
311 } s_surf_resource_t, *surf_resource_t;
316 * Resource which have a metric handled by a maxmin system
321 tmgr_trace_event_t event;
324 typedef struct surf_resource_lmm {
325 s_surf_resource_t generic_resource;
326 lmm_constraint_t constraint;
327 e_surf_resource_state_t state_current;
328 tmgr_trace_event_t state_event;
329 s_surf_metric_t power;
330 } s_surf_resource_lmm_t, *surf_resource_lmm_t;
332 /**************************************/
333 /* Implementations of model object */
334 /**************************************/
337 /** \brief The CPU model
338 * \ingroup SURF_models
340 XBT_PUBLIC_DATA(surf_model_t) surf_cpu_model;
342 /** \brief Initializes the CPU model with the model Cas01
343 * \ingroup SURF_models
345 * This function is called by surf_workstation_model_init_CLM03
346 * so you shouldn't have to call it by yourself.
348 * \see surf_workstation_model_init_CLM03()
350 XBT_PUBLIC(void) surf_cpu_model_init_Cas01(void);
352 /** \brief Initializes the CPU model with trace integration
353 * \ingroup SURF_models
356 XBT_PUBLIC(void) surf_cpu_model_init_ti(void);
358 /** \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.
359 * \ingroup SURF_models
361 * This function is called by surf_workstation_model_init_CLM03
362 * so you shouldn't have to call it by yourself.
364 * \see surf_workstation_model_init_CLM03()
366 XBT_PUBLIC(void) surf_cpu_model_init_Cas01_im(void);
368 /** \brief The list of all available cpu model models
369 * \ingroup SURF_models
371 XBT_PUBLIC_DATA(s_surf_model_description_t) surf_cpu_model_description[];
373 XBT_PUBLIC(void) create_workstations(void);
375 /**\brief create new host bypass the parser
380 /** \brief The network model
381 * \ingroup SURF_models
383 * When creating a new API on top on SURF, you shouldn't use the
384 * network model unless you know what you are doing. Only the workstation
385 * model should be accessed because depending on the platform model,
386 * the network model can be NULL.
388 XBT_PUBLIC_DATA(surf_model_t) surf_network_model;
390 /** \brief Same as network model 'LagrangeVelho', only with different correction factors.
391 * \ingroup SURF_models
392 * \param filename XML platform file name
394 * This model is proposed by Pierre-Nicolas Clauss and Martin Quinson and Stéphane Génaud
395 * based on the model 'LV08' and different correction factors depending on the communication
396 * size (< 1KiB, < 64KiB, >= 64KiB).
398 * \see surf_workstation_model_init_SMPI()
400 XBT_PUBLIC(void) surf_network_model_init_SMPI(void);
402 /** \brief Initializes the platform with the network model 'LagrangeVelho'
403 * \ingroup SURF_models
404 * \param filename XML platform file name
406 * This model is proposed by Arnaud Legrand and Pedro Velho based on
407 * the results obtained with the GTNets simulator for onelink and
408 * dogbone sharing scenarios.
410 * \see surf_workstation_model_init_LegrandVelho()
412 XBT_PUBLIC(void) surf_network_model_init_LegrandVelho(void);
415 /** \brief Initializes the platform with the network model 'LV08_im'
416 * \ingroup SURF_models
417 * \param filename XML platform file name
419 * This model is adds the lazy management improvement to Legrand and
420 * Velho model. This improvement essentially replaces the list of actions
421 * inside the simulation kernel by a heap in order to reduce the complexity
422 * at each iteration of the simulation kernel.
424 * \see surf_workstation_model_init_LegrandVelho()
426 XBT_PUBLIC(void) im_surf_network_model_init_LegrandVelho(void);
428 /** \brief Initializes the platform with the network model 'Constant'
429 * \ingroup SURF_models
430 * \param filename XML platform file name
432 * In this model, the communication time between two network cards is
433 * constant, hence no need for a routing table. This is particularly
434 * usefull when simulating huge distributed algorithms where
435 * scalability is really an issue. This function is called in
436 * conjunction with surf_workstation_model_init_compound.
438 * \see surf_workstation_model_init_compound()
440 XBT_PUBLIC(void) surf_network_model_init_Constant(void);
442 /** \brief Initializes the platform with the network model CM02
443 * \ingroup SURF_models
444 * \param filename XML platform file name
446 * This function is called by surf_workstation_model_init_CLM03
447 * or by yourself only if you plan using surf_workstation_model_init_compound
449 * \see surf_workstation_model_init_CLM03()
451 XBT_PUBLIC(void) surf_network_model_init_CM02(void);
454 * brief initialize the the network model bypassing the XML parser
456 XBT_PUBLIC(void) surf_network_model_init_bypass(const char *id,
461 /** \brief Initializes the platform with the network model GTNETS
462 * \ingroup SURF_models
463 * \param filename XML platform file name
465 * This function is called by surf_workstation_model_init_GTNETS
466 * or by yourself only if you plan using surf_workstation_model_init_compound
468 * \see surf_workstation_model_init_GTNETS()
470 XBT_PUBLIC(void) surf_network_model_init_GbTNETS(void);
474 /** \brief Initializes the platform with the network model NS3
475 * \ingroup SURF_models
476 * \param filename XML platform file name
478 * This function is called by surf_workstation_model_init_NS3
479 * or by yourself only if you plan using surf_workstation_model_init_compound
481 * \see surf_workstation_model_init_NS3()
483 XBT_PUBLIC(void) surf_network_model_init_NS3(void);
485 XBT_PUBLIC(void) parse_ns3_add_host(void);
486 XBT_PUBLIC(void) parse_ns3_add_router(void);
487 XBT_PUBLIC(void) parse_ns3_add_link(void);
488 XBT_PUBLIC(void) parse_ns3_add_AS(void);
489 XBT_PUBLIC(void) parse_ns3_add_route(void);
490 XBT_PUBLIC(void) parse_ns3_add_ASroute(void);
491 XBT_PUBLIC(void) parse_ns3_add_cluster(void);
492 XBT_PUBLIC(void) parse_ns3_end_platform(void);
493 XBT_PUBLIC(void) create_ns3_topology(void);
494 XBT_PUBLIC(double) ns3_get_link_latency(const void *link);
495 XBT_PUBLIC(double) ns3_get_link_bandwidth(const void *link);
499 /** \brief Initializes the platform with the network model Reno
500 * \ingroup SURF_models
501 * \param filename XML platform file name
503 * The problem is related to max( sum( arctan(C * Df * xi) ) ).
506 * [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
507 * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
509 * Call this function only if you plan using surf_workstation_model_init_compound.
512 XBT_PUBLIC(void) surf_network_model_init_Reno(void);
514 /** \brief Initializes the platform with the network model Reno2
515 * \ingroup SURF_models
516 * \param filename XML platform file name
518 * The problem is related to max( sum( arctan(C * Df * xi) ) ).
521 * [LOW01] S. H. Low. A duality model of TCP and queue management algorithms.
522 * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
524 * Call this function only if you plan using surf_workstation_model_init_compound.
527 XBT_PUBLIC(void) surf_network_model_init_Reno2(void);
529 /** \brief Initializes the platform with the network model Vegas
530 * \ingroup SURF_models
531 * \param filename XML platform file name
533 * This problem is related to max( sum( a * Df * ln(xi) ) ) which is equivalent
534 * to the proportional fairness.
537 * [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
538 * IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
540 * Call this function only if you plan using surf_workstation_model_init_compound.
543 XBT_PUBLIC(void) surf_network_model_init_Vegas(void);
545 /** \brief The list of all available network model models
546 * \ingroup SURF_models
548 XBT_PUBLIC_DATA(s_surf_model_description_t)
549 surf_network_model_description[];
552 /** \brief The workstation model
553 * \ingroup SURF_models
555 * Note that when you create an API on top of SURF,
556 * the workstation model should be the only one you use
557 * because depending on the platform model, the network model and the CPU model
560 XBT_PUBLIC_DATA(surf_model_t) surf_workstation_model;
562 /** \brief Initializes the platform with a compound workstation model
563 * \ingroup SURF_models
564 * \param filename XML platform file name
566 * This function should be called after a cpu_model and a
567 * network_model have been set up.
570 XBT_PUBLIC(void) surf_workstation_model_init_compound(void);
572 /** \brief Initializes the platform with the workstation model CLM03
573 * \ingroup SURF_models
574 * \param filename XML platform file name
576 * This platform model seperates the workstation model and the network model.
577 * The workstation model will be initialized with the model CLM03, the network
578 * model with the model CM02 and the CPU model with the model Cas01.
579 * In future releases, some other network models will be implemented and will be
580 * combined with the workstation model CLM03.
582 * \see surf_workstation_model_init_KCCFLN05()
584 XBT_PUBLIC(void) surf_workstation_model_init_CLM03(void);
586 /** \brief Initializes the platform with the model KCCFLN05
587 * \ingroup SURF_models
588 * \param filename XML platform file name
590 * With this model, the workstations and the network are handled
591 * together. The network model is roughly the same as in CM02 but
592 * interference between computations and communications can be taken
593 * into account. This platform model is the default one for MSG and
597 XBT_PUBLIC(void) surf_workstation_model_init_KCCFLN05(void);
599 /** \brief Initializes the platform with the model KCCFLN05
600 * \ingroup SURF_models
601 * \param filename XML platform file name
603 * With this model, only parallel tasks can be used. Resource sharing
604 * is done by identifying bottlenecks and giving an equal share of
605 * the model to each action.
608 XBT_PUBLIC(void) surf_workstation_model_init_ptask_L07(void);
610 /** \brief The list of all available workstation model models
611 * \ingroup SURF_models
613 XBT_PUBLIC_DATA(s_surf_model_description_t)
614 surf_workstation_model_description[];
616 /** \brief List of initialized models
617 * \ingroup SURF_models
619 XBT_PUBLIC_DATA(xbt_dynar_t) model_list;
621 /*******************************************/
622 /*** SURF Globals **************************/
623 /*******************************************/
624 XBT_PUBLIC_DATA(xbt_cfg_t) _surf_cfg_set;
626 /** \brief Initialize SURF
627 * \ingroup SURF_simulation
628 * \param argc argument number
629 * \param argv arguments
631 * This function has to be called to initialize the common
632 * structures. Then you will have to create the environment by
634 * e.g. surf_workstation_model_init_CLM03() or
635 * surf_workstation_model_init_KCCFLN05().
637 * \see surf_workstation_model_init_CLM03(),
638 * surf_workstation_model_init_KCCFLN05(), surf_workstation_model_init_compound(), surf_exit()
640 XBT_PUBLIC(void) surf_init(int *argc, char **argv); /* initialize common structures */
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(const char* prop_id, const char* prop_value);
687 XBT_PUBLIC_DATA(void) parse_properties_XML(void);
689 /* surf parse file related (public because called from a test suite) */
690 XBT_PUBLIC(void) parse_platform_file(const char *file);
692 /* Stores the sets */
693 XBT_PUBLIC_DATA(xbt_dict_t) set_list;
695 /* For the trace and trace:connect tag (store their content till the end of the parsing) */
696 XBT_PUBLIC_DATA(xbt_dict_t) traces_set_list;
697 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_host_avail;
698 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_power;
699 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_link_avail;
700 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_bandwidth;
701 XBT_PUBLIC_DATA(xbt_dict_t) trace_connect_list_latency;
704 XBT_PUBLIC(double) get_cpu_power(const char *power);
706 /*public interface to create resource bypassing the parser via cpu/network model
708 * see surfxml_parse.c
710 XBT_PUBLIC(void*) surf_host_create_resource(char *name, double power_peak,
712 tmgr_trace_t power_trace,
714 e_surf_resource_state_t
716 tmgr_trace_t state_trace,
717 xbt_dict_t cpu_properties);
719 /*public interface to create resource bypassing the parser via workstation_ptask_L07 model
721 * see surfxml_parse.c
723 XBT_PUBLIC(void*) surf_wsL07_host_create_resource(char *name,
726 tmgr_trace_t power_trace,
727 e_surf_resource_state_t
729 tmgr_trace_t state_trace,
733 * create link resource
734 * see surfxml_parse.c
736 XBT_PUBLIC(void*) surf_link_create_resource(char *name,
738 tmgr_trace_t bw_trace,
740 tmgr_trace_t lat_trace,
741 e_surf_resource_state_t
743 tmgr_trace_t state_trace,
744 e_surf_link_sharing_policy_t
745 policy, xbt_dict_t properties);
748 XBT_PUBLIC(void*) surf_wsL07_link_create_resource(char *name,
750 tmgr_trace_t bw_trace,
752 tmgr_trace_t lat_trace,
753 e_surf_resource_state_t
755 tmgr_trace_t state_trace,
756 e_surf_link_sharing_policy_t
758 xbt_dict_t properties);
760 * add route element (link_ctn) bypassing the parser
762 * see surfxml_parse.c
765 XBT_PUBLIC(void) surf_add_route_element(char *link_ctn_id);
768 * set route src_id,dest_id, and create a route resource
770 * see surf_routing.c && surfxml_parse.c
773 XBT_PUBLIC(void) surf_set_routes(void);
778 * see surfxml_parse.c
780 XBT_PUBLIC(void) surf_add_host_traces(void);
781 XBT_PUBLIC(void) surf_add_link_traces(void);
782 XBT_PUBLIC(void) surf_wsL07_add_traces(void);
784 //Set a new link on the actual list of link for a route or ASroute
785 XBT_PUBLIC(void) routing_add_link(const char *link_id);
786 //Set the endpoints for a route
787 XBT_PUBLIC(void) routing_set_route(const char *src_id, const char *dst_id);
789 XBT_PUBLIC(void) routing_store_route(void);
790 XBT_PUBLIC(void) surf_routing_add_route(const char *src_id,
792 xbt_dynar_t links_id);
794 #include "surf/surf_resource.h"
795 #include "surf/surf_resource_lmm.h"
798 #endif /* _SURF_SURF_H */