Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Also cleanup the fields of s_sg_platf_link_cbarg_t
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 8 Nov 2011 11:05:51 +0000 (12:05 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 8 Nov 2011 11:05:51 +0000 (12:05 +0100)
This one is not just a renaming:
 - kill the unused V_policy_initial_link
 - make V_link_sharing_policy (now 'policy') a
   e_surf_link_sharing_policy_t (which thus become public)
This should be enough for field renaming for now. But the cleanup is
definitly not finished :-/

include/simgrid/platf.h
src/bindings/lua/lua_console.c
src/include/surf/surf.h
src/instr/instr_routing.c
src/surf/network.c
src/surf/network_im.c
src/surf/surf_routing.c
src/surf/surfxml_parse.c
src/surf/workstation_ptask_L07.c

index 3837ac9..c9c0ede 100644 (file)
@@ -19,6 +19,11 @@ typedef enum {
   SURF_RESOURCE_OFF = 0                   /**< Down & broken     */
 } e_surf_resource_state_t;
 
   SURF_RESOURCE_OFF = 0                   /**< Down & broken     */
 } e_surf_resource_state_t;
 
+typedef enum {
+  SURF_LINK_FULLDUPLEX = 2,
+  SURF_LINK_SHARED = 1,
+  SURF_LINK_FATPIPE = 0
+} e_surf_link_sharing_policy_t;
 
 /*
  * Platform creation functions. Instead of passing 123 arguments to the creation functions
 
 /*
  * Platform creation functions. Instead of passing 123 arguments to the creation functions
@@ -48,15 +53,14 @@ typedef struct {
 } s_sg_platf_router_cbarg_t, *sg_platf_router_cbarg_t;
 
 typedef struct {
 } s_sg_platf_router_cbarg_t, *sg_platf_router_cbarg_t;
 
 typedef struct {
-  const char* V_link_id;
-  double V_link_bandwidth;
-  tmgr_trace_t V_link_bandwidth_file;
-  double V_link_latency;
-  tmgr_trace_t V_link_latency_file;
-  e_surf_resource_state_t V_link_state;
-  tmgr_trace_t V_link_state_file;
-  int V_link_sharing_policy;
-  int V_policy_initial_link;
+  const char* id;
+  double bandwidth;
+  tmgr_trace_t bandwidth_trace;
+  double latency;
+  tmgr_trace_t latency_trace;
+  e_surf_resource_state_t state;
+  tmgr_trace_t state_trace;
+  e_surf_link_sharing_policy_t policy;
   xbt_dict_t properties;
 } s_sg_platf_link_cbarg_t, *sg_platf_link_cbarg_t;
 
   xbt_dict_t properties;
 } s_sg_platf_link_cbarg_t, *sg_platf_link_cbarg_t;
 
index c62713f..c6f01ae 100644 (file)
@@ -104,19 +104,19 @@ int  console_add_link(lua_State *L) {
   // get Id Value
   lua_pushstring(L, "id");
   lua_gettable(L, -2);
   // get Id Value
   lua_pushstring(L, "id");
   lua_gettable(L, -2);
-  link.V_link_id = lua_tostring(L, -1);
+  link.id = lua_tostring(L, -1);
   lua_pop(L, 1);
 
   // get bandwidth value
   lua_pushstring(L, "bandwidth");
   lua_gettable(L, -2);
   lua_pop(L, 1);
 
   // get bandwidth value
   lua_pushstring(L, "bandwidth");
   lua_gettable(L, -2);
-  link.V_link_bandwidth = lua_tonumber(L, -1);
+  link.bandwidth = lua_tonumber(L, -1);
   lua_pop(L, 1);
 
   //get latency value
   lua_pushstring(L, "latency");
   lua_gettable(L, -2);
   lua_pop(L, 1);
 
   //get latency value
   lua_pushstring(L, "latency");
   lua_gettable(L, -2);
-  link.V_link_latency = lua_tonumber(L, -1);
+  link.latency = lua_tonumber(L, -1);
   lua_pop(L, 1);
 
   /*Optional Arguments  */
   lua_pop(L, 1);
 
   /*Optional Arguments  */
