Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Beginning of the implemenation of fat tree. Parsing methods for special arguments...
authorStéphane Castelli <stephane.castelli@loria.fr>
Mon, 14 Apr 2014 08:09:06 +0000 (10:09 +0200)
committerStéphane Castelli <stephane.castelli@loria.fr>
Mon, 14 Apr 2014 08:09:06 +0000 (10:09 +0200)
buildtools/Cmake/DefinePackages.cmake
src/surf/surf_routing_cluster_fat_tree.cpp [new file with mode: 0644]

index 047cbd2..e85b1bd 100644 (file)
@@ -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 (file)
index 0000000..f6ceeef
--- /dev/null
@@ -0,0 +1,75 @@
+#include "surf_routing_cluster_fat_tree.hpp"
+
+#include <boost/algorithm/string/split.hpp>
+#include <boost/algorithm/string/classification.hpp>
+
+
+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<string> parameters;
+  std::vector<string> 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())); 
+  }
+}
+