]> AND Public Git Repository - simgrid.git/blobdiff - include/simgrid/s4u/NetZone.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Prefer a reference for first parameter of {test,wait}_{all,any}.
[simgrid.git] / include / simgrid / s4u / NetZone.hpp
index 085788eb389bfdb1c1a9142a29082692938252cd..9daaf7b7502cba8a9a27ddd5a1aab8b48d372f0f 100644 (file)
@@ -129,6 +129,8 @@ public:
   s4u::Link* create_link(const std::string& name, const std::vector<std::string>& bandwidths);
   s4u::Link* create_link(const std::string& name, const std::string& bandwidth);
 
+  kernel::resource::NetworkModelIntf* get_network_model() const;
+
   /**
    * @brief Make a router within that NetZone
    *
@@ -141,7 +143,7 @@ public:
 
 private:
   /** @brief Auxiliary function to get list of LinkImpl */
-  static std::vector<kernel::resource::LinkImpl*> get_link_list_impl(const std::vector<Link*> link_list);
+  static std::vector<kernel::resource::LinkImpl*> get_link_list_impl(const std::vector<Link*>& link_list);
 };
 
 // External constructors so that the types (and the types of their content) remain hidden
@@ -173,6 +175,13 @@ struct ClusterCallbacks {
   /**
    * @brief Callback used to set the links for some leaf of the cluster (Torus, FatTree, etc)
    *
+   * The coord parameter depends on the cluster being created:
+   * - Torus: Direct translation of the Torus' dimensions, e.g. (0, 0, 0) for a 3-D Torus
+   * - Fat-Tree: A pair (level in the tree, id), e.g. (0, 0): first leaf and (1,0): first switch at level 1.
+   * - Dragonfly: a tuple (group, chassis, blades/routers, nodes), e.g. (0, 0, 0, 0) for first node in the cluster.
+   * Important: To identify the router inside a "group, chassis, blade", we use MAX_UINT in the last parameter (e.g. 0,
+   * 0, 0, 4294967295).
+   *
    * @param zone: The newly create zone, needed for creating new resources (hosts, links)
    * @param coord: the coordinates of the element
    * @param id: Internal identifier of the element
@@ -183,9 +192,10 @@ struct ClusterCallbacks {
   std::function<ClusterNetPointCb> netpoint;
   std::function<ClusterLinkCb> loopback = {};
   std::function<ClusterLinkCb> limiter  = {};
-  explicit ClusterCallbacks(std::function<ClusterNetPointCb> set_netpoint) : netpoint(set_netpoint){/*nothing to do */};
-  ClusterCallbacks(std::function<ClusterNetPointCb> set_netpoint, std::function<ClusterLinkCb> set_loopback,
-                   std::function<ClusterLinkCb> set_limiter)
+  explicit ClusterCallbacks(const std::function<ClusterNetPointCb>& set_netpoint)
+      : netpoint(set_netpoint){/*nothing to do */};
+  ClusterCallbacks(const std::function<ClusterNetPointCb>& set_netpoint,
+                   const std::function<ClusterLinkCb>& set_loopback, const std::function<ClusterLinkCb>& set_limiter)
       : netpoint(set_netpoint), loopback(set_loopback), limiter(set_limiter){/*nothing to do */};
 };
 /**