@@ -124,28 +124,28 @@ int  console_add_link(lua_State *L) {
   //get bandwidth_trace value
   lua_pushstring(L, "bandwidth_trace");
   lua_gettable(L, -2);
   //get bandwidth_trace value
   lua_pushstring(L, "bandwidth_trace");
   lua_gettable(L, -2);
-  link.V_link_bandwidth_file = tmgr_trace_new(lua_tostring(L, -1));
+  link.bandwidth_trace = tmgr_trace_new(lua_tostring(L, -1));
   lua_pop(L, 1);
 
   //get latency_trace value
   lua_pushstring(L, "latency_trace");
   lua_gettable(L, -2);
   lua_pop(L, 1);
 
   //get latency_trace value
   lua_pushstring(L, "latency_trace");
   lua_gettable(L, -2);
-  link.V_link_latency_file = tmgr_trace_new(lua_tostring(L, -1));
+  link.latency_trace = tmgr_trace_new(lua_tostring(L, -1));
   lua_pop(L, 1);
 
   //get state_trace value
   lua_pushstring(L, "state_trace");
   lua_gettable(L, -2);
   lua_pop(L, 1);
 
   //get state_trace value
   lua_pushstring(L, "state_trace");
   lua_gettable(L, -2);
-  link.V_link_state_file = tmgr_trace_new(lua_tostring(L, -1));
+  link.state_trace = tmgr_trace_new(lua_tostring(L, -1));
   lua_pop(L, 1);
 
   //get state_initial value
   lua_pushstring(L, "state_initial");
   lua_gettable(L, -2);
   if (lua_tonumber(L, -1))
   lua_pop(L, 1);
 
   //get state_initial value
   lua_pushstring(L, "state_initial");
   lua_gettable(L, -2);
   if (lua_tonumber(L, -1))
-    link.V_link_state = SURF_RESOURCE_ON;
+    link.state = SURF_RESOURCE_ON;
   else
   else
-    link.V_link_state = SURF_RESOURCE_OFF;
+    link.state = SURF_RESOURCE_OFF;
   lua_pop(L, 1);
 
   //get policy value
   lua_pop(L, 1);
 
   //get policy value
@@ -154,11 +154,11 @@ int  console_add_link(lua_State *L) {
   policy = lua_tostring(L, -1);
   lua_pop(L, 1);
   if (policy && !strcmp(policy,"FULLDUPLEX")) {
   policy = lua_tostring(L, -1);
   lua_pop(L, 1);
   if (policy && !strcmp(policy,"FULLDUPLEX")) {
-    link.V_link_sharing_policy = SURF_LINK_FULLDUPLEX;
+    link.policy = SURF_LINK_FULLDUPLEX;
   } else if (policy && !strcmp(policy,"FATPIPE")) {
   } else if (policy && !strcmp(policy,"FATPIPE")) {
-    link.V_link_sharing_policy = SURF_LINK_FATPIPE;
+    link.policy = SURF_LINK_FATPIPE;
   } else {
   } else {
-    link.V_link_sharing_policy = SURF_LINK_SHARED;
+    link.policy = SURF_LINK_SHARED;
   }
 
   sg_platf_new_link(&link);
   }
 
   sg_platf_new_link(&link);
index a0ed25c..cafb3d3 100644 (file)
 SG_BEGIN_DECL()
 /* Actions and models are highly connected structures... */
 
 SG_BEGIN_DECL()
 /* Actions and models are highly connected structures... */
 
-typedef enum {
-  SURF_LINK_FULLDUPLEX = 2,
-  SURF_LINK_SHARED = 1,
-  SURF_LINK_FATPIPE = 0
-} e_surf_link_sharing_policy_t;
-
 typedef enum {
   SURF_NETWORK_ELEMENT_NULL = 0,        /* NULL */
   SURF_NETWORK_ELEMENT_HOST,    /* host type */
 typedef enum {
   SURF_NETWORK_ELEMENT_NULL = 0,        /* NULL */
   SURF_NETWORK_ELEMENT_HOST,    /* host type */
index 1eed752..765dcea 100644 (file)
@@ -190,19 +190,19 @@ static void instr_routing_parse_start_link (sg_platf_link_cbarg_t link)
 {
   container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
 
 {
   container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
 
-  double bandwidth_value = link->V_link_bandwidth;
-  double latency_value = link->V_link_latency;
+  double bandwidth_value = link->bandwidth;
+  double latency_value = link->latency;
   xbt_dynar_t links_to_create = xbt_dynar_new (sizeof(char*), &xbt_free_ref);
 
   xbt_dynar_t links_to_create = xbt_dynar_new (sizeof(char*), &xbt_free_ref);
 
-  if (link->V_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX){
-    char *up = bprintf("%s_UP", link->V_link_id);
-    char *down = bprintf("%s_DOWN", link->V_link_id);
+  if (link->policy == SURF_LINK_FULLDUPLEX){
+    char *up = bprintf("%s_UP", link->id);
+    char *down = bprintf("%s_DOWN", 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*, 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(link->V_link_id));
+    xbt_dynar_push_as (links_to_create, char*, strdup(link->id));
   }
 
   char *link_name = NULL;
   }
 
   char *link_name = NULL;
index e42e22a..65c2fe4 100644 (file)
@@ -196,20 +196,20 @@ static void net_parse_link_init(sg_platf_link_cbarg_t link)
 {
   XBT_DEBUG("link_CM02");
 
 {
   XBT_DEBUG("link_CM02");
 
-  if(link->V_policy_initial_link == SURF_LINK_FULLDUPLEX)
+  if(link->policy == SURF_LINK_FULLDUPLEX)
   {
   {
-    net_create_resource(bprintf("%s_UP",link->V_link_id), link->V_link_bandwidth, link->V_link_bandwidth_file,
-                      link->V_link_latency, link->V_link_latency_file, link->V_link_state, link->V_link_state_file,
-                      link->V_policy_initial_link, link->properties);
-    net_create_resource(bprintf("%s_DOWN",link->V_link_id), link->V_link_bandwidth, link->V_link_bandwidth_file,
-            link->V_link_latency, link->V_link_latency_file, link->V_link_state, link->V_link_state_file,
-            link->V_policy_initial_link, NULL); // FIXME: We need to deep copy the properties or we won't be able to free it
+    net_create_resource(bprintf("%s_UP",link->id), link->bandwidth, link->bandwidth_trace,
+                      link->latency, link->latency_trace, link->state, link->state_trace,
+                      link->policy, link->properties);
+    net_create_resource(bprintf("%s_DOWN",link->id), link->bandwidth, link->bandwidth_trace,
+            link->latency, link->latency_trace, link->state, link->state_trace,
+            link->policy, NULL); // FIXME: We need to deep copy the properties or we won't be able to free it
   }
   else
   {
   }
   else
   {
-    net_create_resource(xbt_strdup(link->V_link_id), link->V_link_bandwidth, link->V_link_bandwidth_file,
-               link->V_link_latency, link->V_link_latency_file, link->V_link_state, link->V_link_state_file,
-                      link->V_policy_initial_link, link->properties);
+    net_create_resource(xbt_strdup(link->id), link->bandwidth, link->bandwidth_trace,
+               link->latency, link->latency_trace, link->state, link->state_trace,
+                      link->policy, link->properties);
   }
 
 }
   }
 
 }
index f53574a..bc94690 100644 (file)
@@ -190,20 +190,20 @@ static void* im_net_create_resource(const char *name,
 
 static void im_net_parse_link_init(sg_platf_link_cbarg_t link)
 {
 
 static void im_net_parse_link_init(sg_platf_link_cbarg_t link)
 {
-  if(link->V_policy_initial_link == SURF_LINK_FULLDUPLEX)
+  if(link->policy == SURF_LINK_FULLDUPLEX)
   {
   {
-         im_net_create_resource(bprintf("%s_UP",link->V_link_id), link->V_link_bandwidth, link->V_link_bandwidth_file,
-                      link->V_link_latency, link->V_link_latency_file, link->V_link_state, link->V_link_state_file,
-                      link->V_policy_initial_link, link->properties);
-         im_net_create_resource(bprintf("%s_DOWN",link->V_link_id), link->V_link_bandwidth, link->V_link_bandwidth_file,
-            link->V_link_latency, link->V_link_latency_file, link->V_link_state, link->V_link_state_file,
-            link->V_policy_initial_link, NULL); // FIXME: We need to deep copy the properties or we won't be able to free it
+         im_net_create_resource(bprintf("%s_UP",link->id), link->bandwidth, link->bandwidth_trace,
+                      link->latency, link->latency_trace, link->state, link->state_trace,
+                      link->policy, link->properties);
+         im_net_create_resource(bprintf("%s_DOWN",link->id), link->bandwidth, link->bandwidth_trace,
+            link->latency, link->latency_trace, link->state, link->state_trace,
+            link->policy, NULL); // FIXME: We need to deep copy the properties or we won't be able to free it
   }
   else
   {
   }
   else
   {
-         im_net_create_resource(xbt_strdup(link->V_link_id), link->V_link_bandwidth, link->V_link_bandwidth_file,
-               link->V_link_latency, link->V_link_latency_file, link->V_link_state, link->V_link_state_file,
-                      link->V_policy_initial_link, link->properties);
+         im_net_create_resource(xbt_strdup(link->id), link->bandwidth, link->bandwidth_trace,
+               link->latency, link->latency_trace, link->state, link->state_trace,
+                      link->policy, link->properties);
   }
 }
 
   }
 }
 
index 24f8467..6e62f79 100644 (file)
@@ -1467,24 +1467,20 @@ void routing_parse_Scluster(void)
                XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id,struct_cluster->S_cluster_bw, struct_cluster->S_cluster_lat);
 
                memset(&link,0,sizeof(link));
                XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id,struct_cluster->S_cluster_bw, struct_cluster->S_cluster_lat);
 
                memset(&link,0,sizeof(link));
-               link.V_link_id = link_id;
-               link.V_link_bandwidth = struct_cluster->S_cluster_bw;
-               link.V_link_latency = struct_cluster->S_cluster_lat;
-               link.V_link_bandwidth_file = NULL;
-               link.V_link_latency_file = NULL;
-               link.V_link_state_file = NULL;
-               link.V_link_state = SURF_RESOURCE_ON;
-               link.V_link_sharing_policy = A_surfxml_link_sharing_policy;
+               link.id = link_id;
+               link.bandwidth = struct_cluster->S_cluster_bw;
+               link.latency = struct_cluster->S_cluster_lat;
+               link.state = SURF_RESOURCE_ON;
 
                switch (A_surfxml_link_sharing_policy) {
                case A_surfxml_link_sharing_policy_SHARED:
 
                switch (A_surfxml_link_sharing_policy) {
                case A_surfxml_link_sharing_policy_SHARED:
-                       link.V_policy_initial_link = SURF_LINK_SHARED;
+                       link.policy = SURF_LINK_SHARED;
                        break;
                case A_surfxml_link_sharing_policy_FATPIPE:
                        break;
                case A_surfxml_link_sharing_policy_FATPIPE:
-                 link.V_policy_initial_link = SURF_LINK_FATPIPE;
+                 link.policy = SURF_LINK_FATPIPE;
                  break;
                case A_surfxml_link_sharing_policy_FULLDUPLEX:
                  break;
                case A_surfxml_link_sharing_policy_FULLDUPLEX:
-                 link.V_policy_initial_link = SURF_LINK_FULLDUPLEX;
+                 link.policy = SURF_LINK_FULLDUPLEX;
                  break;
                case AU_surfxml_link_sharing_policy:
                  surf_parse_error(bprintf("Invalid sharing policy in cluster %s (please report this bug, this shouldn't happen)",struct_cluster->V_cluster_id));
                  break;
                case AU_surfxml_link_sharing_policy:
                  surf_parse_error(bprintf("Invalid sharing policy in cluster %s (please report this bug, this shouldn't happen)",struct_cluster->V_cluster_id));
@@ -1564,23 +1560,20 @@ void routing_parse_Scluster(void)
                XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id,struct_cluster->S_cluster_bw, struct_cluster->S_cluster_lat);
 
                memset(&link,0,sizeof(link));
                XBT_DEBUG("<link\tid=\"%s\"\tbw=\"%f\"\tlat=\"%f\"/>", link_id,struct_cluster->S_cluster_bw, struct_cluster->S_cluster_lat);
 
                memset(&link,0,sizeof(link));
-               link.V_link_id = link_id;
-               link.V_link_bandwidth = struct_cluster->S_cluster_bw;
-               link.V_link_latency = struct_cluster->S_cluster_lat;
-               link.V_link_bandwidth_file = NULL;
-               link.V_link_latency_file = NULL;
-               link.V_link_state_file = NULL;
-               link.V_link_state = SURF_RESOURCE_ON;
-               link.V_link_sharing_policy = A_surfxml_link_sharing_policy;
+               link.id = link_id;
+               link.bandwidth = struct_cluster->S_cluster_bw;
+               link.latency = struct_cluster->S_cluster_lat;
+               link.state = SURF_RESOURCE_ON;
 
 
+               /* FIXME: use a switch here */
                if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_SHARED)
                if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_SHARED)
-                       link.V_policy_initial_link = SURF_LINK_SHARED;
+                       link.policy = SURF_LINK_SHARED;
                else
                {
                 if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FATPIPE)
                else
                {
                 if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FATPIPE)
-                        link.V_policy_initial_link = SURF_LINK_FATPIPE;
+                        link.policy = SURF_LINK_FATPIPE;
                 else if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX)
                 else if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX)
-                        link.V_policy_initial_link = SURF_LINK_FULLDUPLEX;
+                        link.policy = SURF_LINK_FULLDUPLEX;
                }
                sg_platf_new_link(&link);
 
                }
                sg_platf_new_link(&link);
 
