* It is represented as a cost, a priority, a duration and a state.
*
* \see e_surf_action_state_t
* It is represented as a cost, a priority, a duration and a state.
*
* \see e_surf_action_state_t
- * Generic data structure for a resource. The workstations,
- * the CPUs and the network links are examples of resources.
+ * Generic data structure for a model. The workstations,
+ * the CPUs and the network links are examples of models.
- surf_resource_t resource;
- void (* resource_init) (const char *filename);
-} s_surf_resource_description_t, *surf_resource_description_t;
+ surf_model_t model;
+ void (* model_init) (const char *filename);
+} s_surf_model_description_t, *surf_model_description_t;
} s_surf_action_state_t, *surf_action_state_t;
/***************************/
} s_surf_action_state_t, *surf_action_state_t;
/***************************/
-typedef struct surf_resource_public {
- s_surf_action_state_t states; /**< Any living action on this resource */
- void *(*name_service) (const char *name); /**< Return a resource given its name */
+typedef struct surf_model_public {
+ s_surf_action_state_t states; /**< Any living action on this model */
+ void *(*name_service) (const char *name); /**< Return a model given its name */
const char *(*get_resource_name) (void *resource_id); /**< Return the name of a resource */
e_surf_action_state_t(*action_get_state) (surf_action_t action); /**< Return the state of an action */
const char *(*get_resource_name) (void *resource_id); /**< Return the name of a resource */
e_surf_action_state_t(*action_get_state) (surf_action_t action); /**< Return the state of an action */
int (*is_suspended) (surf_action_t action); /**< Return whether an action is suspended */
void (*set_max_duration) (surf_action_t action, double duration); /**< Set the max duration of an action*/
void (*set_priority) (surf_action_t action, double priority); /**< Set the priority of an action */
int (*is_suspended) (surf_action_t action); /**< Return whether an action is suspended */
void (*set_max_duration) (surf_action_t action, double duration); /**< Set the max duration of an action*/
void (*set_priority) (surf_action_t action, double priority); /**< Set the priority of an action */
-/** \brief Private data available on all resources
- * \ingroup SURF_resources
+ xbt_dict_t (*get_properties) (void* link); /**< Return the properties dictionary */
+
+} s_surf_model_public_t, *surf_model_public_t;
+
+/** \brief Private data available on all models
+ * \ingroup SURF_models
- * Generic data structure for a resource. The workstations,
- * the CPUs and the network links are examples of resources.
+ * Generic data structure for a model. The workstations,
+ * the CPUs and the network links are examples of models.
-typedef struct surf_resource {
- surf_resource_private_t common_private;
- surf_resource_public_t common_public;
-} s_surf_resource_t;
+typedef struct surf_model {
+ surf_model_private_t common_private;
+ surf_model_public_t common_public;
+} s_surf_model_t;
void (*set) (double date, void *function, void *arg);
int (*get) (void **function, void **arg);
void (*set) (double date, void *function, void *arg);
int (*get) (void **function, void **arg);
-} s_surf_timer_resource_extension_public_t,
- *surf_timer_resource_extension_public_t;
+} s_surf_timer_model_extension_public_t,
+ *surf_timer_model_extension_public_t;
-typedef struct surf_timer_resource {
- surf_resource_private_t common_private;
- surf_resource_public_t common_public;
- surf_timer_resource_extension_public_t extension_public;
-} s_surf_timer_resource_t, *surf_timer_resource_t;
+typedef struct surf_timer_model {
+ surf_model_private_t common_private;
+ surf_model_public_t common_public;
+ surf_timer_model_extension_public_t extension_public;
+} s_surf_timer_model_t, *surf_timer_model_t;
- SURF_CPU_ON = 1, /**< Ready */
- SURF_CPU_OFF = 0 /**< Running */
+ SURF_CPU_ON = 1, /**< Up & ready */
+ SURF_CPU_OFF = 0 /**< Down & broken */
surf_action_t(*execute) (void *cpu, double size);
surf_action_t(*sleep) (void *cpu, double duration);
e_surf_cpu_state_t(*get_state) (void *cpu);
double (*get_speed) (void *cpu, double load);
double (*get_available_speed) (void *cpu);
surf_action_t(*execute) (void *cpu, double size);
surf_action_t(*sleep) (void *cpu, double duration);
e_surf_cpu_state_t(*get_state) (void *cpu);
double (*get_speed) (void *cpu, double load);
double (*get_available_speed) (void *cpu);
-} s_surf_cpu_resource_extension_public_t,
- *surf_cpu_resource_extension_public_t;
+} s_surf_cpu_model_extension_public_t,
+ *surf_cpu_model_extension_public_t;
-typedef struct surf_cpu_resource {
- surf_resource_private_t common_private;
- surf_resource_public_t common_public;
- surf_cpu_resource_extension_public_t extension_public;
-} s_surf_cpu_resource_t, *surf_cpu_resource_t;
+typedef struct surf_cpu_model {
+ surf_model_private_t common_private;
+ surf_model_public_t common_public;
+ surf_cpu_model_extension_public_t extension_public;
+} s_surf_cpu_model_t, *surf_cpu_model_t;
-extern XBT_PUBLIC_DATA(int) surf_cpu_resource_description_size;
-/** \brief The list of all available cpu resource models
- * \ingroup SURF_resources
+XBT_PUBLIC_DATA(int) surf_cpu_model_description_size;
+/** \brief The list of all available cpu model models
+ * \ingroup SURF_models
surf_action_t(*communicate) (void *src, void *dst, double size,
double max_rate);
const void** (*get_route) (void *src, void *dst);
surf_action_t(*communicate) (void *src, void *dst, double size,
double max_rate);
const void** (*get_route) (void *src, void *dst);
const char* (*get_link_name) (const void *link);
double (*get_link_bandwidth) (const void *link);
double (*get_link_latency) (const void *link);
const char* (*get_link_name) (const void *link);
double (*get_link_bandwidth) (const void *link);
double (*get_link_latency) (const void *link);
-} s_surf_network_resource_extension_public_t,
- *surf_network_resource_extension_public_t;
+} s_surf_network_model_extension_public_t,
+ *surf_network_model_extension_public_t;
-typedef struct surf_network_resource {
- surf_resource_private_t common_private;
- surf_resource_public_t common_public;
- surf_network_resource_extension_public_t extension_public;
-} s_surf_network_resource_t, *surf_network_resource_t;
+typedef struct surf_network_model {
+ surf_model_private_t common_private;
+ surf_model_public_t common_public;
+ surf_network_model_extension_public_t extension_public;
+} s_surf_network_model_t, *surf_network_model_t;
- * network resource unless you know what you are doing. Only the workstation
- * resource should be accessed because depending on the platform model,
- * the network resource can be NULL.
+ * network model unless you know what you are doing. Only the workstation
+ * model should be accessed because depending on the platform model,
+ * the network model can be NULL.
- * This function is called by surf_workstation_resource_init_CLM03
- * or by yourself only if you plan using surf_workstation_resource_init_compound
+ * This function is called by surf_workstation_model_init_CLM03
+ * or by yourself only if you plan using surf_workstation_model_init_compound
- * This function is called by surf_workstation_resource_init_GTNETS
- * or by yourself only if you plan using surf_workstation_resource_init_compound
+ * This function is called by surf_workstation_model_init_GTNETS
+ * or by yourself only if you plan using surf_workstation_model_init_compound
* \param filename XML platform file name
*
* The problem is related to max( sum( arctan(C * Df * xi) ) ).
* \param filename XML platform file name
*
* The problem is related to max( sum( arctan(C * Df * xi) ) ).
* [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
* IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
*
* [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
* IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
*
* \param filename XML platform file name
*
* This problem is related to max( sum( a * Df * ln(xi) ) ) which is equivalent
* \param filename XML platform file name
*
* This problem is related to max( sum( a * Df * ln(xi) ) ) which is equivalent
* [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
* IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
*
* [LOW03] S. H. Low. A duality model of TCP and queue management algorithms.
* IEEE/ACM Transaction on Networking, 11(4):525-536, 2003.
*
* \param filename XML platform file name
*
* This function implements the proportional fairness known as the maximization
* \param filename XML platform file name
*
* This function implements the proportional fairness known as the maximization
* Semi-definite programming approach for bandwidth allocation and routing in networks.
* Game Theory and Applications, 9:169-179, December 2003. Nova publisher.
*
* Semi-definite programming approach for bandwidth allocation and routing in networks.
* Game Theory and Applications, 9:169-179, December 2003. Nova publisher.
*
-extern XBT_PUBLIC_DATA(int) surf_network_resource_description_size;
-/** \brief The list of all available network resource models
- * \ingroup SURF_resources
+XBT_PUBLIC_DATA(int) surf_network_model_description_size;
+/** \brief The list of all available network model models
+ * \ingroup SURF_models
surf_action_t(*execute) (void *workstation, double size); /**< Execute a computation amount on a workstation
and create the corresponding action */
surf_action_t(*sleep) (void *workstation, double duration); /**< Make a workstation sleep during a given duration */
surf_action_t(*execute) (void *workstation, double size); /**< Execute a computation amount on a workstation
and create the corresponding action */
surf_action_t(*sleep) (void *workstation, double duration); /**< Make a workstation sleep during a given duration */
surf_action_t(*communicate) (void *workstation_src, /**< Execute a communication amount between two workstations */
void *workstation_dst, double size,
double max_rate);
surf_action_t(*communicate) (void *workstation_src, /**< Execute a communication amount between two workstations */
void *workstation_dst, double size,
double max_rate);
surf_action_t(*execute_parallel_task) (int workstation_nb, /**< Execute a parallel task on several workstations */
void **workstation_list,
double *computation_amount,
surf_action_t(*execute_parallel_task) (int workstation_nb, /**< Execute a parallel task on several workstations */
void **workstation_list,
double *computation_amount,
const char* (*get_link_name) (const void *link); /**< Return the name of a network link */
double (*get_link_bandwidth) (const void *link); /**< Return the current bandwidth of a network link */
double (*get_link_latency) (const void *link); /**< Return the current latency of a network link */
const char* (*get_link_name) (const void *link); /**< Return the name of a network link */
double (*get_link_bandwidth) (const void *link); /**< Return the current bandwidth of a network link */
double (*get_link_latency) (const void *link); /**< Return the current latency of a network link */
-} s_surf_workstation_resource_extension_public_t,
- *surf_workstation_resource_extension_public_t;
+} s_surf_workstation_model_extension_public_t,
+ *surf_workstation_model_extension_public_t;
-typedef struct surf_workstation_resource {
- surf_resource_private_t common_private;
- surf_resource_public_t common_public;
- surf_workstation_resource_extension_public_t extension_public;
-} s_surf_workstation_resource_t, *surf_workstation_resource_t;
+typedef struct surf_workstation_model {
+ surf_model_private_t common_private;
+ surf_model_public_t common_public;
+ surf_workstation_model_extension_public_t extension_public;
+} s_surf_workstation_model_t, *surf_workstation_model_t;
- * the workstation resource should be the only one you use
- * because depending on the platform model, the network resource and the CPU resource
+ * the workstation model should be the only one you use
+ * because depending on the platform model, the network model and the CPU model
- * This platform model seperates the workstation resource and the network resource.
- * The workstation resource will be initialized with the model CLM03, the network
- * resource with the model CM02 and the CPU resource with the model Cas01.
+ * This platform model seperates the workstation model and the network model.
+ * The workstation model will be initialized with the model CLM03, the network
+ * model with the model CM02 and the CPU model with the model Cas01.
* In future releases, some other network models will be implemented and will be
* combined with the workstation model CLM03.
*
* In future releases, some other network models will be implemented and will be
* combined with the workstation model CLM03.
*
* \param filename XML platform file name
*
* With this model, the workstations and the network are handled
* \param filename XML platform file name
*
* With this model, the workstations and the network are handled
* \param filename XML platform file name
*
* With this model, only parallel tasks can be used. Resource sharing
* is done by identifying bottlenecks and giving an equal share of
* \param filename XML platform file name
*
* With this model, only parallel tasks can be used. Resource sharing
* is done by identifying bottlenecks and giving an equal share of
-extern XBT_PUBLIC_DATA(int) surf_workstation_resource_description_size;
-/** \brief The list of all available workstation resource models
- * \ingroup SURF_resources
+XBT_PUBLIC_DATA(int) surf_workstation_model_description_size;
+/** \brief The list of all available workstation model models
+ * \ingroup SURF_models
*
* This function has to be called to initialize the common
* structures. Then you will have to create the environment by
*
* This function has to be called to initialize the common
* structures. Then you will have to create the environment by
- * calling surf_timer_resource_init() and
- * e.g. surf_workstation_resource_init_CLM03() or
- * surf_workstation_resource_init_KCCFLN05().
+ * calling surf_timer_model_init() and
+ * e.g. surf_workstation_model_init_CLM03() or
+ * surf_workstation_model_init_KCCFLN05().
- * \see surf_timer_resource_init(), surf_workstation_resource_init_CLM03(),
- * surf_workstation_resource_init_KCCFLN05(), surf_workstation_resource_init_compound(), surf_exit()
+ * \see surf_timer_model_init(), surf_workstation_model_init_CLM03(),
+ * surf_workstation_model_init_KCCFLN05(), surf_workstation_model_init_compound(), surf_exit()
*
* This function execute all possible events, update the action states
* and returns the time elapsed.
*
* This function execute all possible events, update the action states
* and returns the time elapsed.
* are not executed immediately but only when you call surf_solve.
* Note that the returned elapsed time can be zero.
*/
* are not executed immediately but only when you call surf_solve.
* Note that the returned elapsed time can be zero.
*/
+/* Prototypes of the functions that handle the properties */
+XBT_PUBLIC_DATA(xbt_dict_t) current_property_set; /* the prop set for the currently parsed element (also used in SIMIX) */
+void parse_properties(void);
+void free_string(void*);
+
+XBT_PUBLIC(void) surfxml_add_callback(xbt_dynar_t cb_list, void_f_void_t function);