Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Torus/Fat-Tree/Dragonfly: Aggregate callbacks
[simgrid.git] / include / simgrid / kernel / routing / ClusterZone.hpp
index e44037d..1280241 100644 (file)
@@ -69,6 +69,7 @@ class ClusterZone : public NetZoneImpl {
   /* We use a map instead of a std::vector here because that's a sparse vector. Some values may not exist */
   /* The pair is {link_up, link_down} */
   std::unordered_map<unsigned int, std::pair<resource::LinkImpl*, resource::LinkImpl*>> private_links_;
+  std::unordered_map<unsigned int, NetPoint*> gateways_; //!< list of gateways for leafs (if they're netzones)
   resource::LinkImpl* backbone_    = nullptr;
   NetPoint* router_                = nullptr;
   bool has_limiter_                = false;
@@ -90,6 +91,10 @@ public:
   void set_backbone(resource::LinkImpl* bb) { backbone_ = bb; }
   bool has_backbone() const { return backbone_ != nullptr; }
   void set_router(NetPoint* router) { router_ = router; }
+  /** @brief Sets gateway for the leaf */
+  void set_gateway(unsigned int position, NetPoint* gateway);
+  /** @brief Gets gateway for the leaf or nullptr */
+  NetPoint* get_gateway(unsigned int position);
   void add_private_link_at(unsigned int position, std::pair<resource::LinkImpl*, resource::LinkImpl*> link);
   bool private_link_exists_at(unsigned int position) const
   {
@@ -100,11 +105,7 @@ public:
   void get_graph(const s_xbt_graph_t* graph, std::map<std::string, xbt_node_t, std::less<>>* nodes,
                  std::map<std::string, xbt_edge_t, std::less<>>* edges) override;
 
-  virtual void create_links_for_node(ClusterCreationArgs* cluster, int id, int rank, unsigned int position);
-  virtual void parse_specific_arguments(ClusterCreationArgs*)
-  {
-    /* this routing method does not require any specific argument */
-  }
+  void create_links_for_node(const ClusterCreationArgs* cluster, int id, int rank, unsigned int position);
 
   unsigned int node_pos(int id) const { return id * num_links_per_node_; }
   unsigned int node_pos_with_loopback(int id) const { return node_pos(id) + (has_loopback_ ? 1 : 0); }
@@ -112,6 +113,10 @@ public:
   {
     return node_pos_with_loopback(id) + (has_limiter_ ? 1 : 0);
   }
+  /** Fill the leaf retriving netpoint from a user's callback */
+  void fill_leaf_from_cb(unsigned int position, const std::vector<unsigned int>& dimensions,
+                         const s4u::ClusterCallbacks& set_callbacks, NetPoint** node_netpoint, s4u::Link** lb_link,
+                         s4u::Link** limiter_link);
 };
 } // namespace routing
 } // namespace kernel