/** @Brief Specify that we use that action */
XBT_PUBLIC(void) surf_action_ref(surf_action_t action);
/** @Brief Specify that we use that action */
XBT_PUBLIC(void) surf_action_ref(surf_action_t action);
*
* Never create s_surf_action_t by yourself ! The actions are created
* on the fly when you call execute or communicate on a model.
*
* Never create s_surf_action_t by yourself ! The actions are created
* on the fly when you call execute or communicate on a model.
enum heap_action_type hat;
} s_surf_action_lmm_t, *surf_action_lmm_t;
enum heap_action_type hat;
} s_surf_action_lmm_t, *surf_action_lmm_t;
*
* This structure contains some sets of actions.
* It provides a fast access to the actions in each state.
*
* This structure contains some sets of actions.
* It provides a fast access to the actions in each state.
*
* Public functions specific to the network model
*/
typedef struct surf_network_model_extension_public {
*
* Public functions specific to the network model
*/
typedef struct surf_network_model_extension_public {
- surf_action_t(*communicate) (const char *src_name,
- const char *dst_name,
- double size, double rate);
- xbt_dynar_t(*get_route) (const char *src_name, const char *dst_name); //FIXME: kill field? That is done by the routing nowadays
+ surf_action_t (*communicate) (network_element_t src,
+ network_element_t dst,
+ double size, double rate);
+ xbt_dynar_t(*get_route) (void *src, void *dst); //FIXME: kill field? That is done by the routing nowadays
double (*get_link_bandwidth) (const void *link);
double (*get_link_latency) (const void *link);
int (*link_shared) (const void *link);
double (*get_link_bandwidth) (const void *link);
double (*get_link_latency) (const void *link);
int (*link_shared) (const void *link);
+typedef struct surf_file {
+ char *name; /**< @brief host name if any */
+ void *simdata;
+ void *data; /**< @brief user data */
+}s_surf_file_t, *surf_file_t;
+
typedef struct surf_storage_model_extension_public {
surf_action_t(*open) (void *storage, const char* path, const char* mode);
surf_action_t(*close) (void *storage, surf_file_t fp);
surf_action_t(*read) (void *storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream);
surf_action_t(*write) (void *storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream);
surf_action_t(*stat) (void *storage, int fd, void* buf);
typedef struct surf_storage_model_extension_public {
surf_action_t(*open) (void *storage, const char* path, const char* mode);
surf_action_t(*close) (void *storage, surf_file_t fp);
surf_action_t(*read) (void *storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream);
surf_action_t(*write) (void *storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream);
surf_action_t(*stat) (void *storage, int fd, void* buf);
- void* (*create_resource) (const char* id, const char* model,const char* type_id,
- const char* content, xbt_dict_t storage_properties);
+ void* (*create_resource) (const char* id, const char* model,const char* type_id);
*
* Generic data structure for a model. The workstations,
* the CPUs and the network links are examples of models.
*
* Generic data structure for a model. The workstations,
* the CPUs and the network links are examples of models.
return xbt_lib_get_or_null(host_lib, name, SURF_WKS_LEVEL);
}
static inline void *surf_network_resource_by_name(const char *name){
return xbt_lib_get_or_null(host_lib, name, SURF_WKS_LEVEL);
}
static inline void *surf_network_resource_by_name(const char *name){
- return xbt_lib_get_or_null(link_lib, name, SURF_LINK_LEVEL);
+ network_element_t net_elm = xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL);
+ if(!net_elm) net_elm = xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
+ return net_elm;
}
static inline void *surf_storage_resource_by_name(const char *name){
return xbt_lib_get_or_null(storage_lib, name, SURF_STORAGE_LEVEL);
}
static inline void *surf_storage_resource_by_name(const char *name){
return xbt_lib_get_or_null(storage_lib, name, SURF_STORAGE_LEVEL);
*
* By default, this model uses the lazy optimization mechanism that
* relies on partial invalidation in LMM and a heap for lazy action update.
*
* By default, this model uses the lazy optimization mechanism that
* relies on partial invalidation in LMM and a heap for lazy action update.
* These optimization modes can be set using --cfg=cpu/optim:... and --cfg=network/optim:...
*/
XBT_PUBLIC_DATA(s_surf_model_description_t) surf_optimization_mode_description[];
* These optimization modes can be set using --cfg=cpu/optim:... and --cfg=network/optim:...
*/
XBT_PUBLIC_DATA(s_surf_model_description_t) surf_optimization_mode_description[];
*
* When creating a new API on top on SURF, you shouldn't use the
* network model unless you know what you are doing. Only the workstation
*
* When creating a new API on top on SURF, you shouldn't use the
* network model unless you know what you are doing. Only the workstation
-/** \brief Same as network model 'LagrangeVelho', only with different correction factors.
- * \ingroup SURF_models
+/** \ingroup SURF_models
+ * \brief Same as network model 'LagrangeVelho', only with different correction factors.
*
* This model is proposed by Pierre-Nicolas Clauss and Martin Quinson and Stéphane Génaud
* based on the model 'LV08' and different correction factors depending on the communication
*
* This model is proposed by Pierre-Nicolas Clauss and Martin Quinson and Stéphane Génaud
* based on the model 'LV08' and different correction factors depending on the communication
*
* This model is proposed by Arnaud Legrand and Pedro Velho based on
* the results obtained with the GTNets simulator for onelink and
*
* This model is proposed by Arnaud Legrand and Pedro Velho based on
* the results obtained with the GTNets simulator for onelink and
*
* In this model, the communication time between two network cards is
* constant, hence no need for a routing table. This is particularly
*
* In this model, the communication time between two network cards is
* constant, hence no need for a routing table. This is particularly
*
* 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_model_init_CLM03
* or by yourself only if you plan using surf_workstation_model_init_compound
* \param filename XML platform file name
*
* This function is called by surf_workstation_model_init_GTNETS
* \param filename XML platform file name
*
* This function is called by surf_workstation_model_init_GTNETS
* \param filename XML platform file name
*
* This function is called by surf_workstation_model_init_NS3
* \param filename XML platform file name
*
* This function is called by surf_workstation_model_init_NS3
-
-XBT_PUBLIC(void) parse_ns3_add_host(void);
-XBT_PUBLIC(void) parse_ns3_add_router(void);
-XBT_PUBLIC(void) parse_ns3_add_link(void);
-XBT_PUBLIC(void) parse_ns3_add_AS(void);
-XBT_PUBLIC(void) parse_ns3_add_route(void);
-XBT_PUBLIC(void) parse_ns3_add_ASroute(void);
-XBT_PUBLIC(void) parse_ns3_add_cluster(void);
-XBT_PUBLIC(void) parse_ns3_end_platform(void);
-XBT_PUBLIC(void) create_ns3_topology(void);
-XBT_PUBLIC(double) ns3_get_link_latency(const void *link);
-XBT_PUBLIC(double) ns3_get_link_bandwidth(const void *link);
-
* \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) ) ).
* \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) ) ).
* \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
* This storage mode can be set using --cfg=storage/model:...
*/
XBT_PUBLIC_DATA(s_surf_model_description_t) surf_storage_model_description[];
* This storage mode can be set using --cfg=storage/model:...
*/
XBT_PUBLIC_DATA(s_surf_model_description_t) surf_storage_model_description[];
*
* Note that when you create an API on top of SURF,
* the workstation model should be the only one you use
*
* Note that when you create an API on top of SURF,
* the workstation model should be the only one you use
*
* This platform model seperates the workstation model and the network model.
* The workstation model will be initialized with the model compound, the network
*
* This platform model seperates the workstation model and the network model.
* The workstation model will be initialized with the model compound, the network
*
* This platform model seperates the workstation model and the network model.
* The workstation model will be initialized with the model CLM03, the network
*
* This platform model seperates the workstation model and the network model.
* The workstation model will be initialized with the model CLM03, the network
*
* With this model, only parallel tasks can be used. Resource sharing
* is done by identifying bottlenecks and giving an equal share of
*
* With this model, only parallel tasks can be used. Resource sharing
* is done by identifying bottlenecks and giving an equal share of
*
* This function must be called before the first call to surf_solve()
*/
XBT_PUBLIC(void) surf_presolve(void);
*
* This function must be called before the first call to surf_solve()
*/
XBT_PUBLIC(void) surf_presolve(void);
* \param max_date Maximum date to update the simulation to, or -1
* \return the elapsed time, or -1.0 if no event could be executed
*
* \param max_date Maximum date to update the simulation to, or -1
* \return the elapsed time, or -1.0 if no event could be executed
*