@@ -1633,19 +1626,16 @@ void routing_parse_Scluster(void)
          {A_surfxml_link_sharing_policy =  A_surfxml_link_sharing_policy_FATPIPE;}
 
          memset(&link,0,sizeof(link));
          {A_surfxml_link_sharing_policy =  A_surfxml_link_sharing_policy_FATPIPE;}
 
          memset(&link,0,sizeof(link));
-         link.V_link_id = link_backbone;
-         link.V_link_bandwidth = struct_cluster->S_cluster_bb_bw;
-         link.V_link_latency = struct_cluster->S_cluster_bb_lat;
-         link.V_link_bandwidth_file = NULL;
-         link.V_link_latency_file = NULL;
-         link.V_link_state_file = NULL;
-         link.V_link_state = SURF_RESOURCE_ON;
-         link.V_link_sharing_policy = A_surfxml_link_sharing_policy;
+         link.id = link_backbone;
+         link.bandwidth = struct_cluster->S_cluster_bb_bw;
+         link.latency = struct_cluster->S_cluster_bb_lat;
+         link.state = SURF_RESOURCE_ON;
 
 
+         /* FIXME: use a switch, and deal with FULLDUPLEX here */
          if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_SHARED)
          if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_SHARED)
-                 link.V_policy_initial_link = SURF_LINK_SHARED;
+                 link.policy = SURF_LINK_SHARED;
          else
          else
