From 3354174bd5dce6022d6f8ae963ec8ab8f53f3add Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 21 Jul 2021 15:08:39 +0200 Subject: [PATCH] Use if(false) to comment debugging code, and be sure that it always compiles. --- src/smpi/internals/smpi_deployment.cpp | 9 +++++---- src/surf/surf_interface.hpp | 13 ++++++++----- src/xbt/memory_map.cpp | 12 ++++++------ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/smpi/internals/smpi_deployment.cpp b/src/smpi/internals/smpi_deployment.cpp index 576176b277..a095f01f06 100644 --- a/src/smpi/internals/smpi_deployment.cpp +++ b/src/smpi/internals/smpi_deployment.cpp @@ -24,10 +24,11 @@ public: { auto* group = new simgrid::smpi::Group(size_); comm_world_ = new simgrid::smpi::Comm(group, nullptr, false, -1); - // FIXME : using MPI_Attr_put with MPI_UNIVERSE_SIZE is forbidden and we make it a no-op (which triggers a warning - // as MPI_ERR_ARG is returned). Directly calling Comm::attr_put breaks for now, as MPI_UNIVERSE_SIZE,is <0 - // instance.comm_world->attr_put(MPI_UNIVERSE_SIZE, reinterpret_cast(instance.size)); - + if (false) { + // FIXME : using MPI_Attr_put with MPI_UNIVERSE_SIZE is forbidden and we make it a no-op (which triggers a warning + // as MPI_ERR_ARG is returned). Directly calling Comm::attr_put breaks for now, as MPI_UNIVERSE_SIZE,is <0 + comm_world_->attr_put(MPI_UNIVERSE_SIZE, reinterpret_cast(size_)); + } universe_size += max_no_processes; } diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index af27388561..d0d38aecdd 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -10,6 +10,7 @@ #include "src/surf/surf_private.hpp" #include "xbt/function_types.h" +#include #include #include #include @@ -41,11 +42,13 @@ inline auto& watched_hosts() // avoid static initialization order fiasco static inline void double_update(double* variable, double value, double precision) { - // printf("Updating %g -= %g +- %g\n",*variable,value,precision); - // xbt_assert(value==0 || value>precision); - // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding may - // happen, and the precision mechanism is not active... - // xbt_assert(*variable< (2< precision); + // Check that precision is higher than the machine-dependent size of the mantissa. If not, brutal rounding may + // happen, and the precision mechanism is not active... + xbt_assert(FLT_RADIX == 2 && *variable < precision * exp2(DBL_MANT_DIG)); + } *variable -= value; if (*variable < precision) *variable = 0.0; diff --git a/src/xbt/memory_map.cpp b/src/xbt/memory_map.cpp index 98e9bffab4..b3ea8b17f2 100644 --- a/src/xbt/memory_map.cpp +++ b/src/xbt/memory_map.cpp @@ -155,11 +155,10 @@ std::vector get_memory_map(pid_t pid) if (dladdr(reinterpret_cast(address), &dlinfo)) memreg.pathname = dlinfo.dli_fname; -#if 0 /* debug */ - std::fprintf(stderr, "Region: %016" PRIx64 "-%016" PRIx64 " | %c%c%c | %s\n", memreg.start_addr, memreg.end_addr, - (memreg.prot & PROT_READ) ? 'r' : '-', (memreg.prot & PROT_WRITE) ? 'w' : '-', - (memreg.prot & PROT_EXEC) ? 'x' : '-', memreg.pathname.c_str()); -#endif + if (false) // debug + std::fprintf(stderr, "Region: %016" PRIx64 "-%016" PRIx64 " | %c%c%c | %s\n", memreg.start_addr, memreg.end_addr, + (memreg.prot & PROT_READ) ? 'r' : '-', (memreg.prot & PROT_WRITE) ? 'w' : '-', + (memreg.prot & PROT_EXEC) ? 'x' : '-', memreg.pathname.c_str()); ret.push_back(std::move(memreg)); address += size; @@ -290,7 +289,8 @@ std::vector get_memory_map(pid_t pid) /* Create space for a new map region in the region's array and copy the */ /* parsed stuff from the temporal memreg variable */ - // std::fprintf(stderr, "Found region for %s\n", not memreg.pathname.empty() ? memreg.pathname.c_str() : "(null)"); + if (false) // debug + std::fprintf(stderr, "Found region for %s\n", not memreg.pathname.empty() ? memreg.pathname.c_str() : "(null)"); ret.push_back(std::move(memreg)); } -- 2.20.1