From 96faa87b7b3b736fee768c423584c310925131f6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Castelli?= Date: Thu, 17 Apr 2014 11:14:44 +0200 Subject: [PATCH] generateDotFile, to generate dot files for fat trees --- src/surf/surf_routing_cluster_fat_tree.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/surf/surf_routing_cluster_fat_tree.cpp b/src/surf/surf_routing_cluster_fat_tree.cpp index df02a8def8..5057c98ba9 100644 --- a/src/surf/surf_routing_cluster_fat_tree.cpp +++ b/src/surf/surf_routing_cluster_fat_tree.cpp @@ -64,7 +64,6 @@ void AsClusterFatTree::create_links(sg_platf_cluster_cbarg_t cluster) { this->nodes[k]->position = j; } } - } @@ -173,16 +172,16 @@ void AsClusterFatTree::generateDotFile(const string& filename) const { if(file.is_open()) { // That could also be greatly clarified with C++11 - // std::map,FatTreeLink*>::iterator iter; - // file << "graph AsClusterFatTree {\n"; - // for (iter = this->links.begin() ; iter != this->links.end() ; iter++ ) { - // for (int j = 0 ; j < iter->second->ports ; j++) { - // file << iter->second->source->id - // << " -- " - // << iter->second->destination->id - // << ";\n"; - // } - //} + std::map,FatTreeLink*>::const_iterator iter; + file << "graph AsClusterFatTree {\n"; + for (iter = this->links.begin() ; iter != this->links.end() ; iter++ ) { + for (unsigned int j = 0 ; j < iter->second->ports ; j++) { + file << iter->second->source->id + << " -- " + << iter->second->destination->id + << ";\n"; + } + } file << "}"; file.close(); } -- 2.20.1