-                 link.V_policy_initial_link = SURF_LINK_FATPIPE;
+                 link.policy = SURF_LINK_FATPIPE;
 
          sg_platf_new_link(&link);
          ETag_surfxml_link();
 
          sg_platf_new_link(&link);
          ETag_surfxml_link();
index 48cbb04..d9a9206 100644 (file)
@@ -377,28 +377,29 @@ void STag_surfxml_link(void){
   xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
   link.properties = current_property_set = xbt_dict_new();
 
   xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)");
   link.properties = current_property_set = xbt_dict_new();
 
-       link.V_link_id = A_surfxml_link_id;
-       link.V_link_bandwidth = surf_parse_get_double(A_surfxml_link_bandwidth);
-       link.V_link_bandwidth_file = tmgr_trace_new(A_surfxml_link_bandwidth_file);
-       link.V_link_latency = surf_parse_get_double(A_surfxml_link_latency);
-       link.V_link_latency_file = tmgr_trace_new(A_surfxml_link_latency_file);
+       link.id = A_surfxml_link_id;
+       link.bandwidth = surf_parse_get_double(A_surfxml_link_bandwidth);
+       link.bandwidth_trace = tmgr_trace_new(A_surfxml_link_bandwidth_file);
+       link.latency = surf_parse_get_double(A_surfxml_link_latency);
+       link.latency_trace = tmgr_trace_new(A_surfxml_link_latency_file);
+       /* FIXME: use a switch here */
        xbt_assert((A_surfxml_link_state == A_surfxml_link_state_ON) ||
                          (A_surfxml_link_state == A_surfxml_link_state_OFF), "Invalid state");
        if (A_surfxml_link_state == A_surfxml_link_state_ON)
        xbt_assert((A_surfxml_link_state == A_surfxml_link_state_ON) ||
                          (A_surfxml_link_state == A_surfxml_link_state_OFF), "Invalid state");
        if (A_surfxml_link_state == A_surfxml_link_state_ON)
