X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/453ce02e0133358ef34d58e920521b6a29fe2283..8a0e2b82a1c0981a84e67f1bb4afb6e16fbf8c3a:/teshsuite/simdag/flatifier/flatifier.cpp diff --git a/teshsuite/simdag/flatifier/flatifier.cpp b/teshsuite/simdag/flatifier/flatifier.cpp index 7ed0610e15..31f1dc8f69 100644 --- a/teshsuite/simdag/flatifier/flatifier.cpp +++ b/teshsuite/simdag/flatifier/flatifier.cpp @@ -47,7 +47,7 @@ static void create_environment(xbt_os_timer_t parse_time, const char *platformFi static void dump_hosts() { - std::map* props = nullptr; + std::unordered_map* props = nullptr; unsigned int totalHosts = sg_host_count(); sg_host_t* hosts = sg_host_list(); std::sort(hosts, hosts + totalHosts, @@ -55,15 +55,19 @@ static void dump_hosts() for (unsigned int i = 0; i < totalHosts; i++) { std::printf(" get_cname(), sg_host_speed(hosts[i])); - props = hosts[i]->getProperties(); + props = hosts[i]->get_properties(); if (hosts[i]->get_core_count() > 1) { std::printf(" core=\"%d\"", hosts[i]->get_core_count()); } - if (props && not props->empty()) { + // Sort the properties before displaying them, so that the tests are perfectly reproducible + std::vector keys; + for (auto const& kv : *props) + keys.push_back(kv.first); + if (not keys.empty()) { std::printf(">\n"); - for (auto const& kv : *props) { - std::printf(" \n", kv.first.c_str(), kv.second.c_str()); - } + std::sort(keys.begin(), keys.end()); + for (std::string key : keys) + std::printf(" \n", key.c_str(), props->at(key).c_str()); std::printf(" \n"); } else { std::printf("/>\n");