From 75b257199dd9af7f0dda61bf5e43359e2ea66ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 8 Aug 2024 18:14:29 +0200 Subject: [PATCH] Revert "TMP: Debug" This reverts commit 37daf54860e823fa496ed4e70778c579103eab47. --- include/openPMD/auxiliary/StringManip.hpp | 26 ++++------------------- src/ChunkInfo.cpp | 20 ----------------- 2 files changed, 4 insertions(+), 42 deletions(-) diff --git a/include/openPMD/auxiliary/StringManip.hpp b/include/openPMD/auxiliary/StringManip.hpp index 2e3bb94c9c..36778f205f 100644 --- a/include/openPMD/auxiliary/StringManip.hpp +++ b/include/openPMD/auxiliary/StringManip.hpp @@ -195,44 +195,26 @@ namespace auxiliary return s.substr(begin - s.begin(), end.base() - begin); } - template inline std::string - join_generic(std::vector const &vs, std::string const &delimiter) + join(std::vector const &vs, std::string const &delimiter) { - auto as_string = [](T const &t) { - if constexpr (std::is_same_v) - { - return t; - } - else - { - return std::to_string(t); - } - }; switch (vs.size()) { case 0: return ""; case 1: - return as_string(vs[0]); + return vs[0]; default: std::ostringstream ss; - std::transform( + std::copy( vs.begin(), vs.end() - 1, - std::ostream_iterator(ss, delimiter.c_str()), - as_string); + std::ostream_iterator(ss, delimiter.c_str())); ss << *(vs.end() - 1); return ss.str(); } } - inline std::string - join(std::vector const &vs, std::string const &delimiter) - { - return join_generic(vs, delimiter); - } - /** * @brief Remove surrounding slashes from a string. * diff --git a/src/ChunkInfo.cpp b/src/ChunkInfo.cpp index 47496cb436..6162a49f3a 100644 --- a/src/ChunkInfo.cpp +++ b/src/ChunkInfo.cpp @@ -22,7 +22,6 @@ #include "openPMD/ChunkInfo_internal.hpp" #include "openPMD/auxiliary/Mpi.hpp" -#include "openPMD/auxiliary/StringManip.hpp" #include "openPMD/benchmark/mpi/OneDimensionalBlockSlicer.hpp" #include // std::sort @@ -410,17 +409,6 @@ namespace chunk_assignment PartialAssignment ByHostname::assign( PartialAssignment res, RankMeta const &in, RankMeta const &out) { - std::cout << "INRANKS:\n"; - for (auto const &[rank, name] : in) - { - std::cout << rank << ":\t" << name << '\n'; - } - std::cout << "\nOUTRANKS:\n"; - for (auto const &[rank, name] : out) - { - std::cout << rank << ":\t" << name << '\n'; - } - std::cout << std::endl; // collect chunks by hostname std::map chunkGroups; ChunkTable &sourceChunks = res.notAssigned; @@ -484,14 +472,6 @@ namespace chunk_assignment ranksOnTargetNode); } } - std::cout << res.notAssigned.size() << " Chunks unassigned:\n"; - for (auto const &chunk : res.notAssigned) - { - std::cout << "\tFROM " << chunk.sourceID << "\t[" - << auxiliary::join_generic(chunk.offset, ",") << "]\t[" - << auxiliary::join_generic(chunk.extent, ",") << "]" - << std::endl; - } return res; }