Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Avoid costly exceptions when looking into a map.
[simgrid.git] / src / kernel / routing / TorusZone.cpp
index dca285d..399ac2e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2017. 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. */
@@ -97,7 +97,7 @@ void TorusZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster)
 void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
 {
 
-  XBT_VERB("torus getLocalRoute from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), dst->name().c_str(),
+  XBT_VERB("torus getLocalRoute from '%s'[%u] to '%s'[%u]", src->name().c_str(), src->id(), dst->name().c_str(),
            dst->id());
 
   if (dst->isRouter() || src->isRouter())
@@ -116,7 +116,6 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
    * Dimension based routing routes through each dimension consecutively
    * TODO Change to dynamic assignment
    */
-  unsigned int dim_product = 1;
   unsigned int current_node = src->id();
   unsigned int next_node    = 0;
   /*
@@ -142,7 +141,7 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
   bool use_lnk_up = false; // Is this link of the form "cur -> next" or "next -> cur"?
   // false means: next -> cur
   while (current_node != dst->id()) {
-    dim_product = 1; // First, we will route in x-dimension
+    unsigned int dim_product = 1; // First, we will route in x-dimension
     int j=0;
     for (auto cur_dim : dimensions_){
       // current_node/dim_product = position in current dimension
@@ -176,7 +175,7 @@ void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg
 
           assert(linkOffset >= 0);
         }
-        XBT_DEBUG("torus_get_route_and_latency - current_node: %i, next_node: %u, linkOffset is %i", current_node,
+        XBT_DEBUG("torus_get_route_and_latency - current_node: %u, next_node: %u, linkOffset is %i", current_node,
                   next_node, linkOffset);
         break;
       }