Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a few more implicit conversions removed
authorSUTER Frederic <frederic.suter@cc.in2p3.fr>
Mon, 13 Sep 2021 07:14:39 +0000 (09:14 +0200)
committerSUTER Frederic <frederic.suter@cc.in2p3.fr>
Mon, 13 Sep 2021 08:13:50 +0000 (10:13 +0200)
examples/cpp/energy-boot/s4u-energy-boot.cpp
include/simgrid/kernel/routing/DragonflyZone.hpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/TorusZone.cpp

index ac01774..33fd4bf 100644 (file)
@@ -37,7 +37,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this example");
 
 static void simulate_bootup(simgrid::s4u::Host* host)
 {
-  int previous_pstate = host->get_pstate();
+  unsigned long previous_pstate = host->get_pstate();
 
   XBT_INFO("Switch to virtual pstate 3, that encodes the 'booting up' state in that platform");
   host->set_pstate(3);
@@ -48,13 +48,13 @@ static void simulate_bootup(simgrid::s4u::Host* host)
   XBT_INFO("Wait 150s to simulate the boot time.");
   simgrid::s4u::this_actor::sleep_for(150);
 
-  XBT_INFO("The host is now up and running. Switch back to previous pstate %d", previous_pstate);
+  XBT_INFO("The host is now up and running. Switch back to previous pstate %lu", previous_pstate);
   host->set_pstate(previous_pstate);
 }
 
 static void simulate_shutdown(simgrid::s4u::Host* host)
 {
-  int previous_pstate = host->get_pstate();
+  unsigned long previous_pstate = host->get_pstate();
 
   XBT_INFO("Switch to virtual pstate 4, that encodes the 'shutting down' state in that platform");
   host->set_pstate(4);
@@ -62,7 +62,7 @@ static void simulate_shutdown(simgrid::s4u::Host* host)
   XBT_INFO("Wait 7 seconds to simulate the shutdown time.");
   simgrid::s4u::this_actor::sleep_for(7);
 
-  XBT_INFO("Switch back to previous pstate %d, that will be used on reboot.", previous_pstate);
+  XBT_INFO("Switch back to previous pstate %lu, that will be used on reboot.", previous_pstate);
   host->set_pstate(previous_pstate);
 
   XBT_INFO("Actually shutdown the host");
index 7c3411b..e798e77 100644 (file)
@@ -93,7 +93,7 @@ public:
   void set_link_characteristics(double bw, double lat, s4u::Link::SharingPolicy sharing_policy) override;
   Coords rankId_to_coords(unsigned long rank_id) const;
   XBT_ATTRIB_DEPRECATED_v330("Please use rankId_to_coords(int)") void rankId_to_coords(int rank_id,
-                                                                                       unsigned int coords[4]) const;
+                                                                                       unsigned long coords[4]) const;
 
 private:
   void generate_routers(const s4u::ClusterCallbacks& set_callbacks);
index d301c5b..5b7054c 100644 (file)
@@ -33,7 +33,7 @@ DragonflyZone::Coords DragonflyZone::rankId_to_coords(unsigned long rankId) cons
   return coords;
 }
 
-void DragonflyZone::rankId_to_coords(int rankId, unsigned int coords[4]) const // XBT_ATTRIB_DEPRECATED_v330
+void DragonflyZone::rankId_to_coords(int rankId, unsigned long coords[4]) const // XBT_ATTRIB_DEPRECATED_v330
 {
   const auto s_coords = rankId_to_coords(rankId);
   coords[0]           = s_coords.group;
@@ -312,8 +312,7 @@ void DragonflyZone::get_local_route(const NetPoint* src, const NetPoint* dst, Ro
   }
 
   // node->router local link
-  add_link_latency(route->link_list_, myRouter->my_nodes_[static_cast<size_t>(myCoords.node) * num_links_per_link_],
-                   latency);
+  add_link_latency(route->link_list_, myRouter->my_nodes_[myCoords.node * num_links_per_link_], latency);
 
   if (targetRouter != myRouter) {
     // are we on a different group ?
index f96b1ec..fe93efd 100644 (file)
@@ -102,8 +102,8 @@ void TorusZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route*
    * both arrays, we can easily assess whether we need to route into this dimension or not.
    */
   const unsigned long dsize = dimensions_.size();
-  std::vector<unsigned int> myCoords(dsize);
-  std::vector<unsigned int> targetCoords(dsize);
+  std::vector<unsigned long> myCoords(dsize);
+  std::vector<unsigned long> targetCoords(dsize);
   unsigned int dim_size_product = 1;
   for (unsigned long i = 0; i < dsize; i++) {
     unsigned long cur_dim_size = dimensions_[i];
@@ -121,9 +121,9 @@ void TorusZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route*
   bool use_lnk_up = false; // Is this link of the form "cur -> next" or "next -> cur"? false means: next -> cur
   unsigned long current_node = src->id();
   while (current_node != dst->id()) {
-    unsigned int next_node   = 0;
-    unsigned int dim_product = 1; // First, we will route in x-dimension
-    for (unsigned j = 0; j < dsize; j++) {
+    unsigned long next_node   = 0;
+    unsigned long dim_product = 1; // First, we will route in x-dimension
+    for (unsigned long j = 0; j < dsize; j++) {
       const unsigned long 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) {
@@ -150,7 +150,7 @@ void TorusZone::get_local_route(const NetPoint* src, const NetPoint* dst, Route*
           linkOffset = node_pos_with_loopback_limiter(next_node) + j;
           use_lnk_up = false;
         }
-        XBT_DEBUG("torus_get_route_and_latency - current_node: %lu, next_node: %u, linkOffset is %lu", current_node,
+        XBT_DEBUG("torus_get_route_and_latency - current_node: %lu, next_node: %lu, linkOffset is %lu", current_node,
                   next_node, linkOffset);
         break;
       }