- for (auto const& src : getVertices()) {
- if (not src->is_router()) {
- xbt_node_t previous = new_xbt_graph_node(graph, src->get_cname(), nodes);
-
- std::pair<surf::LinkImpl*, surf::LinkImpl*> info = private_links_.at(src->id());
-
- if (info.first) { // link up
- xbt_node_t current = new_xbt_graph_node(graph, info.first->get_cname(), nodes);
- new_xbt_graph_edge(graph, previous, current, edges);
-
- if (backbone_) {
- new_xbt_graph_edge(graph, current, backboneNode, edges);
- } else {
- new_xbt_graph_edge(graph, current, routerNode, edges);
- }
- }
-
- if (info.second) { // link down
- xbt_node_t current = new_xbt_graph_node(graph, info.second->get_cname(), nodes);
- new_xbt_graph_edge(graph, previous, current, edges);
-
- if (backbone_) {
- new_xbt_graph_edge(graph, current, backboneNode, edges);
- } else {
- new_xbt_graph_edge(graph, current, routerNode, edges);
- }
+void ClusterBase::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)
+{
+ xbt_assert(node_netpoint, "Invalid node_netpoint parameter");
+ xbt_assert(lb_link, "Invalid lb_link parameter");
+ xbt_assert(limiter_link, "Invalid limiter_link paramater");
+ *lb_link = nullptr;
+ *limiter_link = nullptr;
+
+ // auxiliary function to get dims from index
+ auto index_to_dims = [&dimensions](int index) {
+ std::vector<unsigned int> dims_array(dimensions.size());
+ for (auto i = static_cast<int>(dimensions.size() - 1); i >= 0; --i) {
+ if (index <= 0) {
+ break;