Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid into tomerge
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Jul 2015 12:53:09 +0000 (14:53 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 24 Jul 2015 12:53:09 +0000 (14:53 +0200)
Conflicts:
buildtools/Cmake/DefinePackages.cmake

1  2 
buildtools/Cmake/DefinePackages.cmake
include/simgrid/platf.h
src/surf/surf_routing.cpp
src/surf/surf_routing_cluster.cpp
src/surf/surf_routing_cluster_fat_tree.cpp
src/surf/surf_routing_cluster_torus.cpp
src/surf/surfxml_parse.c

@@@ -393,7 -393,7 +393,8 @@@ endif(
  
  set(SIMGRID_SRC
    src/simgrid/sg_config.c
 +  src/simgrid/host.cpp
+   src/simgrid/util.hpp
    )
  
  set(MSG_SRC
@@@ -464,7 -464,7 +465,7 @@@ set(JSURF_JAVA_GENERATED_SR
    src/bindings/java/org/simgrid/surf/LmmVariable.java
    src/bindings/java/org/simgrid/surf/Model.java
    src/bindings/java/org/simgrid/surf/NetworkAction.java
 -  src/bindings/java/org/simgrid/surf/NetworkLink.java
 +  src/bindings/java/org/simgrid/surf/Link.java
    src/bindings/java/org/simgrid/surf/Plugin.java
    src/bindings/java/org/simgrid/surf/Resource.java
    src/bindings/java/org/simgrid/surf/ResourceState.java
@@@ -603,6 -603,7 +604,7 @@@ set(MC_SR
    src/mc/AddressSpace.hpp
    src/mc/AddressSpace.cpp
    src/mc/mc_forward.h
+   src/mc/mc_forward.hpp
    src/mc/mc_process.h
    src/mc/mc_process.cpp
    src/mc/mc_unw.h
@@@ -686,8 -687,6 +688,8 @@@ set(headers_to_instal
    include/simgrid/platf_generator.h
    include/simgrid/plugins.h
    include/simgrid/simix.h
 +  include/simgrid/host.h
 +  include/simgrid/link.h
    include/smpi/mpi.h
    include/smpi/smpi.h
    include/smpi/smpi_cocci.h
    include/xbt/RngStream.h
    include/xbt/asserts.h
    include/xbt/automaton.h
+   include/xbt/automaton.hpp
    include/xbt/base.h
    include/xbt/config.h
    include/xbt/cunit.h
diff --combined include/simgrid/platf.h
@@@ -10,7 -10,6 +10,7 @@@
  #define SG_PLATF_H
  
  #include <xbt.h>
 +#include <simgrid/host.h>
  
  SG_BEGIN_DECL()
  
@@@ -82,6 -81,7 +82,6 @@@ XBT_PUBLIC(probabilist_event_generator_
                                                                             double scale,
                                                                             double shape);
  
 -typedef xbt_dictelm_t sg_host_t;
  static inline char* sg_host_name(sg_host_t host) {
    return host->key;
  }
@@@ -124,16 -124,9 +124,9 @@@ typedef struct 
  } s_sg_platf_host_cbarg_t, *sg_platf_host_cbarg_t;
  
  #define SG_PLATF_HOST_INITIALIZER { \
-     .id = NULL,\
-     .power_peak = 0,\
-     .core_amount = 1.,\
-     .power_scale = 1,\
-     .initial_state = SURF_RESOURCE_ON,\
-     .power_trace = NULL,\
-     .state_trace = NULL,\
-     .coord = NULL,\
-     .properties = NULL\
-     }
+     NULL, 0, 1, 1, 1., NULL, SURF_RESOURCE_ON, NULL, \
+     NULL, NULL \
+ }
  
  typedef struct {
    const char* id;
@@@ -163,15 -156,8 +156,8 @@@ typedef struct 
  } s_sg_platf_link_cbarg_t, *sg_platf_link_cbarg_t;
  
  #define SG_PLATF_LINK_INITIALIZER {\
-   .id = NULL,\
-   .bandwidth = 0.,\
-   .bandwidth_trace = NULL,\
-   .latency = 0.,\
-   .latency_trace = NULL,\
-   .state = SURF_RESOURCE_ON,\
-   .state_trace = NULL,\
-   .policy = SURF_LINK_SHARED,\
-   .properties = NULL\
+   NULL, 0., NULL, 0., NULL, SURF_RESOURCE_ON, \
+   NULL, SURF_LINK_SHARED, NULL \
  }
  
  typedef struct s_sg_platf_peer_cbarg *sg_platf_peer_cbarg_t;
@@@ -186,7 -172,7 +172,7 @@@ typedef struct s_sg_platf_peer_cbarg 
    tmgr_trace_t state_trace;
  } s_sg_platf_peer_cbarg_t;
  
- #define SG_PLATF_PEER_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}
+ #define SG_PLATF_PEER_INITIALIZER {NULL,0.0,0.0,0.0,0.0,NULL,NULL,NULL}
  
  typedef struct s_sg_platf_route_cbarg *sg_platf_route_cbarg_t;
  typedef struct s_sg_platf_route_cbarg {
    xbt_dynar_t link_list;
  } s_sg_platf_route_cbarg_t;
  
- #define SG_PLATF_ROUTE_INITIALIZER {TRUE,NULL,NULL,NULL,NULL,NULL}
+ #define SG_PLATF_ROUTE_INITIALIZER {1,NULL,NULL,NULL,NULL,NULL}
  
  typedef struct s_sg_platf_cluster_cbarg *sg_platf_cluster_cbarg_t;
  typedef struct s_sg_platf_cluster_cbarg {
    const char* state_trace;
  } s_sg_platf_cluster_cbarg_t;
  
- #define SG_PLATF_CLUSTER_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL \
-   ,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}
+ #define SG_PLATF_CLUSTER_INITIALIZER {NULL,NULL,NULL,NULL,0.0,1 \
+   ,1.,1.,0.,0.,0.,0.,0. \
+   ,SURF_CLUSTER_FLAT,NULL,NULL,NULL, \
+   SURF_LINK_SHARED,SURF_LINK_SHARED,NULL \
+   ,NULL}
  
  typedef struct s_sg_platf_cabinet_cbarg *sg_platf_cabinet_cbarg_t;
  typedef struct s_sg_platf_cabinet_cbarg {
    double lat;
  } s_sg_platf_cabinet_cbarg_t;
  
