Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge simgrid::Host into simgrid::s4u::Host
[simgrid.git] / src / surf / surf_routing.cpp
index a64fd47..71d2e46 100644 (file)
@@ -23,8 +23,8 @@
 namespace simgrid {
 namespace surf {
 
-simgrid::surf::signal<void(simgrid::surf::NetCard*)> routingEdgeCreatedCallbacks;
-simgrid::surf::signal<void(simgrid::surf::As*)> asCreatedCallbacks;
+simgrid::xbt::signal<void(simgrid::surf::NetCard*)> routingEdgeCreatedCallbacks;
+simgrid::xbt::signal<void(simgrid::surf::As*)> asCreatedCallbacks;
 
 }
 }
@@ -59,7 +59,7 @@ static xbt_dict_t random_value = NULL;
 simgrid::surf::NetCard *sg_netcard_by_name_or_null(const char *name)
 {
   sg_host_t h = sg_host_by_name(name);
-  simgrid::surf::NetCard *net_elm = h==NULL?NULL: h->p_netcard;
+  simgrid::surf::NetCard *net_elm = h==NULL?NULL: h->pimpl_netcard;
   if (!net_elm)
        net_elm = (simgrid::surf::NetCard*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
   return net_elm;
@@ -127,7 +127,7 @@ struct s_model_type routing_models[] = {
  */
 void sg_platf_new_netcard(sg_platf_host_link_cbarg_t netcard)
 {
-  simgrid::surf::NetCard *info = sg_host_by_name(netcard->id)->p_netcard;
+  simgrid::surf::NetCard *info = sg_host_by_name(netcard->id)->pimpl_netcard;
   xbt_assert(info, "Host '%s' not found!", netcard->id);
   xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER] ||
       current_routing->p_modelDesc == &routing_models[SURF_MODEL_VIVALDI],
@@ -170,7 +170,7 @@ simgrid::surf::NetCard *routing_add_host(
                                                    current_routing);
   netcard->setId(current_routing->parsePU(netcard));
   sg_host_t h = sg_host_by_name_or_create(host->id);
-  h->p_netcard = netcard;
+  h->pimpl_netcard = netcard;
   XBT_DEBUG("Having set name '%s' id '%d'", host->id, netcard->getId());
   simgrid::surf::routingEdgeCreatedCallbacks(netcard);
 
@@ -201,17 +201,6 @@ simgrid::surf::NetCard *routing_add_host(
   return netcard;
 }
 
-/**
- * \brief Store the ASroute by calling the set_ASroute function of the current routing component
- */
-static void parse_E_ASroute(sg_platf_route_cbarg_t ASroute)
-{
-  /*FIXME:REMOVE:xbt_assert(current_routing->parse_ASroute,
-             "no defined method \"set_ASroute\" in \"%s\"",
-             current_routing->name);*/
-  current_routing->parseASroute(ASroute);
-}
-
 void sg_platf_new_trace(sg_platf_trace_cbarg_t trace)
 {
   tmgr_trace_t tmgr_trace;
@@ -708,14 +697,14 @@ void sg_platf_new_cabinet(sg_platf_cabinet_cbarg_t cabinet)
     }
     s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
     memset(&host, 0, sizeof(host));
-    host.initial_state = SURF_RESOURCE_ON;
+    host.initiallyOn   = 1;
     host.pstate        = 0;
     host.speed_scale   = 1.0;
     host.core_amount   = 1;
 
     s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
     memset(&link, 0, sizeof(link));
-    link.state     = SURF_RESOURCE_ON;
+    link.initiallyOn = 1;
     link.policy    = SURF_LINK_FULLDUPLEX;
     link.latency   = cabinet->lat;
     link.bandwidth = cabinet->bw;
@@ -881,7 +870,7 @@ void routing_new_cluster(sg_platf_cluster_cbarg_t cluster)
       //host.power_peak = cluster->power;
       host.speed_scale = 1.0;
       host.core_amount = cluster->core_amount;
-      host.initial_state = SURF_RESOURCE_ON;
+      host.initiallyOn = 1;
       host.coord = "";
       sg_platf_new_host(&host);
       xbt_dynar_free(&host.speed_peak);
@@ -910,7 +899,7 @@ void routing_new_cluster(sg_platf_cluster_cbarg_t cluster)
         link.id        = tmp_link;
         link.bandwidth = cluster->loopback_bw;
         link.latency   = cluster->loopback_lat;
-        link.state     = SURF_RESOURCE_ON;
+        link.initiallyOn = 1;
         link.policy    = SURF_LINK_FATPIPE;
         sg_platf_new_link(&link);
         info_loop.link_up   = Link::byName(tmp_link);
@@ -931,7 +920,7 @@ void routing_new_cluster(sg_platf_cluster_cbarg_t cluster)
         link.id = tmp_link;
         link.bandwidth = cluster->limiter_link;
         link.latency = 0;
-        link.state = SURF_RESOURCE_ON;
+        link.initiallyOn = 1;
         link.policy = SURF_LINK_SHARED;
         sg_platf_new_link(&link);
         info_lim.link_up = Link::byName(tmp_link);
@@ -995,7 +984,7 @@ void routing_new_cluster(sg_platf_cluster_cbarg_t cluster)
     link.id        = link_backbone;
     link.bandwidth = cluster->bb_bw;
     link.latency   = cluster->bb_lat;
-    link.state     = SURF_RESOURCE_ON;
+    link.initiallyOn = 1;
     link.policy    = cluster->bb_sharing_policy;
 
     sg_platf_new_link(&link);
@@ -1040,7 +1029,7 @@ void sg_platf_new_peer(sg_platf_peer_cbarg_t peer)
   XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\"/>", host_id, peer->speed);
   s_sg_platf_host_cbarg_t host = SG_PLATF_HOST_INITIALIZER;
   memset(&host, 0, sizeof(host));
-  host.initial_state = SURF_RESOURCE_ON;
+  host.initiallyOn = 1;
   host.id = host_id;
 
   host.speed_peak = xbt_dynar_new(sizeof(double), NULL);
@@ -1056,7 +1045,7 @@ void sg_platf_new_peer(sg_platf_peer_cbarg_t peer)
 
   s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
   memset(&link, 0, sizeof(link));
-  link.state   = SURF_RESOURCE_ON;
+  link.initiallyOn = 1;
   link.policy  = SURF_LINK_SHARED;
   link.latency = peer->lat;
 
@@ -1337,7 +1326,7 @@ xbt_dynar_t surf_AS_get_hosts(simgrid::surf::As *as)
   for (int index = 0; index < count; index++) {
      sg_netcard_t relm =
       xbt_dynar_get_as(elms, index, simgrid::surf::NetCard*);
-     sg_host_t delm = simgrid::Host::by_name_or_null(relm->getName());
+     sg_host_t delm = simgrid::s4u::Host::by_name_or_null(relm->getName());
      if (delm!=NULL) {
        xbt_dynar_push(res, &delm);
      }