-               link.V_link_state = SURF_RESOURCE_ON;
+               link.state = SURF_RESOURCE_ON;
        if (A_surfxml_link_state == A_surfxml_link_state_OFF)
        if (A_surfxml_link_state == A_surfxml_link_state_OFF)
-               link.V_link_state = SURF_RESOURCE_OFF;
-       link.V_link_state_file = tmgr_trace_new(A_surfxml_link_state_file);
-       link.V_link_sharing_policy = A_surfxml_link_sharing_policy;
+               link.state = SURF_RESOURCE_OFF;
+       link.state_trace = tmgr_trace_new(A_surfxml_link_state_file);
 
 
+       /* FIXME: use a switch here */
        if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_SHARED)
        if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_SHARED)
-               link.V_policy_initial_link = SURF_LINK_SHARED;
+               link.policy = SURF_LINK_SHARED;
        else
        {
         if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FATPIPE)
        else
        {
         if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FATPIPE)
-                link.V_policy_initial_link = SURF_LINK_FATPIPE;
+                link.policy = SURF_LINK_FATPIPE;
         else if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX)
         else if (A_surfxml_link_sharing_policy == A_surfxml_link_sharing_policy_FULLDUPLEX)
-                link.V_policy_initial_link = SURF_LINK_FULLDUPLEX;
+                link.policy = SURF_LINK_FULLDUPLEX;
        }
 
        sg_platf_new_link(&link);
        }
 
        sg_platf_new_link(&link);
