From 942fb82cc60aa87f1f9f9e1ba6b47d7fc0da6972 Mon Sep 17 00:00:00 2001 From: Tom Cornebize Date: Thu, 19 May 2022 09:54:04 +0200 Subject: [PATCH] Cosmetic --- examples/platforms/supernode.cpp | 22 ++++++++++------------ examples/platforms/supernode.py | 4 ++-- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/examples/platforms/supernode.cpp b/examples/platforms/supernode.cpp index 061d734240..749ae22c10 100644 --- a/examples/platforms/supernode.cpp +++ b/examples/platforms/supernode.cpp @@ -6,24 +6,22 @@ #include namespace sg4 = simgrid::s4u; -const double BW_CPU = 1e12; -const double LAT_CPU = 0; +constexpr double BW_CPU = 1e12; +constexpr double LAT_CPU = 0; -const double BW_NODE = 1e11; -const double LAT_NODE = 1e-8; +constexpr double BW_NODE = 1e11; +constexpr double LAT_NODE = 1e-8; -const double BW_NETWORK = 1.25e10; -const double LAT_NETWORK = 1e-7; +constexpr double BW_NETWORK = 1.25e10; +constexpr double LAT_NETWORK = 1e-7; static std::string int_string(int n) { - char result[10]; - std::snprintf(result, 10, "%02d", n); - return result; + return simgrid::xbt::string_printf("%02d", n); } /** * - * This function creates one node made of N CPUs. + * This function creates one node made of nb_cpu CPUs. */ static sg4::NetZone *create_node(const sg4::NetZone* root, const std::string& node_name, const int nb_cpu) { @@ -46,7 +44,7 @@ static sg4::NetZone *create_node(const sg4::NetZone* root, const std::string& no /** * - * This function creates one super-node made of M nodes with N CPU. + * This function creates one super-node made of nb_nodes nodes with nb_cpu CPUs. */ static sg4::NetZone *create_supernode(const sg4::NetZone* root, const std::string& supernode_name, const int nb_nodes, const int nb_cpu) { @@ -70,7 +68,7 @@ static sg4::NetZone *create_supernode(const sg4::NetZone* root, const std::strin /** * - * This function creates one cluster of L super-node made of M nodes with N CPU. + * This function creates one cluster of nb_supernodes super-nodes made of nb_nodes nodes with nb_cpu CPUs. */ static sg4::NetZone *create_cluster(const std::string& cluster_name, const int nb_supernodes, const int nb_nodes, const int nb_cpu) { diff --git a/examples/platforms/supernode.py b/examples/platforms/supernode.py index bbda3b4df3..5ffde32fe9 100755 --- a/examples/platforms/supernode.py +++ b/examples/platforms/supernode.py @@ -6,8 +6,8 @@ # under the terms of the license (GNU LGPL) which comes with this package. -# This script takes as input a C++ platform file, compiles it, then dump the -# routing graph as a CSV and generate an SVG image. +# This script takes as input a C++ platform file, compiles it, then dumps the +# routing graph as a CSV and generates an SVG image. # The layout should be alright for any platform file, but the colors are very # ad-hoc for file supernode.cpp : do not hesitate to adapt this script to your needs. -- 2.20.1