X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f4895c3c3d812abc5ae8cce1d75580f7ed4bbf4f..b99f784b5bc219788376c65e06fe86b943353b0a:/src/surf/surf_routing_cluster_fat_tree.hpp diff --git a/src/surf/surf_routing_cluster_fat_tree.hpp b/src/surf/surf_routing_cluster_fat_tree.hpp index fa63eb4a8e..206abb4097 100644 --- a/src/surf/surf_routing_cluster_fat_tree.hpp +++ b/src/surf/surf_routing_cluster_fat_tree.hpp @@ -23,12 +23,13 @@ class FatTreeNode; class FatTreeLink; + class FatTreeNode { public: int id; unsigned int level; // The 0th level represents the leafs of the PGFT unsigned int position; // Position in the level - std::vector label; + std::vector label; /* We can see the sizes sum of the two following vectors as the device * ports number. If we use the notations used in Zahavi's paper, * children.size() = m_level and parents.size() = w_(level+1) @@ -47,13 +48,11 @@ public: /* Links are dependant of the chosen network model, but must implement * NetworkLink */ - NetworkLink* linkUp; // From source to destination - NetworkLink* linkDown; // From destination to source - /* As it is symetric, it might as well be first / second instead - * of source / destination - */ - FatTreeNode *source; - FatTreeNode *destination; + NetworkLink *upLink; + NetworkLink *downLink; + FatTreeNode *upNode; + FatTreeNode *downNode; + }; class AsClusterFatTree : public AsCluster { @@ -68,18 +67,18 @@ public: // double *latency) const; virtual void create_links(sg_platf_cluster_cbarg_t cluster); void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster); - void addComputeNodes(std::vector const& id); + void addComputeNode(int id); void generateDotFile(const string& filename = "fatTree.dot") const; protected: //description of a PGFT (TODO : better doc) unsigned int levels; - std::vector lowerLevelNodesNumber; // number of children by node - std::vector upperLevelNodesNumber; // number of parents by node - std::vector lowerLevelPortsNumber; // ports between each level l and l-1 + std::vector lowerLevelNodesNumber; // number of children by node + std::vector upperLevelNodesNumber; // number of parents by node + std::vector lowerLevelPortsNumber; // ports between each level l and l-1 - std::vector nodes; - std::map, FatTreeLink*> links; + std::map nodes; + std::vector links; std::vector nodesByLevel; void addLink(sg_platf_cluster_cbarg_t cluster, @@ -90,5 +89,6 @@ protected: void generateSwitches(); int connectNodeToParents(sg_platf_cluster_cbarg_t cluster, FatTreeNode *node); bool areRelated(FatTreeNode *parent, FatTreeNode *child); + bool isInSubTree(FatTreeNode *root, FatTreeNode *node); }; #endif