Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
platform generation : modify some interfaces
authorJean-Baptiste Hervé <jean-baptiste.herve@esial.net>
Tue, 31 Jul 2012 11:33:47 +0000 (13:33 +0200)
committerJean-Baptiste Hervé <jean-baptiste.herve@esial.net>
Tue, 31 Jul 2012 11:33:47 +0000 (13:33 +0200)
include/simgrid/platf_generator.h
src/surf/platf_generator.c
src/surf/platf_generator_private.h

index f9ae7e9..968ac6d 100644 (file)
@@ -19,6 +19,9 @@ typedef enum {
   CLUSTER
 } e_platf_node_kind;
 
   CLUSTER
 } e_platf_node_kind;
 
+typedef struct s_context_node_t *context_node_t;
+typedef struct s_context_edge_t *context_edge_t;
+
 XBT_PUBLIC(void) platf_random_seed(unsigned long seed[6]);
 
 XBT_PUBLIC(void) platf_graph_uniform(unsigned long node_count);
 XBT_PUBLIC(void) platf_random_seed(unsigned long seed[6]);
 
 XBT_PUBLIC(void) platf_graph_uniform(unsigned long node_count);
@@ -31,13 +34,14 @@ XBT_PUBLIC(void) platf_graph_interconnect_clique(void);
 XBT_PUBLIC(void) platf_graph_interconnect_uniform(double alpha);
 XBT_PUBLIC(void) platf_graph_interconnect_exponential(double alpha);
 
 XBT_PUBLIC(void) platf_graph_interconnect_uniform(double alpha);
 XBT_PUBLIC(void) platf_graph_interconnect_exponential(double alpha);
 
-XBT_PUBLIC(void) platf_graph_promote_to_host(xbt_node_t node, sg_platf_host_cbarg_t parameters);
-XBT_PUBLIC(void) platf_graph_promote_to_cluster(xbt_node_t node, sg_platf_cluster_cbarg_t parameters);
+XBT_PUBLIC(void) platf_graph_promote_to_host(context_node_t node, sg_platf_host_cbarg_t parameters);
+XBT_PUBLIC(void) platf_graph_promote_to_cluster(context_node_t node, sg_platf_cluster_cbarg_t parameters);
 
 
-XBT_PUBLIC(void) platf_graph_link_label(xbt_edge_t edge, sg_platf_link_cbarg_t parameters);
+XBT_PUBLIC(void) platf_graph_link_label(context_edge_t edge, sg_platf_link_cbarg_t parameters);
 
 // WARNING : Only for debbugging ; should be removed when platform
 // generation works correctly
 XBT_PUBLIC(xbt_graph_t) platf_graph_get(void);
 
 #endif              /* SG_PLATF_GEN_H */
 
 // WARNING : Only for debbugging ; should be removed when platform
 // generation works correctly
 XBT_PUBLIC(xbt_graph_t) platf_graph_get(void);
 
 #endif              /* SG_PLATF_GEN_H */
+
index bcbe34c..d6e9f64 100644 (file)
@@ -221,21 +221,18 @@ void platf_graph_interconnect_exponential(double alpha) {
   }
 }
 
   }
 }
 
-void platf_graph_promote_to_host(xbt_node_t node, sg_platf_host_cbarg_t parameters) {
-  context_node_t node_data = (context_node_t) xbt_graph_node_get_data(node);
-  node_data->kind = HOST;
-  memcpy(&(node_data->host_parameters), parameters, sizeof(s_sg_platf_host_cbarg_t));
+void platf_graph_promote_to_host(context_node_t node, sg_platf_host_cbarg_t parameters) {
+  node->kind = HOST;
+  memcpy(&(node->host_parameters), parameters, sizeof(s_sg_platf_host_cbarg_t));
 }
 
 }
 
-void platf_graph_promote_to_cluster(xbt_node_t node, sg_platf_cluster_cbarg_t parameters) {
-  context_node_t node_data = (context_node_t) xbt_graph_node_get_data(node);
-  node_data->kind = CLUSTER;
-  memcpy(&(node_data->cluster_parameters), parameters, sizeof(s_sg_platf_cluster_cbarg_t));
+void platf_graph_promote_to_cluster(context_node_t node, sg_platf_cluster_cbarg_t parameters) {
+  node->kind = CLUSTER;
+  memcpy(&(node->cluster_parameters), parameters, sizeof(s_sg_platf_cluster_cbarg_t));
 }
 
 }
 
-void platf_graph_link_label(xbt_edge_t edge, sg_platf_link_cbarg_t parameters) {
-  context_edge_t edge_data = (context_edge_t) xbt_graph_edge_get_data(edge);
-  memcpy(&(edge_data->link_parameters), parameters, sizeof(s_sg_platf_link_cbarg_t));
+void platf_graph_link_label(context_edge_t edge, sg_platf_link_cbarg_t parameters) {
+  memcpy(&(edge->link_parameters), parameters, sizeof(s_sg_platf_link_cbarg_t));
 }
 
 /* Functions used to generate interesting random values */
 }
 
 /* Functions used to generate interesting random values */
index 4005834..bdec97e 100644 (file)
@@ -13,12 +13,12 @@ typedef struct s_context_node_t {
     s_sg_platf_host_cbarg_t host_parameters;
     s_sg_platf_cluster_cbarg_t cluster_parameters;
   };
     s_sg_platf_host_cbarg_t host_parameters;
     s_sg_platf_cluster_cbarg_t cluster_parameters;
   };
-} s_context_node_t, *context_node_t;
+} s_context_node_t;
 
 typedef struct s_context_edge_t {
   unsigned long id;
   s_sg_platf_link_cbarg_t link_parameters;
 
 typedef struct s_context_edge_t {
   unsigned long id;
   s_sg_platf_link_cbarg_t link_parameters;
-} s_context_edge_t, *context_edge_t;
+} s_context_edge_t;
 
 void platf_graph_init(unsigned long node_count);
 
 
 void platf_graph_init(unsigned long node_count);