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
*
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
/**
* @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
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 */};
};
/**