- #define SG_PLATF_CABINET_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL,NULL}
+ #define SG_PLATF_CABINET_INITIALIZER {NULL,NULL,NULL,NULL,0.0,0.0,0.0}
  
  typedef struct {
    const char* id;
    const char* attach;
  } s_sg_platf_storage_cbarg_t, *sg_platf_storage_cbarg_t;
  
- #define SG_PLATF_STORAGE_INITIALIZER {NULL,NULL,NULL,NULL}
+ #define SG_PLATF_STORAGE_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL}
  
  typedef struct {
    const char* id;
    sg_size_t size;
  } s_sg_platf_storage_type_cbarg_t, *sg_platf_storage_type_cbarg_t;
  
- #define SG_PLATF_STORAGE_TYPE_INITIALIZER {NULL,NULL,NULL,NULL,NULL}
+ #define SG_PLATF_STORAGE_TYPE_INITIALIZER {NULL,NULL,NULL,NULL,NULL,NULL}
  
  typedef struct {
    const char* type_id;
@@@ -294,7 -283,7 +283,7 @@@ typedef struct s_sg_platf_trace_cbarg 
    const char *pc_data;
  } s_sg_platf_trace_cbarg_t;
  
- #define SG_PLATF_TRACE_INITIALIZER {NULL,NULL,NULL,NULL}
+ #define SG_PLATF_TRACE_INITIALIZER {NULL,NULL,0.0,NULL}
  
  typedef struct s_sg_platf_trace_connect_cbarg *sg_platf_trace_connect_cbarg_t;
  typedef struct s_sg_platf_trace_connect_cbarg {
    const char *element;
  } s_sg_platf_trace_connect_cbarg_t;
  
