- /* 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<kernel::resource::LinkImpl*, kernel::resource::LinkImpl*>> private_links_;
-
- unsigned int node_pos(int id) { return id * num_links_per_node_; }
- unsigned int node_pos_with_loopback(int id) { return node_pos(id) + (has_loopback_ ? 1 : 0); }
- unsigned int node_pos_with_loopback_limiter(int id) { return node_pos_with_loopback(id) + (has_limiter_ ? 1 : 0); }
-
- void* loopback_ = nullptr;
- kernel::resource::LinkImpl* backbone_ = nullptr;
- NetPoint* router_ = nullptr;
- bool has_limiter_ = false;
- bool has_loopback_ = false;
- unsigned int num_links_per_node_ = 1; /* may be 1 (if only a private link), 2 or 3 (if limiter and loopback) */
+ 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
+ {
+ /* the old and generic implementation of get_graph doesn't make sense for complex clusters */
+ THROW_UNIMPLEMENTED;
+ };
+
+ unsigned long node_pos(unsigned long id) const { return id * num_links_per_node_; }
+ unsigned long node_pos_with_loopback(unsigned long id) const { return node_pos(id) + (has_loopback_ ? 1 : 0); }
+
+public:
+ /** Fill the leaf retriving netpoint from a user's callback */
+ void fill_leaf_from_cb(unsigned long position, const std::vector<unsigned long>& dimensions,
+ const s4u::ClusterCallbacks& set_callbacks, NetPoint** node_netpoint, s4u::Link** lb_link,
+ s4u::Link** limiter_link);
+ /** @brief Set the characteristics of links inside a Cluster zone */
+ virtual void set_link_characteristics(double bw, double lat, s4u::Link::SharingPolicy sharing_policy);
+ unsigned long node_pos_with_loopback_limiter(unsigned long id) const
+ {
+ return node_pos_with_loopback(id) + (has_limiter_ ? 1 : 0);
+ }