X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2e76d911c8346bb816bc9d1cc4d0c96bf28c56a5..9afa0d0db01da2ae64e48fb594cc87c186dde192:/examples/cpp/routing-get-clusters/s4u-routing-get-clusters.cpp diff --git a/examples/cpp/routing-get-clusters/s4u-routing-get-clusters.cpp b/examples/cpp/routing-get-clusters/s4u-routing-get-clusters.cpp index 660f1eb896..636762da41 100644 --- a/examples/cpp/routing-get-clusters/s4u-routing-get-clusters.cpp +++ b/examples/cpp/routing-get-clusters/s4u-routing-get-clusters.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2009-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2009-2023. 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. */ @@ -8,30 +8,31 @@ #include "simgrid/s4u.hpp" XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_test, "Messages specific for this s4u example"); +namespace sg4 = simgrid::s4u; int main(int argc, char* argv[]) { - simgrid::s4u::Engine e(&argc, argv); + sg4::Engine e(&argc, argv); e.load_platform(argv[1]); std::vector clusters = e.get_filtered_netzones(); - for (auto c : clusters) { + for (auto const* c : clusters) { XBT_INFO("%s", c->get_cname()); - std::vector hosts = c->get_all_hosts(); - for (auto h : hosts) + std::vector hosts = c->get_all_hosts(); + for (auto const* h : hosts) XBT_INFO(" %s", h->get_cname()); } std::vector dragonfly_clusters = e.get_filtered_netzones(); - for (auto d : dragonfly_clusters) { + for (auto const* d : dragonfly_clusters) { XBT_INFO("%s' dragonfly topology:", d->get_cname()); - for (int i = 0; i < d->get_host_count(); i++) { + for (size_t i = 0; i < d->get_host_count(); i++) { const simgrid::kernel::routing::DragonflyZone::Coords coords = d->rankId_to_coords(i); - XBT_INFO(" %d: (%u, %u, %u, %u)", i, coords.group, coords.chassis, coords.blade, coords.node); + XBT_INFO(" %zu: (%lu, %lu, %lu, %lu)", i, coords.group, coords.chassis, coords.blade, coords.node); } }