-/* 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. */
int current_dimension = dimensions_[j]; // which dimension are we currently in?
// we need to iterate over all dimensions and create all links there
// The other node the link connects
- int neighbor_rank_id = ((static_cast<int>(rank) / dim_product) % current_dimension == current_dimension - 1)
+ int neighbor_rank_id = ((rank / dim_product) % current_dimension == current_dimension - 1)
? rank - (current_dimension - 1) * dim_product
: rank + dim_product;
// name of neighbor is not right for non contiguous cluster radicals (as id != rank in this case)
private_links_.insert({position + j, {linkUp, linkDown}});
dim_product *= current_dimension;
}
- rank++;
}
void TorusZone::parse_specific_arguments(ClusterCreationArgs* cluster)
* both arrays, we can easily assess whether we need to route into this dimension or not.
*/
const unsigned int dsize = dimensions_.size();
- unsigned int* myCoords = new unsigned int[dsize];
- unsigned int* 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];
current_node = next_node;
}
- delete[] myCoords;
- delete[] targetCoords;
}
} // namespace routing
} // namespace kernel