Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename the class objects and C types for the As -> NetZone transition
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 13 Dec 2016 09:35:26 +0000 (10:35 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 13 Dec 2016 09:43:57 +0000 (10:43 +0100)
45 files changed:
include/simgrid/forward.h
include/simgrid/msg.h
include/simgrid/s4u/NetZone.hpp [moved from include/simgrid/s4u/As.hpp with 73% similarity]
include/simgrid/s4u/engine.hpp
src/bindings/lua/lua_platf.cpp
src/instr/instr_interface.cpp
src/instr/jedule/jedule_events.cpp
src/instr/jedule/jedule_platform.cpp
src/instr/jedule/jedule_sd_binding.cpp
src/kernel/EngineImpl.hpp
src/kernel/routing/ClusterZone.cpp
src/kernel/routing/ClusterZone.hpp
src/kernel/routing/DijkstraZone.cpp
src/kernel/routing/DijkstraZone.hpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/DragonflyZone.hpp
src/kernel/routing/EmptyZone.cpp
src/kernel/routing/EmptyZone.hpp
src/kernel/routing/FatTreeZone.cpp
src/kernel/routing/FatTreeZone.hpp
src/kernel/routing/FloydZone.cpp
src/kernel/routing/FloydZone.hpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/FullZone.hpp
src/kernel/routing/NetCard.hpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/NetZoneImpl.hpp
src/kernel/routing/RoutedZone.cpp
src/kernel/routing/RoutedZone.hpp
src/kernel/routing/TorusZone.cpp
src/kernel/routing/TorusZone.hpp
src/kernel/routing/VivaldiZone.cpp
src/kernel/routing/VivaldiZone.hpp
src/msg/msg_environment.cpp
src/s4u/s4u_as.cpp [deleted file]
src/s4u/s4u_engine.cpp
src/s4u/s4u_host.cpp
src/s4u/s4u_netzone.cpp [new file with mode: 0644]
src/surf/instr_routing.cpp
src/surf/network_ns3.cpp
src/surf/sg_platf.cpp
src/surf/surf_private.h
src/surf/xml/platf_private.hpp
teshsuite/simdag/flatifier/flatifier.cpp
tools/cmake/DefinePackages.cmake

index 054ce67..10cf0ec 100644 (file)
@@ -13,9 +13,9 @@
 
 namespace simgrid {
   namespace s4u {
-    class As;
-    class Host;
-    class Mailbox;
+  class NetZone;
+  class Host;
+  class Mailbox;
   }
   namespace kernel {
      namespace activity {
@@ -40,7 +40,7 @@ namespace simgrid {
   }
 }
 
-typedef simgrid::s4u::As simgrid_As;
+typedef simgrid::s4u::NetZone simgrid_NetZone;
 typedef simgrid::s4u::Host simgrid_Host;
 typedef simgrid::kernel::activity::ActivityImpl kernel_Activity;
 typedef simgrid::kernel::routing::NetCard routing_NetCard;
@@ -54,7 +54,7 @@ typedef simgrid::simix::Host *smx_host_priv_t;
 
 #else
 
-typedef struct simgrid_As   simgrid_As;
+typedef struct simgrid_NetZone simgrid_NetZone;
 typedef struct simgrid_Host simgrid_Host;
 typedef struct kernel_Activity kernel_Activity;
 typedef struct surf_Cpu surf_Cpu;
@@ -66,7 +66,7 @@ typedef struct Trace tmgr_Trace;
 typedef struct simix_Host *smx_host_priv_t;
 #endif
 
-typedef simgrid_As *AS_t;
+typedef simgrid_NetZone* NetZone_t;
 typedef simgrid_Host* sg_host_t;
 
 typedef kernel_Activity *smx_activity_t;
index ec7c1cd..9070e53 100644 (file)
@@ -14,8 +14,8 @@
 
 SG_BEGIN_DECL()
 
-/* ************************* Autonomous System ****************************** */
-typedef simgrid_As *msg_as_t;
+/* *************************** Network Zones ******************************** */
+typedef simgrid_NetZone* msg_as_t;
 
 /* ******************************** Host ************************************ */
 
similarity index 73%
rename from include/simgrid/s4u/As.hpp
rename to include/simgrid/s4u/NetZone.hpp
index f025657..84121d3 100644 (file)
 namespace simgrid {
 
 namespace surf {
-  class Link;
+class Link;
 }
 namespace kernel {
-  namespace routing {
-    class AsImpl;
-    class NetCard;
-  }
+namespace routing {
+class NetZoneImpl;
+class NetCard;
+}
 }
 namespace s4u {
 
@@ -36,24 +36,26 @@ namespace s4u {
  * An AS is a network container, in charge of routing information between elements (hosts) and to the nearby ASes.
  * In SimGrid, there is a hierarchy of ASes, with a unique root AS (that you can retrieve from the s4u::Engine).
  */
-XBT_PUBLIC_CLASS As {
+XBT_PUBLIC_CLASS NetZone
+{
 protected:
-  friend simgrid::kernel::routing::AsImpl;
+  friend simgrid::kernel::routing::NetZoneImpl;
+
+  explicit NetZone(NetZone * father, const char* name);
+  virtual ~NetZone();
 
-  explicit As(As * father, const char* name);
-  virtual ~As();
-  
 public:
   /** @brief Seal your AS once you're done adding content, and before routing stuff through it */
   virtual void seal();
-  char *name();
-  As *father();;
+  char* name();
+  NetZone* father();
+  ;
   xbt_dict_t children(); // Sub AS
   xbt_dynar_t hosts();   // my content as a dynar
 
 public:
   /* Add content to the AS, at parsing time. It should be sealed afterward. */
-  virtual int addComponent(kernel::routing::NetCard *elm); /* A host, a router or an AS, whatever */
+  virtual int addComponent(kernel::routing::NetCard * elm); /* A host, a router or an AS, whatever */
   virtual void addRoute(sg_platf_route_cbarg_t route);
   virtual void addBypassRoute(sg_platf_route_cbarg_t e_route) = 0;
 
@@ -64,17 +66,18 @@ public:
       onRouteCreation;
 
 protected:
-  std::vector<kernel::routing::NetCard*> vertices_; // our content, as known to our graph routing algorithm (maps vertexId -> vertex)
+  std::vector<kernel::routing::NetCard*>
+      vertices_; // our content, as known to our graph routing algorithm (maps vertexId -> vertex)
 
 private:
-  As* father_ = nullptr;
-  char* name_ = nullptr;
+  NetZone* father_ = nullptr;
+  char* name_      = nullptr;
 
   bool sealed_ = false; // We cannot add more content when sealed
 
-  xbt_dict_t children_ = xbt_dict_new_homogeneous(nullptr);                               // sub-ASes
+  xbt_dict_t children_ = xbt_dict_new_homogeneous(nullptr); // sub-ASes
 };
-
-}}; // Namespace simgrid::s4u
+}
+}; // Namespace simgrid::s4u
 
 #endif /* SIMGRID_S4U_AS_HPP */
index 62b88e8..2d6678a 100644 (file)
@@ -67,10 +67,10 @@ public:
   static s4u::Engine *instance();
 
   /** @brief Retrieve the root AS, containing all others */
-  simgrid::s4u::As *rootAs();
+  simgrid::s4u::NetZone* rootAs();
 
   /** @brief Retrieve the AS of the given name (or nullptr if not found) */
-  simgrid::s4u::As *asByNameOrNull(const char *name);
+  simgrid::s4u::NetZone* asByNameOrNull(const char* name);
 
   template<class F>
   void registerFunction(const char* name)
index 8f79fd9..7398ed7 100644 (file)
@@ -490,11 +490,12 @@ int console_AS_open(lua_State *L) {
  s_sg_platf_AS_cbarg_t AS;
  AS.id = id;
  AS.routing = mode_int;
- simgrid::s4u::As *new_as = sg_platf_new_AS_begin(&AS);
+ simgrid::s4u::NetZone* new_as = sg_platf_new_AS_begin(&AS);
 
  /* Build a Lua representation of the new AS on the stack */
  lua_newtable(L);
- simgrid::s4u::As **lua_as = (simgrid::s4u::As **) lua_newuserdata(L, sizeof(simgrid::s4u::As *)); /* table userdatum */
+ simgrid::s4u::NetZone** lua_as =
+     (simgrid::s4u::NetZone**)lua_newuserdata(L, sizeof(simgrid::s4u::NetZone*)); /* table userdatum */
  *lua_as = new_as;
  luaL_getmetatable(L, PLATF_MODULE_NAME); /* table userdatum metatable */
  lua_setmetatable(L, -2);                 /* table userdatum */
index 46d4f8a..78a41cf 100644 (file)
@@ -321,7 +321,7 @@ static void instr_user_srcdst_variable(double time, const char *src, const char
     xbt_die("Element '%s' not found!",dst);
 
   std::vector<Link*> route;
-  simgrid::kernel::routing::AsImpl::getGlobalRoute(src_elm, dst_elm, &route, nullptr);
+  simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(src_elm, dst_elm, &route, nullptr);
   for (auto link : route)
     instr_user_variable (time, link->getName(), variable, father_type, value, what, nullptr, user_link_variables);
 }
index b7ff520..1b43029 100644 (file)
@@ -5,10 +5,10 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/jedule/jedule_events.hpp"
-#include "simgrid/jedule/jedule_platform.hpp"
-#include "simgrid/jedule/jedule.hpp"
-#include "simgrid/s4u/As.hpp"
 
+#include "simgrid/jedule/jedule.hpp"
+#include "simgrid/jedule/jedule_platform.hpp"
+#include "simgrid/s4u/NetZone.hpp"
 #include "xbt/asserts.h"
 
 #if HAVE_JEDULE
index 45c558f..226dc05 100644 (file)
@@ -6,8 +6,7 @@
 
 #include "simgrid/jedule/jedule.hpp"
 #include "simgrid/jedule/jedule_platform.hpp"
-#include "simgrid/s4u/As.hpp"
-
+#include "simgrid/s4u/NetZone.hpp"
 #include "xbt/asserts.h"
 #include "xbt/dynar.h"
 #include <algorithm>
index ee3c110..48bb260 100644 (file)
@@ -6,12 +6,13 @@
 
 #include "xbt/asserts.h"
 #include "simgrid/jedule/jedule_sd_binding.h"
+
 #include "simgrid/forward.h"
 
-#include "simgrid/s4u/As.hpp"
-#include "simgrid/s4u/engine.hpp"
-#include "simgrid/jedule/jedule.hpp"
 #include "../../simdag/simdag_private.hpp"
+#include "simgrid/jedule/jedule.hpp"
+#include "simgrid/s4u/NetZone.hpp"
+#include "simgrid/s4u/engine.hpp"
 
 #if HAVE_JEDULE
 
index 750cb62..19aefe0 100644 (file)
@@ -9,14 +9,14 @@
 namespace simgrid {
 namespace kernel {
 namespace routing {
-class AsImpl;
+class NetZoneImpl;
 }
 
 class EngineImpl {
 public:
   EngineImpl();
   virtual ~EngineImpl();
-  kernel::routing::AsImpl* rootAs_ = nullptr;
+  kernel::routing::NetZoneImpl* rootAs_ = nullptr;
 
 protected:
   friend simgrid::s4u::Engine;
index dc72ef3..9a0335b 100644 (file)
@@ -15,11 +15,11 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf"
 namespace simgrid {
 namespace kernel {
 namespace routing {
-AsCluster::AsCluster(As* father, const char* name) : AsImpl(father, name)
+ClusterZone::ClusterZone(NetZone* father, const char* name) : NetZoneImpl(father, name)
 {
 }
 
-void AsCluster::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void ClusterZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
 {
   XBT_VERB("cluster getLocalRoute from '%s'[%d] to '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id());
   xbt_assert(!privateLinks_.empty(),
@@ -70,7 +70,7 @@ void AsCluster::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t
   }
 }
 
-void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
+void ClusterZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 {
   xbt_assert(router_,
              "Malformed cluster. This may be because your platform file is a hypergraph while it must be a graph.");
@@ -115,7 +115,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
   }
 }
 
-void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int, int position)
+void ClusterZone::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int, int position)
 {
   char* link_id = bprintf("%s_link_%d", cluster->id, id);
 
index 0096ae1..adca587 100644 (file)
@@ -14,9 +14,9 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-class XBT_PRIVATE AsCluster : public AsImpl {
+class XBT_PRIVATE ClusterZone : public NetZoneImpl {
 public:
-  explicit AsCluster(As* father, const char* name);
+  explicit ClusterZone(NetZone* father, const char* name);
 
   void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
   void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
index e7d12b5..eb8c653 100644 (file)
@@ -41,7 +41,7 @@ static void graph_edge_data_free(void* e) // FIXME: useless code duplication
 namespace simgrid {
 namespace kernel {
 namespace routing {
-void AsDijkstra::seal()
+void DijkstraZone::seal()
 {
   xbt_node_t node = nullptr;
   unsigned int cursor2, cursor;
@@ -83,7 +83,7 @@ void AsDijkstra::seal()
   }
 }
 
-xbt_node_t AsDijkstra::routeGraphNewNode(int id, int graph_id)
+xbt_node_t DijkstraZone::routeGraphNewNode(int id, int graph_id)
 {
   xbt_node_t node              = nullptr;
   graph_node_data_t data       = nullptr;
@@ -101,14 +101,14 @@ xbt_node_t AsDijkstra::routeGraphNewNode(int id, int graph_id)
   return node;
 }
 
-graph_node_map_element_t AsDijkstra::nodeMapSearch(int id)
+graph_node_map_element_t DijkstraZone::nodeMapSearch(int id)
 {
   return (graph_node_map_element_t)xbt_dict_get_or_null_ext(graphNodeMap_, (char*)(&id), sizeof(int));
 }
 
 /* Parsing */
 
-void AsDijkstra::newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route)
+void DijkstraZone::newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route)
 {
   XBT_DEBUG("Load Route from \"%d\" to \"%d\"", src_id, dst_id);
   xbt_node_t src = nullptr;
@@ -140,7 +140,7 @@ void AsDijkstra::newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route
   xbt_graph_new_edge(routeGraph_, src, dst, e_route);
 }
 
-void AsDijkstra::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void DijkstraZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
 {
   getRouteCheckParams(src, dst);
   int src_id = src->id();
@@ -297,7 +297,7 @@ void AsDijkstra::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_
     xbt_free(pred_arr);
 }
 
-AsDijkstra::~AsDijkstra()
+DijkstraZone::~DijkstraZone()
 {
   xbt_graph_free_graph(routeGraph_, &xbt_free_f, &graph_edge_data_free, &xbt_free_f);
   xbt_dict_free(&graphNodeMap_);
@@ -306,13 +306,13 @@ AsDijkstra::~AsDijkstra()
 
 /* Creation routing model functions */
 
-AsDijkstra::AsDijkstra(As* father, const char* name, bool cached) : AsRoutedGraph(father, name)
+DijkstraZone::DijkstraZone(NetZone* father, const char* name, bool cached) : RoutedZone(father, name)
 {
   if (cached)
     routeCache_ = xbt_dict_new_homogeneous(&route_cache_elem_free);
 }
 
-void AsDijkstra::addRoute(sg_platf_route_cbarg_t route)
+void DijkstraZone::addRoute(sg_platf_route_cbarg_t route)
 {
   NetCard* src        = route->src;
   NetCard* dst        = route->dst;
index 51541ce..99442cb 100644 (file)
@@ -31,12 +31,12 @@ namespace routing {
  ***********/
 
 /** Dijkstra routing data: fast initialization, slow lookup, small memory requirements, shortest path routing only */
-class XBT_PRIVATE AsDijkstra : public AsRoutedGraph {
+class XBT_PRIVATE DijkstraZone : public RoutedZone {
 public:
-  AsDijkstra(As* father, const char* name, bool cached);
+  DijkstraZone(NetZone* father, const char* name, bool cached);
   void seal() override;
 
-  ~AsDijkstra() override;
+  ~DijkstraZone() override;
   xbt_node_t routeGraphNewNode(int id, int graph_id);
   graph_node_map_element_t nodeMapSearch(int id);
   void newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_route);
index 146e007..02d4f02 100644 (file)
@@ -16,11 +16,11 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-AsClusterDragonfly::AsClusterDragonfly(As* father, const char* name) : AsCluster(father, name)
+DragonflyZone::DragonflyZone(NetZone* father, const char* name) : ClusterZone(father, name)
 {
 }
 
-AsClusterDragonfly::~AsClusterDragonfly()
+DragonflyZone::~DragonflyZone()
 {
   if (this->routers_ != nullptr) {
     for (unsigned int i = 0; i < this->numGroups_ * this->numChassisPerGroup_ * this->numBladesPerChassis_; i++)
@@ -29,7 +29,7 @@ AsClusterDragonfly::~AsClusterDragonfly()
   }
 }
 
-unsigned int* AsClusterDragonfly::rankId_to_coords(int rankId)
+unsigned int* DragonflyZone::rankId_to_coords(int rankId)
 {
   // coords : group, chassis, blade, node
   unsigned int* coords = (unsigned int*)malloc(4 * sizeof(unsigned int));
@@ -43,7 +43,7 @@ unsigned int* AsClusterDragonfly::rankId_to_coords(int rankId)
   return coords;
 }
 
-void AsClusterDragonfly::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
+void DragonflyZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
 {
   std::vector<std::string> parameters;
   std::vector<std::string> tmp;
@@ -91,7 +91,7 @@ void AsClusterDragonfly::parse_specific_arguments(sg_platf_cluster_cbarg_t clust
 /*
 * Generate the cluster once every node is created
 */
-void AsClusterDragonfly::seal()
+void DragonflyZone::seal()
 {
   if (this->numNodesPerBlade_ == 0) {
     return;
@@ -117,7 +117,7 @@ DragonflyRouter::~DragonflyRouter()
     xbt_free(blueLinks_);
 }
 
-void AsClusterDragonfly::generateRouters()
+void DragonflyZone::generateRouters()
 {
   this->routers_ = static_cast<DragonflyRouter**>(xbt_malloc0(this->numGroups_ * this->numChassisPerGroup_ *
                                                               this->numBladesPerChassis_ * sizeof(DragonflyRouter*)));
@@ -133,7 +133,7 @@ void AsClusterDragonfly::generateRouters()
   }
 }
 
-void AsClusterDragonfly::createLink(char* id, int numlinks, Link** linkup, Link** linkdown)
+void DragonflyZone::createLink(char* id, int numlinks, Link** linkup, Link** linkdown)
 {
   *linkup   = nullptr;
   *linkdown = nullptr;
@@ -163,7 +163,7 @@ void AsClusterDragonfly::createLink(char* id, int numlinks, Link** linkup, Link*
   free((void*)linkTemplate.id);
 }
 
-void AsClusterDragonfly::generateLinks()
+void DragonflyZone::generateLinks()
 {
 
   static int uniqueId = 0;
@@ -245,7 +245,7 @@ void AsClusterDragonfly::generateLinks()
   }
 }
 
-void AsClusterDragonfly::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* latency)
+void DragonflyZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* latency)
 {
   // Minimal routing version.
   // TODO : non-minimal random one, and adaptive ?
index 767d0fc..2090b32 100644 (file)
@@ -60,10 +60,10 @@ public:
  *    is also not realistic, as blue level can use more links than a single
  *    Aries can handle, thus it should use several routers.
  */
-class XBT_PRIVATE AsClusterDragonfly : public AsCluster {
+class XBT_PRIVATE DragonflyZone : public ClusterZone {
 public:
-  explicit AsClusterDragonfly(As* father, const char* name);
-  ~AsClusterDragonfly() override;
+  explicit DragonflyZone(NetZone* father, const char* name);
+  ~DragonflyZone() override;
   //      void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
   void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
   void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) override;
index 95d7b19..66729e6 100644 (file)
@@ -15,17 +15,17 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-AsNone::AsNone(As* father, const char* name) : AsImpl(father, name)
+EmptyZone::EmptyZone(NetZone* father, const char* name) : NetZoneImpl(father, name)
 {
 }
 
-AsNone::~AsNone() = default;
+EmptyZone::~EmptyZone() = default;
 
-void AsNone::getLocalRoute(NetCard* /*src*/, NetCard* /*dst*/, sg_platf_route_cbarg_t /*res*/, double* /*lat*/)
+void EmptyZone::getLocalRoute(NetCard* /*src*/, NetCard* /*dst*/, sg_platf_route_cbarg_t /*res*/, double* /*lat*/)
 {
 }
 
-void AsNone::getGraph(xbt_graph_t /*graph*/, xbt_dict_t /*nodes*/, xbt_dict_t /*edges*/)
+void EmptyZone::getGraph(xbt_graph_t /*graph*/, xbt_dict_t /*nodes*/, xbt_dict_t /*edges*/)
 {
   XBT_ERROR("No routing no graph");
 }
index 80d1d1f..ad8c7a3 100644 (file)
@@ -13,10 +13,10 @@ namespace kernel {
 namespace routing {
 
 /** No specific routing. Mainly useful with the constant network model */
-class XBT_PRIVATE AsNone : public AsImpl {
+class XBT_PRIVATE EmptyZone : public NetZoneImpl {
 public:
-  explicit AsNone(As* father, const char* name);
-  ~AsNone() override;
+  explicit EmptyZone(NetZone* father, const char* name);
+  ~EmptyZone() override;
 
   void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
   void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
index 97c57d3..20c84ab 100644 (file)
@@ -21,12 +21,12 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-AsClusterFatTree::AsClusterFatTree(As* father, const char* name) : AsCluster(father, name)
+FatTreeZone::FatTreeZone(NetZone* father, const char* name) : ClusterZone(father, name)
 {
   XBT_DEBUG("Creating a new fat tree.");
 }
 
-AsClusterFatTree::~AsClusterFatTree()
+FatTreeZone::~FatTreeZone()
 {
   for (unsigned int i = 0; i < this->nodes_.size(); i++) {
     delete this->nodes_[i];
@@ -36,7 +36,7 @@ AsClusterFatTree::~AsClusterFatTree()
   }
 }
 
-bool AsClusterFatTree::isInSubTree(FatTreeNode* root, FatTreeNode* node)
+bool FatTreeZone::isInSubTree(FatTreeNode* root, FatTreeNode* node)
 {
   XBT_DEBUG("Is %d(%u,%u) in the sub tree of %d(%u,%u) ?", node->id, node->level, node->position, root->id, root->level,
             root->position);
@@ -57,7 +57,7 @@ bool AsClusterFatTree::isInSubTree(FatTreeNode* root, FatTreeNode* node)
   return true;
 }
 
-void AsClusterFatTree::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency)
+void FatTreeZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency)
 {
 
   if (dst->isRouter() || src->isRouter())
@@ -129,7 +129,7 @@ void AsClusterFatTree::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_
 /* This function makes the assumption that parse_specific_arguments() and
  * addNodes() have already been called
  */
-void AsClusterFatTree::seal()
+void FatTreeZone::seal()
 {
   if (this->levels_ == 0) {
     return;
@@ -175,7 +175,7 @@ void AsClusterFatTree::seal()
   }
 }
 
-int AsClusterFatTree::connectNodeToParents(FatTreeNode* node)
+int FatTreeZone::connectNodeToParents(FatTreeNode* node)
 {
   std::vector<FatTreeNode*>::iterator currentParentNode = this->nodes_.begin();
   int connectionsNumber                                 = 0;
@@ -199,7 +199,7 @@ int AsClusterFatTree::connectNodeToParents(FatTreeNode* node)
   return connectionsNumber;
 }
 
-bool AsClusterFatTree::areRelated(FatTreeNode* parent, FatTreeNode* child)
+bool FatTreeZone::areRelated(FatTreeNode* parent, FatTreeNode* child)
 {
   std::stringstream msgBuffer;
 
@@ -231,7 +231,7 @@ bool AsClusterFatTree::areRelated(FatTreeNode* parent, FatTreeNode* child)
   return true;
 }
 
-void AsClusterFatTree::generateSwitches()
+void FatTreeZone::generateSwitches()
 {
   XBT_DEBUG("Generating switches.");
   this->nodesByLevel_.resize(this->levels_ + 1, 0);
@@ -278,7 +278,7 @@ void AsClusterFatTree::generateSwitches()
   }
 }
 
-void AsClusterFatTree::generateLabels()
+void FatTreeZone::generateLabels()
 {
   XBT_DEBUG("Generating labels.");
   // TODO : check if nodesByLevel and nodes are filled
@@ -324,7 +324,7 @@ void AsClusterFatTree::generateLabels()
   }
 }
 
-int AsClusterFatTree::getLevelPosition(const unsigned int level)
+int FatTreeZone::getLevelPosition(const unsigned int level)
 {
   xbt_assert(level <= this->levels_, "The impossible did happen. Yet again.");
   int tempPosition = 0;
@@ -335,7 +335,7 @@ int AsClusterFatTree::getLevelPosition(const unsigned int level)
   return tempPosition;
 }
 
-void AsClusterFatTree::addProcessingNode(int id)
+void FatTreeZone::addProcessingNode(int id)
 {
   using std::make_pair;
   static int position = 0;
@@ -347,7 +347,7 @@ void AsClusterFatTree::addProcessingNode(int id)
   this->nodes_.push_back(newNode);
 }
 
-void AsClusterFatTree::addLink(FatTreeNode* parent, unsigned int parentPort, FatTreeNode* child, unsigned int childPort)
+void FatTreeZone::addLink(FatTreeNode* parent, unsigned int parentPort, FatTreeNode* child, unsigned int childPort)
 {
   FatTreeLink* newLink;
   newLink = new FatTreeLink(this->cluster_, child, parent);
@@ -359,7 +359,7 @@ void AsClusterFatTree::addLink(FatTreeNode* parent, unsigned int parentPort, Fat
   this->links_.push_back(newLink);
 }
 
-void AsClusterFatTree::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
+void FatTreeZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
 {
   std::vector<std::string> parameters;
   std::vector<std::string> tmp;
@@ -406,7 +406,7 @@ void AsClusterFatTree::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster
   this->cluster_ = cluster;
 }
 
-void AsClusterFatTree::generateDotFile(const std::string& filename) const
+void FatTreeZone::generateDotFile(const std::string& filename) const
 {
   std::ofstream file;
   file.open(filename, std::ios::out | std::ios::trunc);
index 4e356df..33937fa 100644 (file)
@@ -98,10 +98,10 @@ public:
  *
  * Routing is made using a destination-mod-k scheme.
  */
-class XBT_PRIVATE AsClusterFatTree : public AsCluster {
+class XBT_PRIVATE FatTreeZone : public ClusterZone {
 public:
-  explicit AsClusterFatTree(As* father, const char* name);
-  ~AsClusterFatTree() override;
+  explicit FatTreeZone(NetZone* father, const char* name);
+  ~FatTreeZone() override;
   void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
 
   /** \brief Generate the fat tree
index 145f128..378119e 100644 (file)
@@ -20,14 +20,14 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-AsFloyd::AsFloyd(As* father, const char* name) : AsRoutedGraph(father, name)
+FloydZone::FloydZone(NetZone* father, const char* name) : RoutedZone(father, name)
 {
   predecessorTable_ = nullptr;
   costTable_        = nullptr;
   linkTable_        = nullptr;
 }
 
-AsFloyd::~AsFloyd()
+FloydZone::~FloydZone()
 {
   if (linkTable_ == nullptr) // Dealing with a parse error in the file?
     return;
@@ -42,7 +42,7 @@ AsFloyd::~AsFloyd()
   xbt_free(costTable_);
 }
 
-void AsFloyd::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void FloydZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
 {
   size_t table_size = vertices_.size();
 
@@ -83,7 +83,7 @@ void AsFloyd::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t r
   }
 }
 
-void AsFloyd::addRoute(sg_platf_route_cbarg_t route)
+void FloydZone::addRoute(sg_platf_route_cbarg_t route)
 {
   /* set the size of table routing */
   int table_size = static_cast<int>(vertices_.size());
@@ -152,7 +152,7 @@ void AsFloyd::addRoute(sg_platf_route_cbarg_t route)
   }
 }
 
-void AsFloyd::seal()
+void FloydZone::seal()
 {
   /* set the size of table routing */
   size_t table_size = vertices_.size();
index c3023b2..27bcdc8 100644 (file)
@@ -13,10 +13,10 @@ namespace kernel {
 namespace routing {
 
 /** Floyd routing data: slow initialization, fast lookup, lesser memory requirements, shortest path routing only */
-class XBT_PRIVATE AsFloyd : public AsRoutedGraph {
+class XBT_PRIVATE FloydZone : public RoutedZone {
 public:
-  explicit AsFloyd(As* father, const char* name);
-  ~AsFloyd() override;
+  explicit FloydZone(NetZone* father, const char* name);
+  ~FloydZone() override;
 
   void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
   void addRoute(sg_platf_route_cbarg_t route) override;
index 3a3c6dc..51afef0 100644 (file)
@@ -14,11 +14,11 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
 namespace simgrid {
 namespace kernel {
 namespace routing {
-AsFull::AsFull(As* father, const char* name) : AsRoutedGraph(father, name)
+FullZone::FullZone(NetZone* father, const char* name) : RoutedZone(father, name)
 {
 }
 
-void AsFull::seal()
+void FullZone::seal()
 {
   int i;
   sg_platf_route_cbarg_t e_route;
@@ -46,7 +46,7 @@ void AsFull::seal()
   }
 }
 
-AsFull::~AsFull()
+FullZone::~FullZone()
 {
   if (routingTable_) {
     int table_size = static_cast<int>(vertices_.size());
@@ -62,7 +62,7 @@ AsFull::~AsFull()
   }
 }
 
-void AsFull::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t res, double* lat)
+void FullZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t res, double* lat)
 {
   XBT_DEBUG("full getLocalRoute from %s[%d] to %s[%d]", src->cname(), src->id(), dst->cname(), dst->id());
 
@@ -80,7 +80,7 @@ void AsFull::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t re
   }
 }
 
-void AsFull::addRoute(sg_platf_route_cbarg_t route)
+void FullZone::addRoute(sg_platf_route_cbarg_t route)
 {
   NetCard* src = route->src;
   NetCard* dst = route->dst;
index 3628e90..b3e93c6 100644 (file)
@@ -13,11 +13,11 @@ namespace kernel {
 namespace routing {
 
 /** Full routing: fast, large memory requirements, fully expressive */
-class XBT_PRIVATE AsFull : public AsRoutedGraph {
+class XBT_PRIVATE FullZone : public RoutedZone {
 public:
-  explicit AsFull(As* father, const char* name);
+  explicit FullZone(NetZone* father, const char* name);
   void seal() override;
-  ~AsFull() override;
+  ~FullZone() override;
 
   void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
   void addRoute(sg_platf_route_cbarg_t route) override;
index 3be88da..a85531f 100644 (file)
@@ -29,7 +29,7 @@ class NetCard : public simgrid::xbt::Extendable<NetCard> {
 public:
   enum class Type { Host, Router, As };
 
-  NetCard(std::string name, NetCard::Type componentType, AsImpl* containingAS)
+  NetCard(std::string name, NetCard::Type componentType, NetZoneImpl* containingAS)
       : name_(name), componentType_(componentType), containingAS_(containingAS)
   {
     if (containingAS != nullptr)
@@ -43,7 +43,7 @@ public:
   std::string name() { return name_; }
   const char* cname() { return name_.c_str(); }
   // This is the AS in which I am
-  AsImpl* containingAS() { return containingAS_; }
+  NetZoneImpl* containingAS() { return containingAS_; }
 
   bool isAS() { return componentType_ == Type::As; }
   bool isHost() { return componentType_ == Type::Host; }
@@ -55,7 +55,7 @@ private:
   unsigned int id_;
   std::string name_;
   NetCard::Type componentType_;
-  AsImpl* containingAS_;
+  NetZoneImpl* containingAS_;
 };
 }
 }
index 79bbdf0..42b751c 100644 (file)
@@ -25,22 +25,22 @@ public:
   std::vector<Link*> links;
 };
 
-AsImpl::AsImpl(As* father, const char* name) : As(father, name)
+NetZoneImpl::NetZoneImpl(NetZone* father, const char* name) : NetZone(father, name)
 {
   xbt_assert(nullptr == xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL),
              "Refusing to create a second AS called '%s'.", name);
 
-  netcard_ = new NetCard(name, NetCard::Type::As, static_cast<AsImpl*>(father));
+  netcard_ = new NetCard(name, NetCard::Type::As, static_cast<NetZoneImpl*>(father));
   xbt_lib_set(as_router_lib, name, ROUTING_ASR_LEVEL, static_cast<void*>(netcard_));
   XBT_DEBUG("AS '%s' created with the id '%d'", name, netcard_->id());
 }
-AsImpl::~AsImpl()
+NetZoneImpl::~NetZoneImpl()
 {
   for (auto& kv : bypassRoutes_)
     delete kv.second;
 }
 
-simgrid::s4u::Host* AsImpl::createHost(const char* name, std::vector<double>* speedPerPstate, int coreAmount)
+simgrid::s4u::Host* NetZoneImpl::createHost(const char* name, std::vector<double>* speedPerPstate, int coreAmount)
 {
   simgrid::s4u::Host* res = new simgrid::s4u::Host(name);
 
@@ -54,7 +54,7 @@ simgrid::s4u::Host* AsImpl::createHost(const char* name, std::vector<double>* sp
   return res;
 }
 
-void AsImpl::addBypassRoute(sg_platf_route_cbarg_t e_route)
+void NetZoneImpl::addBypassRoute(sg_platf_route_cbarg_t e_route)
 {
   /* Argument validity checks */
   if (e_route->gw_dst) {
@@ -133,7 +133,8 @@ void AsImpl::addBypassRoute(sg_platf_route_cbarg_t e_route)
  *  @endverbatim
  */
 static void find_common_ancestors(NetCard* src, NetCard* dst,
-                                  /* OUT */ AsImpl** common_ancestor, AsImpl** src_ancestor, AsImpl** dst_ancestor)
+                                  /* OUT */ NetZoneImpl** common_ancestor, NetZoneImpl** src_ancestor,
+                                  NetZoneImpl** dst_ancestor)
 {
   /* Deal with the easy base case */
   if (src->containingAS() == dst->containingAS()) {
@@ -146,24 +147,24 @@ static void find_common_ancestors(NetCard* src, NetCard* dst,
   /* engage the full recursive search */
 
   /* (1) find the path to root of src and dst*/
-  AsImpl* src_as = src->containingAS();
-  AsImpl* dst_as = dst->containingAS();
+  NetZoneImpl* src_as = src->containingAS();
+  NetZoneImpl* dst_as = dst->containingAS();
 
   xbt_assert(src_as, "Host %s must be in an AS", src->cname());
   xbt_assert(dst_as, "Host %s must be in an AS", dst->cname());
 
   /* (2) find the path to the root routing component */
-  std::vector<AsImpl*> path_src;
-  AsImpl* current = src->containingAS();
+  std::vector<NetZoneImpl*> path_src;
+  NetZoneImpl* current = src->containingAS();
   while (current != nullptr) {
     path_src.push_back(current);
-    current = static_cast<AsImpl*>(current->father());
+    current = static_cast<NetZoneImpl*>(current->father());
   }
-  std::vector<AsImpl*> path_dst;
+  std::vector<NetZoneImpl*> path_dst;
   current = dst->containingAS();
   while (current != nullptr) {
     path_dst.push_back(current);
-    current = static_cast<AsImpl*>(current->father());
+    current = static_cast<NetZoneImpl*>(current->father());
   }
 
   /* (3) find the common father.
@@ -172,7 +173,7 @@ static void find_common_ancestors(NetCard* src, NetCard* dst,
    *
    * This works because all SimGrid platform have a unique root element (that is the last element of both paths).
    */
-  AsImpl* father = nullptr; // the AS we dropped on the previous loop iteration
+  NetZoneImpl* father = nullptr; // the AS we dropped on the previous loop iteration
   while (path_src.size() > 1 && path_dst.size() > 1 &&
          path_src.at(path_src.size() - 1) == path_dst.at(path_dst.size() - 1)) {
     father = path_src.at(path_src.size() - 1);
@@ -191,8 +192,8 @@ static void find_common_ancestors(NetCard* src, NetCard* dst,
 }
 
 /* PRECONDITION: this is the common ancestor of src and dst */
-bool AsImpl::getBypassRoute(routing::NetCard* src, routing::NetCard* dst,
-                            /* OUT */ std::vector<surf::Link*>* links, double* latency)
+bool NetZoneImpl::getBypassRoute(routing::NetCard* src, routing::NetCard* dst,
+                                 /* OUT */ std::vector<surf::Link*>* links, double* latency)
 {
   // If never set a bypass route return nullptr without any further computations
   if (bypassRoutes_.empty())
@@ -217,17 +218,17 @@ bool AsImpl::getBypassRoute(routing::NetCard* src, routing::NetCard* dst,
   /* Engage recursive search */
 
   /* (1) find the path to the root routing component */
-  std::vector<AsImpl*> path_src;
-  As* current = src->containingAS();
+  std::vector<NetZoneImpl*> path_src;
+  NetZone* current = src->containingAS();
   while (current != nullptr) {
-    path_src.push_back(static_cast<AsImpl*>(current));
+    path_src.push_back(static_cast<NetZoneImpl*>(current));
     current = current->father_;
   }
 
-  std::vector<AsImpl*> path_dst;
+  std::vector<NetZoneImpl*> path_dst;
   current = dst->containingAS();
   while (current != nullptr) {
-    path_dst.push_back(static_cast<AsImpl*>(current));
+    path_dst.push_back(static_cast<NetZoneImpl*>(current));
     current = current->father_;
   }
 
@@ -296,8 +297,8 @@ bool AsImpl::getBypassRoute(routing::NetCard* src, routing::NetCard* dst,
   return false;
 }
 
-void AsImpl::getGlobalRoute(routing::NetCard* src, routing::NetCard* dst,
-                            /* OUT */ std::vector<surf::Link*>* links, double* latency)
+void NetZoneImpl::getGlobalRoute(routing::NetCard* src, routing::NetCard* dst,
+                                 /* OUT */ std::vector<surf::Link*>* links, double* latency)
 {
   s_sg_platf_route_cbarg_t route;
   memset(&route, 0, sizeof(route));
@@ -305,7 +306,7 @@ void AsImpl::getGlobalRoute(routing::NetCard* src, routing::NetCard* dst,
   XBT_DEBUG("Resolve route from '%s' to '%s'", src->cname(), dst->cname());
 
   /* Find how src and dst are interconnected */
-  AsImpl *common_ancestor, *src_ancestor, *dst_ancestor;
+  NetZoneImpl *common_ancestor, *src_ancestor, *dst_ancestor;
   find_common_ancestors(src, dst, &common_ancestor, &src_ancestor, &dst_ancestor);
   XBT_DEBUG("elements_father: common ancestor '%s' src ancestor '%s' dst ancestor '%s'", common_ancestor->name(),
             src_ancestor->name(), dst_ancestor->name());
index d442e7c..72c2233 100644 (file)
@@ -8,7 +8,7 @@
 
 #include "xbt/graph.h"
 
-#include "simgrid/s4u/As.hpp"
+#include "simgrid/s4u/NetZone.hpp"
 #include "simgrid/s4u/forward.hpp"
 
 #include "src/surf/xml/platf_private.hpp" // FIXME: kill sg_platf_route_cbarg_t to remove that UGLY include
@@ -46,13 +46,13 @@ class BypassRoute;
  * The algorithm for that is explained in http://hal.inria.fr/hal-00650233/
  *
  */
-XBT_PUBLIC_CLASS AsImpl : public s4u::As
+XBT_PUBLIC_CLASS NetZoneImpl : public s4u::NetZone
 {
   friend simgrid::kernel::EngineImpl; // it destroys rootAs_
 
 protected:
-  explicit AsImpl(As * father, const char* name);
-  virtual ~AsImpl();
+  explicit NetZoneImpl(NetZone * father, const char* name);
+  virtual ~NetZoneImpl();
 
 public:
   /** @brief Make an host within that AS */
index e87b942..a20c83f 100644 (file)
@@ -70,11 +70,11 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-AsRoutedGraph::AsRoutedGraph(As* father, const char* name) : AsImpl(father, name)
+RoutedZone::RoutedZone(NetZone* father, const char* name) : NetZoneImpl(father, name)
 {
 }
 
-void AsRoutedGraph::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
+void RoutedZone::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 {
   for (auto my_src : vertices_) {
     for (auto my_dst : vertices_) {
@@ -128,8 +128,8 @@ void AsRoutedGraph::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edg
 /* ************************************************************************** */
 /* ************************* GENERIC AUX FUNCTIONS ************************** */
 /* change a route containing link names into a route containing link entities */
-sg_platf_route_cbarg_t AsRoutedGraph::newExtendedRoute(RoutingMode hierarchy, sg_platf_route_cbarg_t routearg,
-                                                       int change_order)
+sg_platf_route_cbarg_t RoutedZone::newExtendedRoute(RoutingMode hierarchy, sg_platf_route_cbarg_t routearg,
+                                                    int change_order)
 {
   sg_platf_route_cbarg_t result;
 
@@ -156,13 +156,13 @@ sg_platf_route_cbarg_t AsRoutedGraph::newExtendedRoute(RoutingMode hierarchy, sg
   return result;
 }
 
-void AsRoutedGraph::getRouteCheckParams(NetCard* src, NetCard* dst)
+void RoutedZone::getRouteCheckParams(NetCard* src, NetCard* dst)
 {
   xbt_assert(src, "Cannot find a route from nullptr to %s", dst->cname());
   xbt_assert(dst, "Cannot find a route from %s to nullptr", src->cname());
 
-  As* src_as = src->containingAS();
-  As* dst_as = dst->containingAS();
+  NetZone* src_as = src->containingAS();
+  NetZone* dst_as = dst->containingAS();
 
   xbt_assert(src_as == dst_as,
              "Internal error: %s@%s and %s@%s are not in the same AS as expected. Please report that bug.",
@@ -172,7 +172,7 @@ void AsRoutedGraph::getRouteCheckParams(NetCard* src, NetCard* dst)
                              "%s@%s). Please report that bug.",
              src->cname(), dst->cname(), src_as->name(), dst_as->name(), name());
 }
-void AsRoutedGraph::addRouteCheckParams(sg_platf_route_cbarg_t route)
+void RoutedZone::addRouteCheckParams(sg_platf_route_cbarg_t route)
 {
   NetCard* src        = route->src;
   NetCard* dst        = route->dst;
index 0c2d547..8db82e1 100644 (file)
@@ -12,9 +12,9 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-class XBT_PRIVATE AsRoutedGraph : public AsImpl {
+class XBT_PRIVATE RoutedZone : public NetZoneImpl {
 public:
-  explicit AsRoutedGraph(As* father, const char* name);
+  explicit RoutedZone(NetZone* father, const char* name);
 
   void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
   virtual sg_platf_route_cbarg_t newExtendedRoute(RoutingMode hierarchy, sg_platf_route_cbarg_t routearg,
index 1da873a..130d147 100644 (file)
@@ -27,15 +27,15 @@ inline unsigned int* rankId_to_coords(int rankId, xbt_dynar_t dimensions)
 namespace simgrid {
 namespace kernel {
 namespace routing {
-AsClusterTorus::AsClusterTorus(As* father, const char* name) : AsCluster(father, name)
+TorusZone::TorusZone(NetZone* father, const char* name) : ClusterZone(father, name)
 {
 }
-AsClusterTorus::~AsClusterTorus()
+TorusZone::~TorusZone()
 {
   xbt_dynar_free(&dimensions_);
 }
 
-void AsClusterTorus::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position)
+void TorusZone::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position)
 {
   char* link_id;
   unsigned int j = 0;
@@ -88,7 +88,7 @@ void AsClusterTorus::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int
   rank++;
 }
 
-void AsClusterTorus::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
+void TorusZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
 {
 
   unsigned int iter;
@@ -112,7 +112,7 @@ void AsClusterTorus::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
   xbt_dynar_free(&dimensions);
 }
 
-void AsClusterTorus::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void TorusZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
 {
 
   XBT_VERB("torus getLocalRoute from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), dst->name().c_str(),
index 052d7b0..1361f9b 100644 (file)
@@ -12,10 +12,10 @@ namespace simgrid {
 namespace kernel {
 namespace routing {
 
-class XBT_PRIVATE AsClusterTorus : public AsCluster {
+class XBT_PRIVATE TorusZone : public ClusterZone {
 public:
-  explicit AsClusterTorus(As* father, const char* name);
-  ~AsClusterTorus() override;
+  explicit TorusZone(NetZone* father, const char* name);
+  ~TorusZone() override;
   void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
   void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
   void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) override;
index df98547..a04f1e9 100644 (file)
@@ -53,11 +53,11 @@ static std::vector<double>* getCoordsFromNetcard(NetCard* nc)
              (nc->isAS() ? "AS" : (nc->isHost() ? "Host" : "Router")), nc->cname(), nc);
   return &coords->coords;
 }
-AsVivaldi::AsVivaldi(As* father, const char* name) : AsCluster(father, name)
+VivaldiZone::VivaldiZone(NetZone* father, const char* name) : ClusterZone(father, name)
 {
 }
 
-void AsVivaldi::setPeerLink(NetCard* netcard, double bw_in, double bw_out, double latency, const char* coord)
+void VivaldiZone::setPeerLink(NetCard* netcard, double bw_in, double bw_out, double latency, const char* coord)
 {
   xbt_assert(netcard->containingAS() == this, "Cannot add a peer link to a netcard that is not in this AS");
 
@@ -73,7 +73,7 @@ void AsVivaldi::setPeerLink(NetCard* netcard, double bw_in, double bw_out, doubl
   free(link_down);
 }
 
-void AsVivaldi::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void VivaldiZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
 {
   XBT_DEBUG("vivaldi getLocalRoute from '%s'[%d] '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id());
 
index 0998640..56da872 100644 (file)
@@ -13,9 +13,9 @@ namespace kernel {
 namespace routing {
 
 /* This extends cluster because each host has a private link */
-class XBT_PRIVATE AsVivaldi : public AsCluster {
+class XBT_PRIVATE VivaldiZone : public ClusterZone {
 public:
-  explicit AsVivaldi(As* father, const char* name);
+  explicit VivaldiZone(NetZone* father, const char* name);
 
   void setPeerLink(NetCard* netcard, double bw_in, double bw_out, double lat, const char* coord);
   void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
index 5e29b97..66843fe 100644 (file)
@@ -8,7 +8,7 @@
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 
-#include "simgrid/s4u/As.hpp"
+#include "simgrid/s4u/NetZone.hpp"
 #include "simgrid/s4u/engine.hpp"
 
 #if HAVE_LUA
diff --git a/src/s4u/s4u_as.cpp b/src/s4u/s4u_as.cpp
deleted file mode 100644 (file)
index 9da12af..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved.                                                     */
-
-/* This program is free software; you can redistribute it and/or modify it
- * under the terms of the license (GNU LGPL) which comes with this package. */
-
-#include <xbt/log.h>
-
-#include <simgrid/s4u/host.hpp>
-#include <simgrid/s4u/As.hpp>
-
-#include "src/kernel/routing/NetCard.hpp"
-#include "src/surf/network_interface.hpp" // Link FIXME: move to proper header
-#include "src/surf/surf_routing.hpp"
-
-XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_as,"S4U autonomous systems");
-
-namespace simgrid {
-  namespace s4u {
-
-  simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetCard* src, kernel::routing::NetCard* dst,
-                            kernel::routing::NetCard* gw_src, kernel::routing::NetCard* gw_dst,
-                            std::vector<Link*>* link_list)>
-      As::onRouteCreation;
-
-  As::As(As* father, const char* name) : father_(father), name_(xbt_strdup(name))
-  {
-  }
-  void As::seal()
-  {
-    sealed_ = true;
-  }
-  As::~As()
-  {
-    xbt_dict_cursor_t cursor = nullptr;
-    char* key;
-    AS_t elem;
-    xbt_dict_foreach(children_, cursor, key, elem) { delete (As*)elem; }
-
-    xbt_dict_free(&children_);
-    xbt_free(name_);
-  }
-
-  xbt_dict_t As::children()
-  {
-    return children_;
-  }
-  char* As::name()
-  {
-    return name_;
-  }
-  As* As::father()
-  {
-    return father_;
-  }
-
-  xbt_dynar_t As::hosts()
-  {
-    xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr);
-
-    for (auto card : vertices_) {
-      s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->name());
-      if (host != nullptr)
-        xbt_dynar_push(res, &host);
-    }
-    return res;
-  }
-
-  int As::addComponent(kernel::routing::NetCard* elm)
-  {
-    vertices_.push_back(elm);
-    return vertices_.size() - 1; // The rank of the newly created object
-  }
-
-  void As::addRoute(sg_platf_route_cbarg_t /*route*/)
-  {
-    xbt_die("AS %s does not accept new routes (wrong class).", name_);
-  }
-
-}  }; // namespace simgrid::s4u
index 439771a..ca018c8 100644 (file)
@@ -7,13 +7,12 @@
 
 #include "instr/instr_interface.h"
 #include "mc/mc.h"
-#include "simgrid/s4u/As.hpp"
 #include "simgrid/s4u/Mailbox.hpp"
+#include "simgrid/s4u/NetZone.hpp"
 #include "simgrid/s4u/engine.hpp"
 #include "simgrid/s4u/host.hpp"
 #include "simgrid/s4u/storage.hpp"
 #include "simgrid/simix.h"
-#include "simgrid/simix.h"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/routing/NetZoneImpl.hpp"
 
@@ -86,21 +85,21 @@ void Engine::run() {
   }
 }
 
-s4u::As *Engine::rootAs()
+s4u::NetZone* Engine::rootAs()
 {
   return pimpl->rootAs_;
 }
 
-static s4u::As *asByNameRecursive(s4u::As *current, const char *name)
+static s4u::NetZone* asByNameRecursive(s4u::NetZone* current, const char* name)
 {
   if(!strcmp(current->name(), name))
     return current;
 
   xbt_dict_cursor_t cursor = nullptr;
   char *key;
-  AS_t elem;
+  NetZone_t elem;
   xbt_dict_foreach(current->children(), cursor, key, elem) {
-    simgrid::s4u::As *tmp = asByNameRecursive(elem, name);
+    simgrid::s4u::NetZone* tmp = asByNameRecursive(elem, name);
     if (tmp != nullptr )
         return tmp;
   }
@@ -108,7 +107,8 @@ static s4u::As *asByNameRecursive(s4u::As *current, const char *name)
 }
 
 /** @brief Retrieve the AS of the given name (or nullptr if not found) */
-As *Engine::asByNameOrNull(const char *name) {
+NetZone* Engine::asByNameOrNull(const char* name)
+{
   return asByNameRecursive(rootAs(),name);
 }
 
index 254dba7..6ae075f 100644 (file)
@@ -134,7 +134,7 @@ int Host::pstatesCount() const {
  */
 void Host::routeTo(Host* dest, std::vector<Link*>* links, double* latency)
 {
-  simgrid::kernel::routing::AsImpl::getGlobalRoute(pimpl_netcard, dest->pimpl_netcard, links, latency);
+  simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netcard, dest->pimpl_netcard, links, latency);
   if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
     XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", cname(), dest->cname(),
                (latency == nullptr ? -1 : *latency));
diff --git a/src/s4u/s4u_netzone.cpp b/src/s4u/s4u_netzone.cpp
new file mode 100644 (file)
index 0000000..67e20a2
--- /dev/null
@@ -0,0 +1,80 @@
+/* Copyright (c) 2006-2016. The SimGrid Team. All rights reserved.          */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "xbt/log.h"
+
+#include "simgrid/s4u/NetZone.hpp"
+#include "simgrid/s4u/host.hpp"
+#include "src/kernel/routing/NetCard.hpp"
+#include "src/surf/network_interface.hpp" // Link FIXME: move to proper header
+#include "src/surf/surf_routing.hpp"
+
+XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_as, "S4U autonomous systems");
+
+namespace simgrid {
+namespace s4u {
+
+simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetCard* src, kernel::routing::NetCard* dst,
+                          kernel::routing::NetCard* gw_src, kernel::routing::NetCard* gw_dst,
+                          std::vector<Link*>* link_list)>
+    NetZone::onRouteCreation;
+
+NetZone::NetZone(NetZone* father, const char* name) : father_(father), name_(xbt_strdup(name))
+{
+}
+void NetZone::seal()
+{
+  sealed_ = true;
+}
+NetZone::~NetZone()
+{
+  xbt_dict_cursor_t cursor = nullptr;
+  char* key;
+  NetZone_t elem;
+  xbt_dict_foreach (children_, cursor, key, elem) {
+    delete (NetZone*)elem;
+  }
+
+  xbt_dict_free(&children_);
+  xbt_free(name_);
+}
+
+xbt_dict_t NetZone::children()
+{
+  return children_;
+}
+char* NetZone::name()
+{
+  return name_;
+}
+NetZone* NetZone::father()
+{
+  return father_;
+}
+
+xbt_dynar_t NetZone::hosts()
+{
+  xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), nullptr);
+
+  for (auto card : vertices_) {
+    s4u::Host* host = simgrid::s4u::Host::by_name_or_null(card->name());
+    if (host != nullptr)
+      xbt_dynar_push(res, &host);
+  }
+  return res;
+}
+
+int NetZone::addComponent(kernel::routing::NetCard* elm)
+{
+  vertices_.push_back(elm);
+  return vertices_.size() - 1; // The rank of the newly created object
+}
+
+void NetZone::addRoute(sg_platf_route_cbarg_t /*route*/)
+{
+  xbt_die("NetZone '%s' does not accept new routes (wrong class).", name_);
+}
+}
+}; // namespace simgrid::s4u
index b28c1e0..3f45544 100644 (file)
@@ -123,21 +123,21 @@ static void linkContainers (container_t src, container_t dst, xbt_dict_t filter)
   XBT_DEBUG ("  linkContainers %s <-> %s", src->name, dst->name);
 }
 
-static void recursiveGraphExtraction (simgrid::s4u::As *as, container_t container, xbt_dict_t filter)
+static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t container, xbt_dict_t filter)
 {
   if (!TRACE_platform_topology()){
     XBT_DEBUG("Graph extraction disabled by user.");
     return;
   }
-  XBT_DEBUG ("Graph extraction for routing_component = %s", as->name());
-  if (!xbt_dict_is_empty(as->children())){
+  XBT_DEBUG("Graph extraction for NetZone = %s", netzone->name());
+  if (!xbt_dict_is_empty(netzone->children())) {
     xbt_dict_cursor_t cursor = nullptr;
-    AS_t rc_son;
+    NetZone_t nz_son;
     char *child_name;
     //bottom-up recursion
-    xbt_dict_foreach(as->children(), cursor, child_name, rc_son) {
-      container_t child_container = (container_t) xbt_dict_get (container->children, rc_son->name());
-      recursiveGraphExtraction (rc_son, child_container, filter);
+    xbt_dict_foreach (netzone->children(), cursor, child_name, nz_son) {
+      container_t child_container = (container_t)xbt_dict_get(container->children, nz_son->name());
+      recursiveGraphExtraction(nz_son, child_container, filter);
     }
   }
 
@@ -150,7 +150,7 @@ static void recursiveGraphExtraction (simgrid::s4u::As *as, container_t containe
     xbt_dict_cursor_t cursor = nullptr;
     char *edge_name;
 
-    static_cast<simgrid::kernel::routing::AsImpl*>(as)->getGraph(graph, nodes, edges);
+    static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
     xbt_dict_foreach(edges,cursor,edge_name,edge) {
         linkContainers(
           PJ_container_get((const char*) edge->src->data),
@@ -429,22 +429,21 @@ int instr_platform_traced ()
 
 #define GRAPHICATOR_SUPPORT_FUNCTIONS
 
-static void recursiveXBTGraphExtraction (xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges,
-    AS_t as, container_t container)
+static void recursiveXBTGraphExtraction(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, NetZone_t netzone,
+                                        container_t container)
 {
-  if (!xbt_dict_is_empty(as->children())){
+  if (!xbt_dict_is_empty(netzone->children())) {
     xbt_dict_cursor_t cursor = nullptr;
-    AS_t as_child;
+    NetZone_t netzone_child;
     char *child_name;
     //bottom-up recursion
-    xbt_dict_foreach(as->children(), cursor, child_name, as_child) {
-      container_t child_container = (container_t) xbt_dict_get (
-        container->children, as_child->name());
-      recursiveXBTGraphExtraction (graph, nodes, edges, as_child, child_container);
+    xbt_dict_foreach (netzone->children(), cursor, child_name, netzone_child) {
+      container_t child_container = (container_t)xbt_dict_get(container->children, netzone_child->name());
+      recursiveXBTGraphExtraction(graph, nodes, edges, netzone_child, child_container);
     }
   }
 
-  static_cast<simgrid::kernel::routing::AsImpl*>(as)->getGraph(graph, nodes, edges);
+  static_cast<simgrid::kernel::routing::NetZoneImpl*>(netzone)->getGraph(graph, nodes, edges);
 }
 
 xbt_graph_t instr_routing_platform_graph ()
index d99ec96..16d6986 100644 (file)
@@ -5,7 +5,7 @@
 
 #include <unordered_set>
 
-#include <xbt/config.hpp>
+#include "xbt/config.hpp"
 
 #include "ns3/core-module.h"
 #include "ns3/node.h"
@@ -20,7 +20,7 @@
 #include "src/surf/HostImpl.hpp"
 #include "src/surf/surf_private.h"
 
-#include "simgrid/s4u/As.hpp"
+#include "simgrid/s4u/NetZone.hpp"
 #include "simgrid/s4u/engine.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ns3, surf, "Logging specific to the SURF network NS3 module");
@@ -161,7 +161,7 @@ NetworkNS3Model::NetworkNS3Model() : NetworkModel() {
   simgrid::kernel::routing::NetCard::onCreation.connect(&netcardCreation_cb);
   simgrid::surf::on_cluster.connect(&clusterCreation_cb);
   simgrid::surf::on_postparse.connect(&postparse_cb);
-  simgrid::s4u::As::onRouteCreation.connect(&routeCreation_cb);
+  simgrid::s4u::NetZone::onRouteCreation.connect(&routeCreation_cb);
 
   LogComponentEnable("UdpEchoClientApplication", ns3::LOG_LEVEL_INFO);
   LogComponentEnable("UdpEchoServerApplication", ns3::LOG_LEVEL_INFO);
index 3615da6..90c16a2 100644 (file)
@@ -54,8 +54,8 @@ simgrid::xbt::signal<void(void)> on_postparse;
 static int surf_parse_models_setup_already_called = 0;
 
 /** The current AS in the parsing */
-static simgrid::kernel::routing::AsImpl *current_routing = nullptr;
-static simgrid::kernel::routing::AsImpl *routing_get_current()
+static simgrid::kernel::routing::NetZoneImpl* current_routing = nullptr;
+static simgrid::kernel::routing::NetZoneImpl* routing_get_current()
 {
   return current_routing;
 }
@@ -111,10 +111,10 @@ void sg_platf_new_host(sg_platf_host_cbarg_t args)
 /** @brief Add a "router" to the network element list */
 void sg_platf_new_router(sg_platf_router_cbarg_t router)
 {
-  simgrid::kernel::routing::AsImpl* current_routing = routing_get_current();
+  simgrid::kernel::routing::NetZoneImpl* current_routing = routing_get_current();
 
-  if (current_routing->hierarchy_ == simgrid::kernel::routing::AsImpl::RoutingMode::unset)
-    current_routing->hierarchy_ = simgrid::kernel::routing::AsImpl::RoutingMode::base;
+  if (current_routing->hierarchy_ == simgrid::kernel::routing::NetZoneImpl::RoutingMode::unset)
+    current_routing->hierarchy_ = simgrid::kernel::routing::NetZoneImpl::RoutingMode::base;
   xbt_assert(nullptr == xbt_lib_get_or_null(as_router_lib, router->id, ROUTING_ASR_LEVEL),
              "Refusing to create a router named '%s': this name already describes a node.", router->id);
 
@@ -126,7 +126,7 @@ void sg_platf_new_router(sg_platf_router_cbarg_t router)
   if (router->coord && strcmp(router->coord, ""))
     new simgrid::kernel::routing::vivaldi::Coords(netcard, router->coord);
 
-  auto cluster = dynamic_cast<simgrid::kernel::routing::AsCluster*>(current_routing);
+  auto cluster = dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing);
   if(cluster != nullptr)
     cluster->router_ = static_cast<simgrid::kernel::routing::NetCard*>(xbt_lib_get_or_null(as_router_lib, router->id, ROUTING_ASR_LEVEL));
 
@@ -169,10 +169,10 @@ void sg_platf_new_link(sg_platf_link_cbarg_t link){
 
 void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
 {
-  using simgrid::kernel::routing::AsCluster;
-  using simgrid::kernel::routing::AsClusterDragonfly;
-  using simgrid::kernel::routing::AsClusterFatTree;
-  using simgrid::kernel::routing::AsClusterTorus;
+  using simgrid::kernel::routing::ClusterZone;
+  using simgrid::kernel::routing::DragonflyZone;
+  using simgrid::kernel::routing::FatTreeZone;
+  using simgrid::kernel::routing::TorusZone;
 
   int rankId=0;
 
@@ -196,7 +196,7 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
     break;
   }
   sg_platf_new_AS_begin(&AS);
-  simgrid::kernel::routing::AsCluster *current_as = static_cast<AsCluster*>(routing_get_current());
+  simgrid::kernel::routing::ClusterZone* current_as = static_cast<ClusterZone*>(routing_get_current());
   current_as->parse_specific_arguments(cluster);
 
   if(cluster->loopback_bw!=0 || cluster->loopback_lat!=0){
@@ -260,7 +260,7 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
       linkDown = Link::byName(tmp_link);
       free(tmp_link);
 
-      auto as_cluster = static_cast<AsCluster*>(current_as);
+      auto as_cluster = static_cast<ClusterZone*>(current_as);
       as_cluster->privateLinks_.insert({rankId * as_cluster->linkCountPerNode_, {linkUp, linkDown}});
     }
 
@@ -285,7 +285,7 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
 
     //call the cluster function that adds the others links
     if (cluster->topology == SURF_CLUSTER_FAT_TREE) {
-      static_cast<AsClusterFatTree*>(current_as)->addProcessingNode(i);
+      static_cast<FatTreeZone*>(current_as)->addProcessingNode(i);
     }
     else {
       current_as->create_links_for_node(cluster, i, rankId,
@@ -333,7 +333,8 @@ void sg_platf_new_cluster(sg_platf_cluster_cbarg_t cluster)
   delete cluster->radicals;
 }
 void routing_cluster_add_backbone(simgrid::surf::Link* bb) {
-  simgrid::kernel::routing::AsCluster *cluster = dynamic_cast<simgrid::kernel::routing::AsCluster*>(current_routing);
+  simgrid::kernel::routing::ClusterZone* cluster =
+      dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing);
 
   xbt_assert(cluster, "Only hosts from Cluster can get a backbone.");
   xbt_assert(nullptr == cluster->backbone_, "Cluster %s already has a backbone link!", cluster->name());
@@ -571,7 +572,7 @@ void sg_platf_new_process(sg_platf_process_cbarg_t process)
 
 void sg_platf_new_peer(sg_platf_peer_cbarg_t peer)
 {
-  simgrid::kernel::routing::AsVivaldi* as = dynamic_cast<simgrid::kernel::routing::AsVivaldi*>(current_routing);
+  simgrid::kernel::routing::VivaldiZone* as = dynamic_cast<simgrid::kernel::routing::VivaldiZone*>(current_routing);
   xbt_assert(as, "<peer> tag can only be used in Vivaldi ASes");
 
   std::vector<double> speedPerPstate;
@@ -645,7 +646,7 @@ static void surf_config_models_setup()
  *
  * @param AS the parameters defining the AS to build.
  */
-simgrid::s4u::As * sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
+simgrid::s4u::NetZone* sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
 {
   if (!surf_parse_models_setup_already_called) {
     /* Initialize the surf models. That must be done after we got all config, and before we need the models.
@@ -664,37 +665,37 @@ simgrid::s4u::As * sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
 
 
   /* search the routing model */
-  simgrid::kernel::routing::AsImpl *new_as = nullptr;
+  simgrid::kernel::routing::NetZoneImpl* new_as = nullptr;
   switch(AS->routing){
     case A_surfxml_AS_routing_Cluster:
-      new_as = new simgrid::kernel::routing::AsCluster(current_routing, AS->id);
+      new_as = new simgrid::kernel::routing::ClusterZone(current_routing, AS->id);
       break;
     case A_surfxml_AS_routing_ClusterDragonfly:
-      new_as = new simgrid::kernel::routing::AsClusterDragonfly(current_routing, AS->id);
+      new_as = new simgrid::kernel::routing::DragonflyZone(current_routing, AS->id);
       break;
     case A_surfxml_AS_routing_ClusterTorus:
-      new_as = new simgrid::kernel::routing::AsClusterTorus(current_routing, AS->id);
+      new_as = new simgrid::kernel::routing::TorusZone(current_routing, AS->id);
       break;
     case A_surfxml_AS_routing_ClusterFatTree:
-      new_as = new simgrid::kernel::routing::AsClusterFatTree(current_routing, AS->id);
+      new_as = new simgrid::kernel::routing::FatTreeZone(current_routing, AS->id);
       break;
     case A_surfxml_AS_routing_Dijkstra:
-      new_as = new simgrid::kernel::routing::AsDijkstra(current_routing, AS->id, 0);
+      new_as = new simgrid::kernel::routing::DijkstraZone(current_routing, AS->id, 0);
       break;
     case A_surfxml_AS_routing_DijkstraCache:
-      new_as = new simgrid::kernel::routing::AsDijkstra(current_routing, AS->id, 1);
+      new_as = new simgrid::kernel::routing::DijkstraZone(current_routing, AS->id, 1);
       break;
     case A_surfxml_AS_routing_Floyd:
-      new_as = new simgrid::kernel::routing::AsFloyd(current_routing, AS->id);
+      new_as = new simgrid::kernel::routing::FloydZone(current_routing, AS->id);
       break;
     case A_surfxml_AS_routing_Full:
-      new_as = new simgrid::kernel::routing::AsFull(current_routing, AS->id);
+      new_as = new simgrid::kernel::routing::FullZone(current_routing, AS->id);
       break;
     case A_surfxml_AS_routing_None:
-      new_as = new simgrid::kernel::routing::AsNone(current_routing, AS->id);
+      new_as = new simgrid::kernel::routing::EmptyZone(current_routing, AS->id);
       break;
     case A_surfxml_AS_routing_Vivaldi:
-      new_as = new simgrid::kernel::routing::AsVivaldi(current_routing, AS->id);
+      new_as = new simgrid::kernel::routing::VivaldiZone(current_routing, AS->id);
       break;
     default:
       xbt_die("Not a valid model!");
@@ -708,8 +709,8 @@ simgrid::s4u::As * sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
 
   } else {
     /* set the father behavior */
-    if (current_routing->hierarchy_ == simgrid::kernel::routing::AsImpl::RoutingMode::unset)
-      current_routing->hierarchy_ = simgrid::kernel::routing::AsImpl::RoutingMode::recursive;
+    if (current_routing->hierarchy_ == simgrid::kernel::routing::NetZoneImpl::RoutingMode::unset)
+      current_routing->hierarchy_ = simgrid::kernel::routing::NetZoneImpl::RoutingMode::recursive;
     /* add to the sons dictionary */
     xbt_dict_set(current_routing->children(), AS->id, (void *) new_as, nullptr);
   }
@@ -733,7 +734,7 @@ void sg_platf_new_AS_seal()
 {
   xbt_assert(current_routing, "Cannot seal the current AS: none under construction");
   current_routing->seal();
-  current_routing = static_cast<simgrid::kernel::routing::AsImpl*>(current_routing->father());
+  current_routing = static_cast<simgrid::kernel::routing::NetZoneImpl*>(current_routing->father());
 
   if (TRACE_is_enabled())
     sg_instr_AS_end();
@@ -744,8 +745,8 @@ void sg_platf_new_hostlink(sg_platf_host_link_cbarg_t hostlink)
 {
   simgrid::kernel::routing::NetCard *netcard = sg_host_by_name(hostlink->id)->pimpl_netcard;
   xbt_assert(netcard, "Host '%s' not found!", hostlink->id);
-  xbt_assert(dynamic_cast<simgrid::kernel::routing::AsCluster*>(current_routing),
-      "Only hosts from Cluster and Vivaldi ASes can get an host_link.");
+  xbt_assert(dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing),
+             "Only hosts from Cluster and Vivaldi ASes can get an host_link.");
 
   simgrid::surf::Link* linkUp   = Link::byName(hostlink->link_up);
   simgrid::surf::Link* linkDown = Link::byName(hostlink->link_down);
@@ -753,7 +754,7 @@ void sg_platf_new_hostlink(sg_platf_host_link_cbarg_t hostlink)
   xbt_assert(linkUp, "Link '%s' not found!", hostlink->link_up);
   xbt_assert(linkDown, "Link '%s' not found!", hostlink->link_down);
 
-  auto as_cluster = static_cast<simgrid::kernel::routing::AsCluster*>(current_routing);
+  auto as_cluster = static_cast<simgrid::kernel::routing::ClusterZone*>(current_routing);
 
   if (as_cluster->privateLinks_.find(netcard->id()) != as_cluster->privateLinks_.end())
     surf_parse_error("Host_link for '%s' is already defined!",hostlink->id);
index b68c575..729517c 100644 (file)
@@ -51,7 +51,7 @@ extern XBT_PRIVATE simgrid::trace_mgr::future_evt_set *future_evt_set;
 
 XBT_PUBLIC(void) storage_register_callbacks();
 
-XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, AS_t rc);
+XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, NetZone_t rc);
 XBT_PRIVATE void parse_after_config();
 
 /********** Tracing **********/
index 6a36915..add8c25 100644 (file)
@@ -200,7 +200,7 @@ void routing_cluster_add_backbone(Link* bb);
 XBT_PUBLIC(void) sg_platf_begin();  // Start a new platform
 XBT_PUBLIC(void) sg_platf_end(); // Finish the creation of the platform
 
-XBT_PUBLIC(simgrid::s4u::As*) sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS); // Begin description of new AS
+XBT_PUBLIC(simgrid::s4u::NetZone*) sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS); // Begin description of new AS
 XBT_PUBLIC(void) sg_platf_new_AS_seal();                     // That AS is fully described
 
 XBT_PUBLIC(void) sg_platf_new_host   (sg_platf_host_cbarg_t   host);   // Add an host   to the currently described AS
index 259d24a..effe0d5 100644 (file)
@@ -155,7 +155,7 @@ int main(int argc, char **argv)
         host2 = hosts[it_dst];
         std::vector<Link*> *route = new std::vector<Link*>();
         value2 = host2->pimpl_netcard;
-        simgrid::kernel::routing::AsImpl::getGlobalRoute(value1, value2, route, nullptr);
+        simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, value2, route, nullptr);
         if (! route->empty()){
           std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", host1->cname(), host2->cname());
           for (auto link: *route)
@@ -169,7 +169,7 @@ int main(int argc, char **argv)
         if(value2->isRouter()){
           std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", host1->cname(), dst);
           std::vector<Link*> *route = new std::vector<Link*>();
-          simgrid::kernel::routing::AsImpl::getGlobalRoute(value1, value2, route, nullptr);
+          simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, value2, route, nullptr);
           for (auto link : *route)
             std::printf("<link_ctn id=\"%s\"/>",link->getName());
           delete route;
@@ -186,7 +186,7 @@ int main(int argc, char **argv)
           if(value2->isRouter()){
             std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", src, dst);
             std::vector<Link*> *route = new std::vector<Link*>();
-            simgrid::kernel::routing::AsImpl::getGlobalRoute(value1, value2, route, nullptr);
+            simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, value2, route, nullptr);
             for(auto link :*route)
               std::printf("<link_ctn id=\"%s\"/>",link->getName());
             delete route;
@@ -198,7 +198,7 @@ int main(int argc, char **argv)
           std::printf("  <route src=\"%s\" dst=\"%s\">\n  ", src, host2->cname());
           std::vector<Link*> *route = new std::vector<Link*>();
           value2 = host2->pimpl_netcard;
-          simgrid::kernel::routing::AsImpl::getGlobalRoute(value1, value2, route, nullptr);
+          simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, value2, route, nullptr);
           for(auto link : *route)
             std::printf("<link_ctn id=\"%s\"/>",link->getName());
           delete route;
index e2f7c19..1a1d89d 100644 (file)
@@ -391,15 +391,15 @@ endif()
 
 set(S4U_SRC
   src/s4u/s4u_actor.cpp
-  src/s4u/s4u_as.cpp
   src/s4u/s4u_activity.cpp
+  src/s4u/s4u_conditionVariable.cpp
   src/s4u/s4u_comm.cpp
   src/s4u/s4u_engine.cpp  
   src/s4u/s4u_file.cpp  
   src/s4u/s4u_host.cpp  
   src/s4u/s4u_mailbox.cpp
   src/s4u/s4u_mutex.cpp
-  src/s4u/s4u_conditionVariable.cpp
+  src/s4u/s4u_netzone.cpp
   src/s4u/s4u_storage.cpp
 )
 
@@ -653,14 +653,14 @@ set(headers_to_install
   include/simgrid/s4u/forward.hpp
   include/simgrid/s4u/Activity.hpp
   include/simgrid/s4u/Actor.hpp
-  include/simgrid/s4u/As.hpp
   include/simgrid/s4u/comm.hpp
+  include/simgrid/s4u/conditionVariable.hpp
   include/simgrid/s4u/engine.hpp  
   include/simgrid/s4u/file.hpp  
   include/simgrid/s4u/host.hpp  
   include/simgrid/s4u/Mailbox.hpp
   include/simgrid/s4u/Mutex.hpp
-  include/simgrid/s4u/conditionVariable.hpp
+  include/simgrid/s4u/NetZone.hpp
   include/simgrid/s4u/storage.hpp  
   include/simgrid/s4u/VirtualMachine.hpp  
   include/simgrid/s4u.hpp