XBT_PUBLIC(int) platf_graph_is_connected(void);
+XBT_PUBLIC(void) platf_graph_clear_links(void);
+
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);
return TRUE;
}
+void platf_graph_clear_links(void) {
+ xbt_dynar_t dynar_nodes = NULL;
+ xbt_dynar_t dynar_edges = NULL;
+ xbt_node_t graph_node = NULL;
+ xbt_edge_t graph_edge = NULL;
+ context_node_t node_data = NULL;
+ unsigned int i;
+
+ //Delete edges from the graph
+ dynar_edges = xbt_graph_get_edges(platform_graph);
+ xbt_dynar_foreach(dynar_edges, i, graph_edge) {
+ xbt_graph_free_edge(platform_graph, graph_edge, xbt_free);
+ }
+
+ //All the nodes will be of degree 0
+ dynar_nodes = xbt_graph_get_nodes(platform_graph);
+ xbt_dynar_foreach(dynar_nodes, i, graph_node) {
+ node_data = xbt_graph_node_get_data(graph_node);
+ node_data->degree = 0;
+ }
+}
+
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));