#ifndef SURFXML_PARSE_VALUES_H_
#define SURFXML_PARSE_VALUES_H_
-typedef struct s_peer *peer_t;
-typedef struct s_peer {
+typedef struct s_surf_parsing_peer_arg *surf_parsing_peer_arg_t;
+typedef struct s_surf_parsing_peer_arg {
char* V_peer_id;
char* V_peer_power;
char* V_peer_bw_in;
char* V_peer_coord;
char* V_peer_availability_trace;
char* V_peer_state_trace;
-} s_peer_t;
+} s_surf_parsing_peer_arg_t;
-typedef struct s_link *link_t;
-typedef struct s_link {
+typedef struct s_surf_parsing_link_arg *surf_parsing_link_arg_t;
+typedef struct s_surf_parsing_link_arg {
char* V_link_id;
double V_link_bandwidth;
tmgr_trace_t V_link_bandwidth_file;
tmgr_trace_t V_link_state_file;
int V_link_sharing_policy;
int V_policy_initial_link;
-} s_link_t;
+} s_surf_parsing_link_arg_t;
-typedef struct s_cluster *cluster_t;
-typedef struct s_cluster {
+typedef struct s_surf_parsing_cluster_arg *surf_parsing_cluster_arg_t;
+typedef struct s_surf_parsing_cluster_arg {
char* V_cluster_id;
char* V_cluster_prefix;
char* V_cluster_suffix;
int V_cluster_bb_sharing_policy;
char* V_cluster_availability_file;
char* V_cluster_state_file;
-} s_cluster_t;
+} s_surf_parsing_cluster_arg_t;
-typedef struct s_router *router_t;
-typedef struct s_router {
+typedef struct s_surf_parsing_router_arg *surf_parsing_router_arg_t;
+typedef struct s_surf_parsing_router_arg {
char* V_router_id;
char* V_router_coord;
-} s_router_t;
+} s_surf_parsing_router_arg_t;
-typedef struct s_hostSG *hostSG_t;
-typedef struct s_hostSG {
+typedef struct s_surf_parsing_host_arg *surf_parsing_host_arg_t;
+typedef struct s_surf_parsing_host_arg {
char* V_host_id; //id
double V_host_power_peak; //power
int V_host_core; //core
e_surf_resource_state_t V_host_state_initial; //state
tmgr_trace_t V_host_state_trace; //state file
const char* V_host_coord;
-} s_hostSG_t;
+} s_surf_parsing_host_arg_t;
-extern hostSG_t struct_host;
-extern router_t struct_router;
-extern cluster_t struct_cluster;
-extern peer_t struct_peer;
-extern link_t struct_lnk;
+extern surf_parsing_host_arg_t struct_host;
+extern surf_parsing_router_arg_t struct_router;
+extern surf_parsing_cluster_arg_t struct_cluster;
+extern surf_parsing_peer_arg_t struct_peer;
+extern surf_parsing_link_arg_t struct_lnk;
void STag_surfxml_host_cluster(void);
void STag_surfxml_link_cluster(void);
link_id = bprintf("%s_link_%d", struct_cluster->V_cluster_id, start);
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->S_cluster_power);
- struct_host = xbt_new0(s_hostSG_t, 1);
+ struct_host = xbt_new0(s_surf_parsing_host_arg_t, 1);
struct_host->V_host_id = host_id;
if(strcmp(struct_cluster->V_cluster_availability_file,"")){
xbt_dict_set(patterns, "radical", bprintf("%d", start), xbt_free);
XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id,struct_cluster->S_cluster_bw, struct_cluster->S_cluster_lat);
- struct_lnk = xbt_new0(s_link_t, 1);
+ struct_lnk = xbt_new0(s_surf_parsing_link_arg_t, 1);
struct_lnk->V_link_id = link_id;
struct_lnk->V_link_bandwidth = struct_cluster->S_cluster_bw;
struct_lnk->V_link_latency = struct_cluster->S_cluster_lat;
A_surfxml_host_state = A_surfxml_host_state_ON;
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id, struct_cluster->S_cluster_power);
- struct_host = xbt_new0(s_hostSG_t, 1);
+ struct_host = xbt_new0(s_surf_parsing_host_arg_t, 1);
struct_host->V_host_id = host_id;
if(strcmp(struct_cluster->V_cluster_availability_file,"")){
xbt_dict_set(patterns, "radical", bprintf("%d", i), xbt_free);
XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id,struct_cluster->S_cluster_bw, struct_cluster->S_cluster_lat);
- struct_lnk = xbt_new0(s_link_t, 1);
+ struct_lnk = xbt_new0(s_surf_parsing_link_arg_t, 1);
struct_lnk->V_link_id = link_id;
struct_lnk->V_link_bandwidth = struct_cluster->S_cluster_bw;
struct_lnk->V_link_latency = struct_cluster->S_cluster_lat;
if(cluster_bb_sharing_policy == A_surfxml_cluster_bb_sharing_policy_FATPIPE)
{A_surfxml_link_sharing_policy = A_surfxml_link_sharing_policy_FATPIPE;}
- struct_lnk = xbt_new0(s_link_t, 1);
+ struct_lnk = xbt_new0(s_surf_parsing_link_arg_t, 1);
struct_lnk->V_link_id = link_backbone;
struct_lnk->V_link_bandwidth = struct_cluster->S_cluster_bb_bw;
struct_lnk->V_link_latency = struct_cluster->S_cluster_bb_lat;
void STag_surfxml_host(void){
// XBT_INFO("STag_surfxml_host [%s]",A_surfxml_host_id);
- struct_host = xbt_new0(s_hostSG_t, 1);
+ struct_host = xbt_new0(s_surf_parsing_host_arg_t, 1);
struct_host->V_host_id = xbt_strdup(A_surfxml_host_id);
struct_host->V_host_power_peak = get_cpu_power(A_surfxml_host_power);
surf_parse_get_double(&(struct_host->V_host_power_scale), A_surfxml_host_availability);
}
void STag_surfxml_router(void){
- struct_router = xbt_new0(s_router_t, 1);
+ struct_router = xbt_new0(s_surf_parsing_router_arg_t, 1);
struct_router->V_router_id = xbt_strdup(A_surfxml_router_id);
struct_router->V_router_coord = xbt_strdup(A_surfxml_router_coordinates);
surfxml_call_cb_functions(STag_surfxml_router_cb_list);
void STag_surfxml_cluster(void){
surf_parse_models_setup(); /* ensure that the models are created after the last <config> tag. See comment in simgrid.dtd */
- struct_cluster = xbt_new0(s_cluster_t, 1);
+ struct_cluster = xbt_new0(s_surf_parsing_cluster_arg_t, 1);
struct_cluster->V_cluster_id = xbt_strdup(A_surfxml_cluster_id);
struct_cluster->V_cluster_prefix = xbt_strdup(A_surfxml_cluster_prefix);
struct_cluster->V_cluster_suffix = xbt_strdup(A_surfxml_cluster_suffix);
void STag_surfxml_peer(void){
surf_parse_models_setup(); /* ensure that the models are created after the last <config> tag. See comment in simgrid.dtd */
- struct_peer = xbt_new0(s_peer_t, 1);
+ struct_peer = xbt_new0(s_surf_parsing_peer_arg_t, 1);
struct_peer->V_peer_id = xbt_strdup(A_surfxml_peer_id);
struct_peer->V_peer_power = xbt_strdup(A_surfxml_peer_power);
struct_peer->V_peer_bw_in = xbt_strdup(A_surfxml_peer_bw_in);
xbt_free(struct_peer);
}
void STag_surfxml_link(void){
- struct_lnk = xbt_new0(s_link_t, 1);
+ struct_lnk = xbt_new0(s_surf_parsing_link_arg_t, 1);
struct_lnk->V_link_id = xbt_strdup(A_surfxml_link_id);
surf_parse_get_double(&(struct_lnk->V_link_bandwidth),A_surfxml_link_bandwidth);
struct_lnk->V_link_bandwidth_file = tmgr_trace_new(A_surfxml_link_bandwidth_file);
* Pass arguments to parsing callback as structures to save some time (and allow callbacks to ignore some)
*/
-hostSG_t struct_host = NULL;
-router_t struct_router = NULL;
-cluster_t struct_cluster = NULL;
-peer_t struct_peer = NULL;
-link_t struct_lnk = NULL;
+surf_parsing_host_arg_t struct_host = NULL;
+surf_parsing_router_arg_t struct_router = NULL;
+surf_parsing_cluster_arg_t struct_cluster = NULL;
+surf_parsing_peer_arg_t struct_peer = NULL;
+surf_parsing_link_arg_t struct_lnk = NULL;
/*