-/*
- * surfxml_parse_values.h
- *
- * Created on: 24 oct. 2011
- * Author: navarrop
- */
+/* Copyright (c) 2011. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
#ifndef SURFXML_PARSE_VALUES_H_
#define SURFXML_PARSE_VALUES_H_
char* V_router_coord;
} s_router_t;
-typedef struct s_host *host_t;
-typedef struct s_host {
+typedef struct s_hostSG *hostSG_t;
+typedef struct s_hostSG {
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
char* V_host_coord;
-} s_host_t;
+} s_hostSG_t;
-extern host_t struct_host;
+extern hostSG_t struct_host;
extern router_t struct_router;
extern cluster_t struct_cluster;
extern peer_t struct_peer;
{
container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
- double bandwidth_value = lnk->V_link_bandwidth;
- double latency_value = lnk->V_link_latency;
+ double bandwidth_value = struct_lnk->V_link_bandwidth;
+ double latency_value = struct_lnk->V_link_latency;
xbt_dynar_t links_to_create = xbt_dynar_new (sizeof(char*), &xbt_free_ref);
- if (lnk->V_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX){
- char *up = bprintf("%s_UP", lnk->V_link_id);
- char *down = bprintf("%s_DOWN", lnk->V_link_id);
+ if (struct_lnk->V_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX){
+ char *up = bprintf("%s_UP", struct_lnk->V_link_id);
+ char *down = bprintf("%s_DOWN", struct_lnk->V_link_id);
xbt_dynar_push_as (links_to_create, char*, xbt_strdup(up));
xbt_dynar_push_as (links_to_create, char*, xbt_strdup(down));
free (up);
free (down);
}else{
- xbt_dynar_push_as (links_to_create, char*, strdup(lnk->V_link_id));
+ xbt_dynar_push_as (links_to_create, char*, strdup(struct_lnk->V_link_id));
}
char *link_name = NULL;
static void instr_routing_parse_start_host ()
{
container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
- container_t new = newContainer (host->V_host_id, INSTR_HOST, father);
+ container_t new = newContainer (struct_host->V_host_id, INSTR_HOST, father);
if (TRACE_categorized() || TRACE_uncategorized()) {
type_t power = getVariableType ("power", NULL, new->type);
- new_pajeSetVariable (0, new, power, host->V_host_power_peak);
+ new_pajeSetVariable (0, new, power, struct_host->V_host_power_peak);
}
if (TRACE_uncategorized()){
getVariableType ("power_used", "0.5 0.5 0.5", new->type);
static void instr_routing_parse_start_router ()
{
container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
- newContainer (router->V_router_id, INSTR_ROUTER, father);
+ newContainer (struct_router->V_router_id, INSTR_ROUTER, father);
}
static void instr_routing_parse_end_router ()
#include "surf/surfxml_parse_private.h"
#include "surf/surf_private.h"
-host_t struct_host;
+hostSG_t struct_host;
router_t struct_router;
cluster_t struct_cluster;
peer_t struct_peer;
void STag_surfxml_host(void){
// XBT_INFO("STag_surfxml_host [%s]",A_surfxml_host_id);
- struct_host = xbt_new0(s_host_t, 1);
+ struct_host = xbt_new0(s_hostSG_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);