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