Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
untangle resource::state (ON/OFF) and VM::state (STARTED/MIGRATING/etc)
[simgrid.git] / src / surf / surf_routing_cluster_torus.cpp
index 13369b4..ccbd304 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014. The SimGrid Team.
+/* Copyright (c) 2014-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -25,9 +25,12 @@ inline unsigned int* rankId_to_coords(int rankId, xbt_dynar_t dimensions) {
 
 AS_t model_torus_cluster_create(void)
 {
-  return new AsClusterTorus();
+  return new simgrid::surf::AsClusterTorus();
 }
 
+namespace simgrid {
+namespace surf {
+
 /* Creation routing model functions */
 AsClusterTorus::AsClusterTorus() : AsCluster()
 {
@@ -59,12 +62,12 @@ void AsClusterTorus::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int
       memset(&link, 0, sizeof(link));
       current_dimension = xbt_dynar_get_as(p_dimensions, j, int);
       neighbour_rank_id = ( ((int) rank / dim_product) % current_dimension == current_dimension-1) ? rank - (current_dimension-1)*dim_product : rank + dim_product;
-      //name of neighbour is not right for non contiguous cluster radicals (as id != rank in this case)
+      //name of neighbor is not right for non contiguous cluster radicals (as id != rank in this case)
       link_id           = bprintf("%s_link_from_%i_to_%i", cluster->id, id, neighbour_rank_id);
       link.id           = link_id;
       link.bandwidth    = cluster->bw;
       link.latency      = cluster->lat;
-      link.state        = SURF_RESOURCE_ON;
+      link.initiallyOn  = 1;
       link.policy       = cluster->sharing_policy;
       sg_platf_new_link(&link);
       s_surf_parsing_link_up_down_t info;
@@ -118,7 +121,7 @@ void AsClusterTorus::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster){
     xbt_dynar_free(&dimensions);
 }
 
-void AsClusterTorus::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat){
+void AsClusterTorus::getRouteAndLatency(NetCard *src, NetCard *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(),
@@ -237,3 +240,6 @@ void AsClusterTorus::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_p
 
   return;
 }
+
+}
+}