Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into 'master'
[simgrid.git] / src / kernel / routing / TorusZone.cpp
index 6323da9..0c7b0bc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2021. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -61,7 +61,6 @@ void TorusZone::create_links_for_node(ClusterCreationArgs* cluster, int id, int
     private_links_.insert({position + j, {linkUp, linkDown}});
     dim_product *= current_dimension;
   }
-  rank++;
 }
 
 void TorusZone::parse_specific_arguments(ClusterCreationArgs* cluster)
@@ -107,8 +106,8 @@ void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
    * both arrays, we can easily assess whether we need to route into this dimension or not.
    */
   const unsigned int dsize = dimensions_.size();
-  auto* myCoords                = new unsigned int[dsize];
-  auto* targetCoords            = new unsigned int[dsize];
+  std::vector<unsigned int> myCoords(dsize);
+  std::vector<unsigned int> targetCoords(dsize);
   unsigned int dim_size_product = 1;
   for (unsigned i = 0; i < dsize; i++) {
     unsigned cur_dim_size = dimensions_[i];
@@ -185,8 +184,6 @@ void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs*
 
     current_node = next_node;
   }
-  delete[] myCoords;
-  delete[] targetCoords;
 }
 } // namespace routing
 } // namespace kernel