From: Stéphane Castelli Date: Thu, 17 Apr 2014 09:14:44 +0000 (+0200) Subject: generateDotFile, to generate dot files for fat trees X-Git-Tag: v3_11~110 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/96faa87b7b3b736fee768c423584c310925131f6 generateDotFile, to generate dot files for fat trees --- 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(); }