- #define SG_PLATF_TRACE_CONNECT_INITIALIZER {NULL,NULL,NULL}
+ #define SG_PLATF_TRACE_CONNECT_INITIALIZER {SURF_TRACE_CONNECT_KIND_LATENCY,NULL,NULL}
  
  typedef struct s_sg_platf_process_cbarg *sg_platf_process_cbarg_t;
  typedef struct s_sg_platf_process_cbarg {
   */
  xbt_lib_t host_lib;
  
 -int ROUTING_HOST_LEVEL;         //Routing level
 -int SURF_CPU_LEVEL;             //Surf cpu level
  int SURF_HOST_LEVEL;            //Surf host level
 -int SIMIX_HOST_LEVEL;           //Simix host level
 -int SIMIX_STORAGE_LEVEL;        //Simix storage level
 -int MSG_HOST_LEVEL;             //Msg host level
 -int MSG_STORAGE_LEVEL;          //Msg storage level
 -int MSG_FILE_LEVEL;             //Msg file level
 -int SD_HOST_LEVEL;              //Simdag host level
 -int SD_STORAGE_LEVEL;           //Simdag storage level
  int COORD_HOST_LEVEL=0;         //Coordinates level
  int NS3_HOST_LEVEL;             //host node for ns3
  
 -/**
 - * @ingroup SURF_build_api
 - * @brief A library containing all known links
 - */
 -xbt_lib_t link_lib;
 -int SD_LINK_LEVEL;              //Simdag level
 -int SURF_LINK_LEVEL;            //Surf level
 +int MSG_FILE_LEVEL;             //Msg file level
 +
 +int SIMIX_STORAGE_LEVEL;        //Simix storage level
 +int MSG_STORAGE_LEVEL;          //Msg storage level
 +int SD_STORAGE_LEVEL;           //Simdag storage level
  
  xbt_lib_t as_router_lib;
  int ROUTING_ASR_LEVEL;          //Routing level
@@@ -46,17 -57,16 +46,17 @@@ static xbt_dict_t random_value = NULL
   *
   * Routing edges are either host and routers, whatever
   */
 -RoutingEdgePtr sg_routing_edge_by_name_or_null(const char *name) {
 -  RoutingEdgePtr net_elm = (RoutingEdgePtr) xbt_lib_get_or_null(host_lib, name, ROUTING_HOST_LEVEL);
 +RoutingEdge *sg_routing_edge_by_name_or_null(const char *name) {
 +  sg_host_t h = sg_host_by_name(name);
 +  RoutingEdge *net_elm = h==NULL?NULL: sg_host_edge(h);
    if (!net_elm)
 -      net_elm = (RoutingEdgePtr) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
 +      net_elm = (RoutingEdge*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
    return net_elm;
  }
  
  /* Global vars */
 -RoutingPlatfPtr routing_platf = NULL;
 -AsPtr current_routing = NULL;
 +RoutingPlatf *routing_platf = NULL;
 +As *current_routing = NULL;
  
  /* global parse functions */
  extern xbt_dynar_t mount_list;
@@@ -112,15 -122,15 +112,15 @@@ struct s_model_type routing_models[] = 
   */
  static void parse_S_host_link(sg_platf_host_link_cbarg_t host)
  {
 -  RoutingEdgePtr info = static_cast<RoutingEdgePtr>(xbt_lib_get_or_null(host_lib, host->id, ROUTING_HOST_LEVEL));
 +  RoutingEdge *info = sg_host_edge(sg_host_by_name(host->id));
    xbt_assert(info, "Host '%s' not found!", host->id);
    xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER] ||
        current_routing->p_modelDesc == &routing_models[SURF_MODEL_VIVALDI],
        "You have to be in model Cluster to use tag host_link!");
  
    s_surf_parsing_link_up_down_t link_up_down;
 -  link_up_down.link_up = xbt_lib_get_or_null(link_lib, host->link_up, SURF_LINK_LEVEL);
 -  link_up_down.link_down = xbt_lib_get_or_null(link_lib, host->link_down, SURF_LINK_LEVEL);
 +  link_up_down.link_up = Link::byName(host->link_up);
 +  link_up_down.link_down = Link::byName(host->link_down);
  
    xbt_assert(link_up_down.link_up, "Link '%s' not found!",host->link_up);
    xbt_assert(link_up_down.link_down, "Link '%s' not found!",host->link_down);
@@@ -144,15 -154,15 +144,15 @@@ static void parse_S_host(sg_platf_host_
  {
    if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
      current_routing->p_hierarchy = SURF_ROUTING_BASE;
 -  xbt_assert(!xbt_lib_get_or_null(host_lib, host->id, ROUTING_HOST_LEVEL),
 -             "Reading a host, processing unit \"%s\" already exists", host->id);
 +  xbt_assert(!sg_host_by_name(host->id),
 +                   "Reading a host, processing unit \"%s\" already exists", host->id);
  
 -  RoutingEdgePtr info = new RoutingEdgeImpl(xbt_strdup(host->id),
 +  RoutingEdge *info = new RoutingEdgeImpl(xbt_strdup(host->id),
                                                    -1,
                                                    SURF_NETWORK_ELEMENT_HOST,
                                                    current_routing);
    info->setId(current_routing->parsePU(info));
 -  xbt_lib_set(host_lib, host->id, ROUTING_HOST_LEVEL, (void *) info);
 +  sg_host_edge_set(sg_host_by_name_or_create(host->id), info);
    XBT_DEBUG("Having set name '%s' id '%d'", host->id, info->getId());
  
    if(mount_list){
@@@ -191,7 -201,7 +191,7 @@@ static void parse_S_router(sg_platf_rou
               "Reading a router, processing unit \"%s\" already exists",
               router->id);
  
 -  RoutingEdgePtr info = new RoutingEdgeImpl(xbt_strdup(router->id),
 +  RoutingEdge *info = new RoutingEdgeImpl(xbt_strdup(router->id),
                                              -1,
                                              SURF_NETWORK_ELEMENT_ROUTER,
                                              current_routing);
@@@ -361,13 -371,13 +361,13 @@@ void routing_AS_begin(sg_platf_AS_cbarg
    }
  
    /* make a new routing component */
 -  AsPtr new_as = model->create();
 +  As *new_as = model->create();
  
    new_as->p_modelDesc = model;
    new_as->p_hierarchy = SURF_ROUTING_NULL;
    new_as->p_name = xbt_strdup(AS->id);
  
 -  RoutingEdgePtr info = new RoutingEdgeImpl(xbt_strdup(new_as->p_name),
 +  RoutingEdge *info = new RoutingEdgeImpl(xbt_strdup(new_as->p_name),
                                              -1,
                                              SURF_NETWORK_ELEMENT_AS,
                                              current_routing);
@@@ -447,15 -457,15 +447,15 @@@ static void elements_father(sg_routing_
  {
    xbt_assert(src && dst, "bad parameters for \"elements_father\" method");
  #define ELEMENTS_FATHER_MAXDEPTH 16     /* increase if it is not enough */
 -  AsPtr src_as, dst_as;
 -  AsPtr path_src[ELEMENTS_FATHER_MAXDEPTH];
 -  AsPtr path_dst[ELEMENTS_FATHER_MAXDEPTH];
 +  As *src_as, *dst_as;
 +  As *path_src[ELEMENTS_FATHER_MAXDEPTH];
 +  As *path_dst[ELEMENTS_FATHER_MAXDEPTH];
    int index_src = 0;
    int index_dst = 0;
 -  AsPtr current;
 -  AsPtr current_src;
 -  AsPtr current_dst;
 -  AsPtr father;
 +  As *current;
 +  As *current_src;
 +  As *current_dst;
 +  As *father;
  
    /* (1) find the as where the src and dst are located */
    sg_routing_edge_t src_data = src;
   * This function is called by "get_route" and "get_latency". It allows to walk
   * recursively through the ASes tree.
   */
 -static void _get_route_and_latency(RoutingEdgePtr src, RoutingEdgePtr dst,
 +static void _get_route_and_latency(RoutingEdge *src, RoutingEdge *dst,
                                     xbt_dynar_t * links, double *latency)
  {
-   s_sg_platf_route_cbarg_t route;
+   s_sg_platf_route_cbarg_t route = SG_PLATF_ROUTE_INITIALIZER;
    memset(&route,0,sizeof(route));
  
    xbt_assert(src && dst, "bad parameters for \"_get_route_latency\" method");
    XBT_DEBUG("Solve route/latency  \"%s\" to \"%s\"", src->getName(), dst->getName());
  
    /* Find how src and dst are interconnected */
 -  AsPtr common_father, src_father, dst_father;
 +  As *common_father, *src_father, *dst_father;
    elements_father(src, dst, &common_father, &src_father, &dst_father);
    XBT_DEBUG("elements_father: common father '%s' src_father '%s' dst_father '%s'",
        common_father->p_name, src_father->p_name, dst_father->p_name);
  
    route.link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
    // Find the net_card corresponding to father
 -  RoutingEdgePtr src_father_net_elm = src_father->p_netElem;
 -  RoutingEdgePtr dst_father_net_elm = dst_father->p_netElem;
 +  RoutingEdge *src_father_net_elm = src_father->p_netElem;
 +  RoutingEdge *dst_father_net_elm = dst_father->p_netElem;
  
    common_father->getRouteAndLatency(src_father_net_elm, dst_father_net_elm,
                                      &route, latency);
@@@ -602,7 -612,7 +602,7 @@@ e_surf_network_element_type_t surf_rout
   * walk through the routing components tree and find a route between hosts
   * by calling the differents "get_route" functions in each routing component.
   */
 -void RoutingPlatf::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst,
 +void RoutingPlatf::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst,
                                     xbt_dynar_t* route, double *latency)
  {
    XBT_DEBUG("routing_get_route_and_latency from %s to %s", src->getName(), dst->getName());
@@@ -621,9 -631,9 +621,9 @@@ xbt_dynar_t RoutingPlatf::getOneLinkRou
    return recursiveGetOneLinkRoutes(p_root);
  }
  
 -xbt_dynar_t RoutingPlatf::recursiveGetOneLinkRoutes(AsPtr rc)
 +xbt_dynar_t RoutingPlatf::recursiveGetOneLinkRoutes(As *rc)
  {
 -  xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free_f);
 +  xbt_dynar_t ret = xbt_dynar_new(sizeof(Onelink*), xbt_free_f);
  
    //adding my one link routes
    xbt_dynar_t onelink_mine = rc->getOneLinkRoutes();
  
  e_surf_network_element_type_t routing_get_network_element_type(const char *name)
  {
 -  RoutingEdgePtr rc = sg_routing_edge_by_name_or_null(name);
 +  RoutingEdge *rc = sg_routing_edge_by_name_or_null(name);
    if (rc)
      return rc->getRcType();
  
@@@ -748,21 -758,21 +748,21 @@@ static void routing_parse_cabinet(sg_pl
        surf_parse_error("Malformed radical");
        break;
      }
-     s_sg_platf_host_cbarg_t host;
+     s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
      memset(&host, 0, sizeof(host));
      host.initial_state = SURF_RESOURCE_ON;
      host.pstate        = 0;
      host.power_scale   = 1.0;
      host.core_amount   = 1;
  
-     s_sg_platf_link_cbarg_t link;
+     s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
      memset(&link, 0, sizeof(link));
      link.state     = SURF_RESOURCE_ON;
      link.policy    = SURF_LINK_FULLDUPLEX;
      link.latency   = cabinet->lat;
      link.bandwidth = cabinet->bw;
  
-     s_sg_platf_host_link_cbarg_t host_link;
+     s_sg_platf_host_link_cbarg_t host_link = SG_PLATF_HOST_LINK_INITIALIZER;
      memset(&host_link, 0, sizeof(host_link));
  
      for (i = start; i <= end; i++) {
@@@ -800,8 -810,8 +800,8 @@@ static void routing_parse_cluster(sg_pl
    xbt_dict_t patterns = NULL;
    int rankId=0;
  
-   s_sg_platf_host_cbarg_t host;
-   s_sg_platf_link_cbarg_t link;
+   s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
+   s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
  
    unsigned int iter;
    int start, end, i;
      XBT_DEBUG("<AS id=\"%s\"\trouting=\"Torus_Cluster\">", cluster->id);
      AS.routing = A_surfxml_AS_routing_Cluster___torus;
      sg_platf_new_AS_begin(&AS);
 -    ((AsClusterTorusPtr)current_routing)->parse_specific_arguments(cluster);
 +    ((AsClusterTorus*)current_routing)->parse_specific_arguments(cluster);
    }
    else if (cluster->topology == SURF_CLUSTER_FAT_TREE) {
      XBT_DEBUG("<AS id=\"%s\"\trouting=\"Fat_Tree_Cluster\">", cluster->id);
    }
  
    if(cluster->loopback_bw!=0 || cluster->loopback_lat!=0){
 -      ((AsClusterPtr)current_routing)->p_nb_links_per_node++;
 -      ((AsClusterPtr)current_routing)->p_has_loopback=1;
 +      ((AsCluster*)current_routing)->p_nb_links_per_node++;
 +      ((AsCluster*)current_routing)->p_has_loopback=1;
    }
  
    if(cluster->limiter_link!=0){
 -      ((AsClusterPtr)current_routing)->p_nb_links_per_node++;
 -      ((AsClusterPtr)current_routing)->p_has_limiter=1;
 +      ((AsCluster*)current_routing)->p_nb_links_per_node++;
 +      ((AsCluster*)current_routing)->p_has_limiter=1;
    }
  
  
          link.state     = SURF_RESOURCE_ON;
          link.policy    = SURF_LINK_FATPIPE;
          sg_platf_new_link(&link);
 -        info_loop.link_up   =
 -            xbt_lib_get_or_null(link_lib, tmp_link, SURF_LINK_LEVEL);
 +        info_loop.link_up   = Link::byName(tmp_link);
          info_loop.link_down = info_loop.link_up;
          free(tmp_link);
 -        xbt_dynar_set(current_routing->p_linkUpDownList, rankId*((AsClusterPtr)current_routing)->p_nb_links_per_node, &info_loop);
 +        xbt_dynar_set(current_routing->p_linkUpDownList, rankId*(static_cast<AsCluster*>(current_routing))->p_nb_links_per_node, &info_loop);
        }
  
        //add a limiter link (shared link to account for maximal bandwidth of the node)
          link.state = SURF_RESOURCE_ON;
          link.policy = SURF_LINK_SHARED;
          sg_platf_new_link(&link);
 -        info_lim.link_up =
 -            xbt_lib_get_or_null(link_lib, tmp_link, SURF_LINK_LEVEL);
 +        info_lim.link_up = Link::byName(tmp_link);
          info_lim.link_down = info_lim.link_up;
          free(tmp_link);
          xbt_dynar_set(current_routing->p_linkUpDownList,
 -            rankId*((AsClusterPtr)current_routing)->p_nb_links_per_node + ((AsClusterPtr)current_routing)->p_has_loopback ,
 +            rankId*(static_cast<AsCluster*>(current_routing))->p_nb_links_per_node + static_cast<AsCluster*>(current_routing)->p_has_loopback ,
              &info_lim);
  
        }
          ((AsClusterFatTree*) current_routing)->addProcessingNode(i);
        }
        else {
 -      ((AsClusterPtr)current_routing)->create_links_for_node(cluster, i, rankId, rankId*
 -          ((AsClusterPtr)current_routing)->p_nb_links_per_node
 -          + ((AsClusterPtr)current_routing)->p_has_loopback
 -          + ((AsClusterPtr)current_routing)->p_has_limiter );
 +      static_cast<AsCluster*>(current_routing)->create_links_for_node(cluster, i, rankId, rankId*
 +                static_cast<AsCluster*>(current_routing)->p_nb_links_per_node
 +          + static_cast<AsCluster*>(current_routing)->p_has_loopback
 +          + static_cast<AsCluster*>(current_routing)->p_has_limiter );
        }
        xbt_free(link_id);
        xbt_free(host_id);
  
    // For fat trees, the links must be created once all nodes have been added
    if(cluster->topology == SURF_CLUSTER_FAT_TREE) {
 -    ((AsClusterFatTree*)current_routing)->create_links();
 +    static_cast<AsClusterFatTree*>(current_routing)->create_links();
    }
    // Add a router. It is magically used thanks to the way in which surf_routing_cluster is written,
    // and it's very useful to connect clusters together
    XBT_DEBUG(" ");
    XBT_DEBUG("<router id=\"%s\"/>", cluster->router_id);
    char *newid = NULL;
-   s_sg_platf_router_cbarg_t router;
+   s_sg_platf_router_cbarg_t router = SG_PLATF_ROUTER_INITIALIZER;
    memset(&router, 0, sizeof(router));
    router.id = cluster->router_id;
    router.coord = "";
          bprintf("%s%s_router%s", cluster->prefix, cluster->id,
                  cluster->suffix);
    sg_platf_new_router(&router);
 -  ((AsClusterPtr)current_routing)->p_router = (RoutingEdgePtr) xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL);
 +  ((AsCluster*)current_routing)->p_router = (RoutingEdge*) xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL);
    free(newid);
  
    //Make the backbone
  
      sg_platf_new_link(&link);
  
 -    routing_cluster_add_backbone(xbt_lib_get_or_null(link_lib, link_backbone, SURF_LINK_LEVEL));
 +    routing_cluster_add_backbone(Link::byName(link_backbone));
  
      free(link_backbone);
    }
@@@ -1071,7 -1083,7 +1071,7 @@@ static void routing_parse_peer(sg_platf
    current_routing->p_linkUpDownList = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
  
    XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\"/>", host_id, peer->power);
-   s_sg_platf_host_cbarg_t host;
+   s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
    memset(&host, 0, sizeof(host));
    host.initial_state = SURF_RESOURCE_ON;
    host.id = host_id;
    host.core_amount = 1;
    sg_platf_new_host(&host);
  
-   s_sg_platf_link_cbarg_t link;
+   s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
    memset(&link, 0, sizeof(link));
    link.state   = SURF_RESOURCE_ON;
    link.policy  = SURF_LINK_SHARED;
    sg_platf_new_link(&link);
  
    XBT_DEBUG("<host_link\tid=\"%s\"\tup=\"%s\"\tdown=\"%s\" />", host_id,link_up,link_down);
-   s_sg_platf_host_link_cbarg_t host_link;
+   s_sg_platf_host_link_cbarg_t host_link = SG_PLATF_HOST_LINK_INITIALIZER;
    memset(&host_link, 0, sizeof(host_link));
    host_link.id        = host_id;
    host_link.link_up   = link_up;
    sg_platf_new_host_link(&host_link);
  
    XBT_DEBUG("<router id=\"%s\"/>", router_id);
-   s_sg_platf_router_cbarg_t router;
+   s_sg_platf_router_cbarg_t router = SG_PLATF_ROUTER_INITIALIZER;
    memset(&router, 0, sizeof(router));
    router.id = router_id;
    router.coord = peer->coord;
    sg_platf_new_router(&router);
 -  static_cast<AsClusterPtr>(current_routing)->p_router = static_cast<RoutingEdgePtr>(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL));
 +  static_cast<AsCluster*>(current_routing)->p_router = static_cast<RoutingEdge*>(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL));
  
    XBT_DEBUG("</AS>");
    sg_platf_new_AS_end();
@@@ -1260,10 -1272,10 +1260,10 @@@ static void check_disk_attachment(
    xbt_lib_cursor_t cursor;
    char *key;
    void **data;
 -  RoutingEdgePtr host_elm;
 +  RoutingEdge *host_elm;
    xbt_lib_foreach(storage_lib, cursor, key, data) {
      if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) {
 -        StoragePtr storage = static_cast<StoragePtr>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
 +        Storage *storage = static_cast<Storage*>(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL));
          host_elm = sg_routing_edge_by_name_or_null(storage->p_attach);
          if(!host_elm)
                  surf_parse_error("Unable to attach storage %s: host %s doesn't exist.", storage->getName(), storage->p_attach);
@@@ -1306,7 -1318,7 +1306,7 @@@ void routing_register_callbacks(
   * This fuction is call by "finalize". It allow to finalize the
   * AS or routing components. It delete all the structures.
   */
 -static void finalize_rec(AsPtr as) {
 +static void finalize_rec(As *as) {
    xbt_dict_cursor_t cursor = NULL;
    char *key;
    AS_t elem;
@@@ -1333,15 -1345,15 +1333,15 @@@ AS_t surf_AS_get_routing_root() 
    return routing_platf->p_root;
  }
  
 -const char *surf_AS_get_name(AsPtr as) {
 +const char *surf_AS_get_name(As *as) {
    return as->p_name;
  }
  
 -static AsPtr surf_AS_recursive_get_by_name(AsPtr current, const char * name) {
 +static As *surf_AS_recursive_get_by_name(As *current, const char * name) {
    xbt_dict_cursor_t cursor = NULL;
    char *key;
    AS_t elem;
 -  AsPtr tmp = NULL;
 +  As *tmp = NULL;
  
    if(!strcmp(current->p_name, name))
      return current;
  }
  
  
 -AsPtr surf_AS_get_by_name(const char * name) {
 -  AsPtr as = surf_AS_recursive_get_by_name(routing_platf->p_root, name);
 +As *surf_AS_get_by_name(const char * name) {
 +  As *as = surf_AS_recursive_get_by_name(routing_platf->p_root, name);
    if(as == NULL)
      XBT_WARN("Impossible to find an AS with name %s, please check your input", name);
    return as;
  }
  
 -xbt_dict_t surf_AS_get_routing_sons(AsPtr as) {
 +xbt_dict_t surf_AS_get_routing_sons(As *as) {
    return as->p_routingSons;
  }
  
 -const char *surf_AS_get_model(AsPtr as) {
 +const char *surf_AS_get_model(As *as) {
    return as->p_modelDesc->name;
  }
  
 -xbt_dynar_t surf_AS_get_hosts(AsPtr as) {
 +xbt_dynar_t surf_AS_get_hosts(As *as) {
    xbt_dynar_t elms = as->p_indexNetworkElm;
    sg_routing_edge_t relm;
    xbt_dictelm_t delm;
    int count = xbt_dynar_length(elms);
    xbt_dynar_t res =  xbt_dynar_new(sizeof(xbt_dictelm_t), NULL);
    for (index = 0; index < count; index++) {
 -     relm = xbt_dynar_get_as(elms, index, RoutingEdgePtr);
 +     relm = xbt_dynar_get_as(elms, index, RoutingEdge*);
       delm = xbt_lib_get_elm_or_null(host_lib, relm->getName());
       if (delm!=NULL) {
         xbt_dynar_push(res, &delm);
@@@ -29,7 -29,7 +29,7 @@@ AsCluster::AsCluster() : AsNone(
  }
  
  /* Business methods */
 -void AsCluster::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t route, double *lat)
 +void AsCluster::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat)
  {
    s_surf_parsing_link_up_down_t info;
    XBT_VERB("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]",
@@@ -41,7 -41,7 +41,7 @@@
        info = xbt_dynar_get_as(p_linkUpDownList, src->getId() * p_nb_links_per_node, s_surf_parsing_link_up_down_t);
        xbt_dynar_push_as(route->link_list, void *, info.link_up);
        if (lat)
 -        *lat += static_cast<NetworkLinkPtr>(info.link_up)->getLatency();
 +        *lat += static_cast<Link*>(info.link_up)->getLatency();
        return;
      }
  
      if (info.link_up) {         // link up
        xbt_dynar_push_as(route->link_list, void *, info.link_up);
        if (lat)
 -        *lat += static_cast<NetworkLinkPtr>(info.link_up)->getLatency();
 +        *lat += static_cast<Link*>(info.link_up)->getLatency();
      }
  
    }
  
    if (p_backbone) {
 -    xbt_dynar_push_as(route->link_list, void *, static_cast<ResourcePtr>(p_backbone));
 +    xbt_dynar_push_as(route->link_list, void *, static_cast<Resource*>(p_backbone));
      if (lat)
        *lat += p_backbone->getLatency();
    }
@@@ -72,7 -72,7 +72,7 @@@
      if (info.link_down) {       // link down
        xbt_dynar_push_as(route->link_list, void *, info.link_down);
        if (lat)
 -        *lat += static_cast<NetworkLinkPtr>(info.link_down)->getLatency();
 +        *lat += static_cast<Link*>(info.link_down)->getLatency();
      }
      if (p_has_limiter){          // limiter for receiver
          info = xbt_dynar_get_as(p_linkUpDownList, dst->getId() * p_nb_links_per_node + p_has_loopback, s_surf_parsing_link_up_down_t);
@@@ -86,7 -86,7 +86,7 @@@ void AsCluster::getGraph(xbt_graph_t gr
    int isrc;
    int table_size = xbt_dynar_length(p_indexNetworkElm);
  
 -  RoutingEdgePtr src;
 +  RoutingEdge *src;
    xbt_node_t current, previous, backboneNode = NULL, routerNode;
    s_surf_parsing_link_up_down_t info;
  
    }
  
    for (isrc = 0; isrc < table_size; isrc++) {
 -    src = xbt_dynar_get_as(p_indexNetworkElm, isrc, RoutingEdgePtr);
 +    src = xbt_dynar_get_as(p_indexNetworkElm, isrc, RoutingEdge*);
  
      if (src->getRcType() != SURF_NETWORK_ELEMENT_ROUTER) {
        previous = new_xbt_graph_node(graph, src->getName(), nodes);
  
        if (info.link_up) {     // link up
  
 -        const char *link_name = static_cast<ResourcePtr>(info.link_up)->getName();
 +        const char *link_name = static_cast<Resource*>(info.link_up)->getName();
          current = new_xbt_graph_node(graph, link_name, nodes);
          new_xbt_graph_edge(graph, previous, current, edges);
  
        }
  
        if (info.link_down) {    // link down
 -        const char *link_name = static_cast<ResourcePtr>(info.link_down)->getName();
 +        const char *link_name = static_cast<Resource*>(info.link_down)->getName();
          current = new_xbt_graph_node(graph, link_name, nodes);
          new_xbt_graph_edge(graph, previous, current, edges);
  
  }
  
  void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int , int position){
-   s_sg_platf_link_cbarg_t link;
+   s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
    s_surf_parsing_link_up_down_t info;
    char* link_id = bprintf("%s_link_%d", cluster->id, id);
  
  
    if (link.policy == SURF_LINK_FULLDUPLEX) {
      char *tmp_link = bprintf("%s_UP", link_id);
 -    info.link_up = xbt_lib_get_or_null(link_lib, tmp_link, SURF_LINK_LEVEL);
 +    info.link_up = sg_link_by_name(tmp_link);
      xbt_free(tmp_link);
      tmp_link = bprintf("%s_DOWN", link_id);
 -    info.link_down = xbt_lib_get_or_null(link_lib, tmp_link, SURF_LINK_LEVEL);
 +    info.link_down = sg_link_by_name(tmp_link);
      xbt_free(tmp_link);
    } else {
 -    info.link_up = xbt_lib_get_or_null(link_lib, link_id, SURF_LINK_LEVEL);
 +    info.link_up = sg_link_by_name(link_id);
      info.link_down = info.link_up;
    }
    xbt_dynar_set(p_linkUpDownList, position, &info);
    xbt_free(link_id);
  }
  
 -int AsCluster::parsePU(RoutingEdgePtr elm) {
 +int AsCluster::parsePU(RoutingEdge *elm) {
    XBT_DEBUG("Load process unit \"%s\"", elm->getName());
 -  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdgePtr, elm);
 +  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm);
    return xbt_dynar_length(p_indexNetworkElm)-1;
  }
  
 -int AsCluster::parseAS(RoutingEdgePtr elm) {
 +int AsCluster::parseAS(RoutingEdge *elm) {
    XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName());
 -  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdgePtr, elm);
 +  xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm);
    return xbt_dynar_length(p_indexNetworkElm)-1;
  }
  
@@@ -47,8 -47,8 +47,8 @@@ bool AsClusterFatTree::isInSubTree(FatT
    return true;
  }
  
 -void AsClusterFatTree::getRouteAndLatency(RoutingEdgePtr src,
 -                                          RoutingEdgePtr dst,
 +void AsClusterFatTree::getRouteAndLatency(RoutingEdge *src,
 +                                          RoutingEdge *dst,
                                            sg_platf_route_cbarg_t into,
                                            double *latency) {
    FatTreeNode *source, *destination, *currentNode;
@@@ -492,7 -492,7 +492,7 @@@ void AsClusterFatTree::generateDotFile(
  FatTreeNode::FatTreeNode(sg_platf_cluster_cbarg_t cluster, int id, int level,
                           int position) : id(id), level(level),
                                           position(position) {
-   s_sg_platf_link_cbarg_t linkTemplate;
+   s_sg_platf_link_cbarg_t linkTemplate = SG_PLATF_LINK_INITIALIZER;
    if(cluster->limiter_link) {
      memset(&linkTemplate, 0, sizeof(linkTemplate));
      linkTemplate.bandwidth = cluster->limiter_link;
      linkTemplate.policy = SURF_LINK_SHARED;
      linkTemplate.id = bprintf("limiter_%d", id);
      sg_platf_new_link(&linkTemplate);
 -    this->limiterLink = (NetworkLink*) xbt_lib_get_or_null(link_lib,
 -                                                           linkTemplate.id,
 -                                                           SURF_LINK_LEVEL);
 +    this->limiterLink = Link::byName(linkTemplate.id);
      free((void*)linkTemplate.id);
    }
    if(cluster->loopback_bw || cluster->loopback_lat) {
      linkTemplate.policy = SURF_LINK_FATPIPE;
      linkTemplate.id = bprintf("loopback_%d", id);
      sg_platf_new_link(&linkTemplate);
 -    this->loopback = (NetworkLink*) xbt_lib_get_or_null(link_lib,
 -                                                        linkTemplate.id,
 -                                                        SURF_LINK_LEVEL);
 +    this->loopback = Link::byName(linkTemplate.id);
      free((void*)linkTemplate.id);
    }  
  }
@@@ -522,7 -526,7 +522,7 @@@ FatTreeLink::FatTreeLink(sg_platf_clust
                           FatTreeNode *upNode) : upNode(upNode),
                                                  downNode(downNode) {
    static int uniqueId = 0;
-   s_sg_platf_link_cbarg_t linkTemplate;
+   s_sg_platf_link_cbarg_t linkTemplate = SG_PLATF_LINK_INITIALIZER;
    memset(&linkTemplate, 0, sizeof(linkTemplate));
    linkTemplate.bandwidth = cluster->bw;
    linkTemplate.latency = cluster->lat;
    linkTemplate.id = bprintf("link_from_%d_to_%d_%d", downNode->id, upNode->id,
                              uniqueId);
    sg_platf_new_link(&linkTemplate);
 -  NetworkLink* link;
 +  Link* link;
    std::string tmpID;
    if (cluster->sharing_policy == SURF_LINK_FULLDUPLEX) {
      tmpID = std::string(linkTemplate.id) + "_UP";
 -    link = (NetworkLink*) xbt_lib_get_or_null(link_lib, tmpID.c_str(),
 -                                              SURF_LINK_LEVEL);
 +    link =  Link::byName(tmpID.c_str());
      this->upLink = link; // check link?
      tmpID = std::string(linkTemplate.id) + "_DOWN";
 -    link = (NetworkLink*) xbt_lib_get_or_null(link_lib, tmpID.c_str(),
 -                                              SURF_LINK_LEVEL);
 +    link = Link::byName(tmpID.c_str());
      this->downLink = link; // check link ?
    }
    else {
 -    link = (NetworkLink*) xbt_lib_get_or_null(link_lib, linkTemplate.id,
 -                                              SURF_LINK_LEVEL);
 +    link = Link::byName(linkTemplate.id);
      this->upLink = link;
      this->downLink = link;
    }
@@@ -42,7 -42,7 +42,7 @@@ AsClusterTorus::~AsClusterTorus(
  
  
  void AsClusterTorus::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position){
-   s_sg_platf_link_cbarg_t link;
+   s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
    char* link_id;
    unsigned int j = 0;
    /**
        s_surf_parsing_link_up_down_t info;
        if (link.policy == SURF_LINK_FULLDUPLEX) {
            char *tmp_link = bprintf("%s_UP", link_id);
 -          info.link_up =
 -              xbt_lib_get_or_null(link_lib, tmp_link, SURF_LINK_LEVEL);
 +          info.link_up = Link::byName(tmp_link);
            free(tmp_link);
            tmp_link = bprintf("%s_DOWN", link_id);
 -          info.link_down =
 -              xbt_lib_get_or_null(link_lib, tmp_link, SURF_LINK_LEVEL);
 +          info.link_down = Link::byName(tmp_link);
            free(tmp_link);
        } else {
 -          info.link_up = xbt_lib_get_or_null(link_lib, link_id, SURF_LINK_LEVEL);
 +          info.link_up = Link::byName(link_id);
            info.link_down = info.link_up;
        }
        /**
@@@ -118,7 -120,7 +118,7 @@@ void AsClusterTorus::parse_specific_arg
      xbt_dynar_free(&dimensions);
  }
  
 -void AsClusterTorus::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_platf_route_cbarg_t route, double *lat){
 +void AsClusterTorus::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat){
  
    XBT_VERB("torus_get_route_and_latency from '%s'[%d] to '%s'[%d]",
                 src->getName(), src->getId(),
         xbt_dynar_push_as(route->link_list, void *, info.link_up);
  
         if (lat)
 -         *lat += static_cast<NetworkLinkPtr>(info.link_up)->getLatency();
 +         *lat += static_cast<Link*>(info.link_up)->getLatency();
         return;
       }
  
             xbt_dynar_push_as(route->link_list,void*,info.link_down);
  
         if (lat)
 -         *lat += static_cast<NetworkLinkPtr>(info.link_down)->getLatency();
 +         *lat += static_cast<Link*>(info.link_down)->getLatency();
         }else{
             xbt_dynar_push_as(route->link_list,void*,info.link_up);
  
         if (lat)
 -         *lat += static_cast<NetworkLinkPtr>(info.link_up)->getLatency();
 +         *lat += static_cast<Link*>(info.link_up)->getLatency();
         }
         current_node = next_node;
         next_node = 0;
diff --combined src/surf/surfxml_parse.c
@@@ -229,7 -229,7 +229,7 @@@ void STag_surfxml_storage(void
  }
  void ETag_surfxml_storage(void)
  {
-   s_sg_platf_storage_cbarg_t storage;
+   s_sg_platf_storage_cbarg_t storage = SG_PLATF_STORAGE_INITIALIZER;
    memset(&storage,0,sizeof(storage));
  
    storage.id           = A_surfxml_storage_id;
@@@ -250,7 -250,7 +250,7 @@@ void STag_surfxml_storage___type(void
  }
  void ETag_surfxml_storage___type(void)
  {
-   s_sg_platf_storage_type_cbarg_t storage_type;
+   s_sg_platf_storage_type_cbarg_t storage_type = SG_PLATF_STORAGE_TYPE_INITIALIZER;
    memset(&storage_type,0,sizeof(storage_type));
  
    storage_type.content          = A_surfxml_storage___type_content;
@@@ -270,7 -270,7 +270,7 @@@ void STag_surfxml_mstorage(void
  }
  void ETag_surfxml_mstorage(void)
  {
-   s_sg_platf_mstorage_cbarg_t mstorage;
+   s_sg_platf_mstorage_cbarg_t mstorage = SG_PLATF_MSTORAGE_INITIALIZER;
    memset(&mstorage,0,sizeof(mstorage));
  
    mstorage.name    = A_surfxml_mstorage_name;
@@@ -283,7 -283,7 +283,7 @@@ void STag_surfxml_mount(void
  }
  void ETag_surfxml_mount(void)
  {
-   s_sg_platf_mount_cbarg_t mount;
+   s_sg_platf_mount_cbarg_t mount = SG_PLATF_MOUNT_INITIALIZER;
    memset(&mount,0,sizeof(mount));
  
    mount.name      = A_surfxml_mount_name;
@@@ -430,7 -430,7 +430,7 @@@ void STag_surfxml_prop(void
  }
  
  void ETag_surfxml_host(void)    {
-   s_sg_platf_host_cbarg_t host;
+   s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
    char* buf;
    memset(&host,0,sizeof(host));
  
  
  void STag_surfxml_host___link(void){
    XBT_DEBUG("Create a Host_link for %s",A_surfxml_host___link_id);
-   s_sg_platf_host_link_cbarg_t host_link;
+   s_sg_platf_host_link_cbarg_t host_link = SG_PLATF_HOST_LINK_INITIALIZER;
    memset(&host_link,0,sizeof(host_link));
  
    host_link.id        = A_surfxml_host___link_id;
  }
  
  void STag_surfxml_router(void){
-   s_sg_platf_router_cbarg_t router;
+   s_sg_platf_router_cbarg_t router = SG_PLATF_ROUTER_INITIALIZER;
    memset(&router, 0, sizeof(router));
  
    router.id    = A_surfxml_router_id;
  }
  
  void ETag_surfxml_cluster(void){
-   s_sg_platf_cluster_cbarg_t cluster;
+   s_sg_platf_cluster_cbarg_t cluster = SG_PLATF_CLUSTER_INITIALIZER;
    memset(&cluster,0,sizeof(cluster));
    cluster.properties = as_current_property_set;
  
@@@ -587,7 -587,7 +587,7 @@@ void STag_surfxml_cluster(void)
  
  void STag_surfxml_cabinet(void){
    parse_after_config();
-   s_sg_platf_cabinet_cbarg_t cabinet;
+   s_sg_platf_cabinet_cbarg_t cabinet = SG_PLATF_CABINET_INITIALIZER;
    memset(&cabinet,0,sizeof(cabinet));
    cabinet.id      = A_surfxml_cabinet_id;
    cabinet.prefix  = A_surfxml_cabinet_prefix;
  
  void STag_surfxml_peer(void){
    parse_after_config();
-   s_sg_platf_peer_cbarg_t peer;
+   s_sg_platf_peer_cbarg_t peer = SG_PLATF_PEER_INITIALIZER;
    memset(&peer,0,sizeof(peer));
    peer.id                 = A_surfxml_peer_id;
    peer.power              = surf_parse_get_power(A_surfxml_peer_power);
@@@ -622,7 -622,7 +622,7 @@@ void STag_surfxml_link(void)
  }
  
  void ETag_surfxml_link(void){
-   s_sg_platf_link_cbarg_t link;
+   s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
    memset(&link,0,sizeof(link));
  
    link.properties = current_property_set;
@@@ -690,7 -690,7 +690,7 @@@ void STag_surfxml_link___ctn(void)
  }
  
  void ETag_surfxml_backbone(void){
-   s_sg_platf_link_cbarg_t link;
+   s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
    memset(&link,0,sizeof(link));
  
    link.properties = NULL;
    link.policy = SURF_LINK_SHARED;
  
    sg_platf_new_link(&link);
 -  routing_cluster_add_backbone(xbt_lib_get_or_null(link_lib, A_surfxml_backbone_id, SURF_LINK_LEVEL));
 +  routing_cluster_add_backbone(sg_link_by_name(A_surfxml_backbone_id));
  }
  
  void STag_surfxml_route(void){
@@@ -743,7 -743,7 +743,7 @@@ void STag_surfxml_bypassASroute(void)
  }
  
  void ETag_surfxml_route(void){
-   s_sg_platf_route_cbarg_t route;
+   s_sg_platf_route_cbarg_t route = SG_PLATF_ROUTE_INITIALIZER;
    memset(&route,0,sizeof(route));
  
    route.src       = A_surfxml_route_src;
  }
  
  void ETag_surfxml_ASroute(void){
-   s_sg_platf_route_cbarg_t ASroute;
+   s_sg_platf_route_cbarg_t ASroute = SG_PLATF_ROUTE_INITIALIZER;
    memset(&ASroute,0,sizeof(ASroute));
  
    ASroute.src = A_surfxml_ASroute_src;
  }
  
  void ETag_surfxml_bypassRoute(void){
-   s_sg_platf_route_cbarg_t route;
+   s_sg_platf_route_cbarg_t route = SG_PLATF_ROUTE_INITIALIZER;
    memset(&route,0,sizeof(route));
  
    route.src = A_surfxml_bypassRoute_src;
  }
  
  void ETag_surfxml_bypassASroute(void){
-   s_sg_platf_route_cbarg_t ASroute;
+   s_sg_platf_route_cbarg_t ASroute = SG_PLATF_ROUTE_INITIALIZER;
    memset(&ASroute,0,sizeof(ASroute));
  
    ASroute.src         = A_surfxml_bypassASroute_src;
  }
  
  void ETag_surfxml_trace(void){
-   s_sg_platf_trace_cbarg_t trace;
+   s_sg_platf_trace_cbarg_t trace = SG_PLATF_TRACE_INITIALIZER;
    memset(&trace,0,sizeof(trace));
  
    trace.id = A_surfxml_trace_id;
  
  void STag_surfxml_trace___connect(void){
    parse_after_config();
-   s_sg_platf_trace_connect_cbarg_t trace_connect;
+   s_sg_platf_trace_connect_cbarg_t trace_connect = SG_PLATF_TRACE_CONNECT_INITIALIZER;
    memset(&trace_connect,0,sizeof(trace_connect));
  
    trace_connect.element = A_surfxml_trace___connect_element;
@@@ -936,7 -936,7 +936,7 @@@ void STag_surfxml_process(void)
  }
  
  void ETag_surfxml_process(void){
-   s_sg_platf_process_cbarg_t process;
+   s_sg_platf_process_cbarg_t process = SG_PLATF_PROCESS_INITIALIZER;
    memset(&process,0,sizeof(process));
  
    process.argc       = argc;
@@@ -982,7 -982,7 +982,7 @@@ void STag_surfxml_gpu(void
  }
  void ETag_surfxml_gpu(void)
  {
-   s_sg_platf_gpu_cbarg_t gpu;
+   s_sg_platf_gpu_cbarg_t gpu = SG_PLATF_GPU_INITIALIZER;
    memset(&gpu,0,sizeof(gpu));
  
    gpu.name = A_surfxml_gpu_name;