From: Stéphane Castelli Date: Mon, 14 Apr 2014 08:09:06 +0000 (+0200) Subject: Beginning of the implemenation of fat tree. Parsing methods for special arguments... X-Git-Tag: v3_11~122 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8e188c3c865f04061104d5fb25c37171cfe8cf1f Beginning of the implemenation of fat tree. Parsing methods for special arguments related to this kind of clusters. --- diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index 047cbd2736..e85b1bd727 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -124,9 +124,11 @@ set(EXTRA_DIST src/xbt/win32_ucontext.c tools/tesh/run_context.h tools/tesh/tesh.h + src/surf/surf_routing_cluster_fat_tree.hpp ) set(SMPI_SRC + src/surf/surf_routing_cluster_fat_tree.cpp src/smpi/instr_smpi.c src/smpi/smpi_base.c src/smpi/smpi_bench.c diff --git a/src/surf/surf_routing_cluster_fat_tree.cpp b/src/surf/surf_routing_cluster_fat_tree.cpp new file mode 100644 index 0000000000..f6ceeefe64 --- /dev/null +++ b/src/surf/surf_routing_cluster_fat_tree.cpp @@ -0,0 +1,75 @@ +#include "surf_routing_cluster_fat_tree.hpp" + +#include +#include + + +AsClusterFatTree::AsClusterFatTree() : levels(0) {} + + + +void AsClusterFatTree::getRouteAndLatency(RoutingEdgePtr src, + RoutingEdgePtr dst, + sg_platf_route_cbarg_t into, + double *latency) { + // TODO +} + +void AsClusterFatTree::create_links() { + if(this->levels == 0) { + return; + } + + // for (unsigned int i = 0 ; i < this->levels) + +} + + + +void AsClusterFatTree::parse_specific_arguments(sg_platf_cluster_cbarg_t + cluster) { + std::vector parameters; + std::vector tmp; + boost::split(parameters, cluster->topo_parameters, boost::is_any_of(";")); + + if (parameters.size() != 4){ + surf_parse_error("Fat trees are defined by the levels number et 3 vectors," + " see the documentation for more informations"); + // Well, there's no doc, yet + } + + // The first parts of topo_parameters should be the levels number + this->levels = std::atoi(tmp[0].c_str()); + + // Then, a l-sized vector standing for the childs number by level + boost::split(tmp, parameters[1], boost::is_any_of(",")); + if(tmp.size() != this->levels) { + surf_parse_error("Fat trees are defined by the levels number et 3 vectors," + " see the documentation for more informations"); + } + for(unsigned int i = 0 ; i < tmp.size() ; i++){ + this->lowerLevelNodesNumber.push_back(std::atoi(tmp[i].c_str())); + } + + // Then, a l-sized vector standing for the parents number by level + boost::split(tmp, parameters[2], boost::is_any_of(",")); + if(tmp.size() != this->levels) { + surf_parse_error("Fat trees are defined by the levels number et 3 vectors," + " see the documentation for more informations"); + } + for(unsigned int i = 0 ; i < tmp.size() ; i++){ + this->upperLevelNodesNumber.push_back(std::atoi(tmp[i].c_str())); + } + + // Finally, a l-sized vector standing for the ports number with the lower level + boost::split(tmp, parameters[3], boost::is_any_of(",")); + if(tmp.size() != this->levels) { + surf_parse_error("Fat trees are defined by the levels number et 3 vectors," + " see the documentation for more informations"); + + } + for(unsigned int i = 0 ; i < tmp.size() ; i++){ + this->lowerLevelPortsNumber.push_back(std::atoi(tmp[i].c_str())); + } +} +