std::vector<FatTreeLink*> links_;
std::vector<unsigned int> nodes_by_level_;
- ClusterCreationArgs* cluster_ = nullptr;
-
void add_link(FatTreeNode* parent, unsigned int parent_port, FatTreeNode* child, unsigned int child_port);
int get_level_position(const unsigned int level);
+ void generate_switches(const s4u::ClusterCallbacks& set_callbacks);
void generate_labels();
- void generate_switches();
int connect_node_to_parents(FatTreeNode* node);
bool are_related(FatTreeNode* parent, FatTreeNode* child) const;
bool is_in_sub_tree(FatTreeNode* root, FatTreeNode* node) const;
FatTreeZone(const FatTreeZone&) = delete;
FatTreeZone& operator=(const FatTreeZone&) = delete;
~FatTreeZone() override;
- void get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* into, double* latency) override;
+ void get_local_route(NetPoint* src, NetPoint* dst, Route* into, double* latency) override;
- /** @brief Read the parameters in topo_parameters field.
+ /**
+ * @brief Parse the topology parameters from string format
*
- * It will also store the cluster for future use.
+ * @param topo_parameters String with topology, e.g. "2;4,4;1,2;1,2"
*/
- void parse_specific_arguments(ClusterCreationArgs* cluster) override;
+ static s4u::FatTreeParams parse_topo_parameters(const std::string& topo_parameters);
+ /** @brief Checks topology parameters */
+ static void check_topology(unsigned int n_levels, const std::vector<unsigned int>& down_links,
+ const std::vector<unsigned int>& up_links, const std::vector<unsigned int>& link_count);
+ /** @brief Set FatTree topology */
+ void set_topology(unsigned int n_levels, const std::vector<unsigned int>& down_links,
+ const std::vector<unsigned int>& up_links, const std::vector<unsigned int>& link_count);
void add_processing_node(int id, resource::LinkImpl* limiter, resource::LinkImpl* loopback);
+ /**
+ * @brief Build upper levels (switchs) in Fat-Tree
+ *
+ * Suppose that set_topology and add_processing_node have already been called
+ */
+ void build_upper_levels(const s4u::ClusterCallbacks& set_callbacks);
void generate_dot_file(const std::string& filename = "fat_tree.dot") const;
};
} // namespace routing