index cf5ca30..ee32783 100644 (file)
@@ -712,20 +712,20 @@ static void* ptask_link_create_resource(const char *name,
 
 static void ptask_parse_link_init(sg_platf_link_cbarg_t link)
 {
 
 static void ptask_parse_link_init(sg_platf_link_cbarg_t link)
 {
-  if(link->V_policy_initial_link == SURF_LINK_FULLDUPLEX)
+  if(link->policy == SURF_LINK_FULLDUPLEX)
   {
   {
-         ptask_link_create_resource(bprintf("%s_UP",link->V_link_id), link->V_link_bandwidth, link->V_link_bandwidth_file,
-                      link->V_link_latency, link->V_link_latency_file, link->V_link_state, link->V_link_state_file,
-                      link->V_policy_initial_link, link->properties);
-    ptask_link_create_resource(bprintf("%s_DOWN",link->V_link_id), link->V_link_bandwidth, link->V_link_bandwidth_file,
-            link->V_link_latency, link->V_link_latency_file, link->V_link_state, link->V_link_state_file,
-            link->V_policy_initial_link, NULL); // FIXME: We need to deep copy the properties or we won't be able to free it
+         ptask_link_create_resource(bprintf("%s_UP",link->id), link->bandwidth, link->bandwidth_trace,
+                      link->latency, link->latency_trace, link->state, link->state_trace,
+                      link->policy, link->properties);
+    ptask_link_create_resource(bprintf("%s_DOWN",link->id), link->bandwidth, link->bandwidth_trace,
+            link->latency, link->latency_trace, link->state, link->state_trace,
+            link->policy, NULL); // FIXME: We need to deep copy the properties or we won't be able to free it
   }
   else
   {
   }
   else
   {
-         ptask_link_create_resource(xbt_strdup(link->V_link_id), link->V_link_bandwidth, link->V_link_bandwidth_file,
-               link->V_link_latency, link->V_link_latency_file, link->V_link_state, link->V_link_state_file,
-                      link->V_policy_initial_link, link->properties);
+         ptask_link_create_resource(xbt_strdup(link->id), link->bandwidth, link->bandwidth_trace,
+               link->latency, link->latency_trace, link->state, link->state_trace,
+                      link->policy, link->properties);
   }
 
   current_property_set = NULL;
   }
 
   current_property_set = NULL;