-/* Copyright (c) 2014-2019. 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)
void TorusZone::get_local_route(NetPoint* src, NetPoint* dst, RouteCreationArgs* route, double* lat)
{
-
XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->get_cname(), src->id(), dst->get_cname(), dst->id());
if (dst->is_router() || src->is_router())
* 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[dsize];
- unsigned int targetCoords[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];
const unsigned cur_dim = dimensions_[j];
// current_node/dim_product = position in current dimension
if ((current_node / dim_product) % cur_dim != (dst->id() / dim_product) % cur_dim) {
-
if ((targetCoords[j] > myCoords[j] &&
targetCoords[j] <= myCoords[j] + cur_dim / 2) // Is the target node on the right, without the wrap-around?
|| (myCoords[j] > cur_dim / 2 &&
current_node = next_node;
}
}
-}
-}
-} // namespace
+} // namespace routing
+} // namespace kernel
+} // namespace simgrid