Skip to content

Commit

Permalink
Revert "TMP: Debug"
Browse files Browse the repository at this point in the history
This reverts commit 37daf54.
  • Loading branch information
franzpoeschel committed Nov 15, 2024
1 parent ae9a344 commit 75b2571
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 42 deletions.
26 changes: 4 additions & 22 deletions include/openPMD/auxiliary/StringManip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,44 +195,26 @@ namespace auxiliary
return s.substr(begin - s.begin(), end.base() - begin);
}

template <typename T>
inline std::string
join_generic(std::vector<T> const &vs, std::string const &delimiter)
join(std::vector<std::string> const &vs, std::string const &delimiter)
{
auto as_string = [](T const &t) {
if constexpr (std::is_same_v<T, std::string>)
{
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<std::string>(ss, delimiter.c_str()),
as_string);
std::ostream_iterator<std::string>(ss, delimiter.c_str()));
ss << *(vs.end() - 1);
return ss.str();
}
}

inline std::string
join(std::vector<std::string> const &vs, std::string const &delimiter)
{
return join_generic(vs, delimiter);
}

/**
* @brief Remove surrounding slashes from a string.
*
Expand Down
20 changes: 0 additions & 20 deletions src/ChunkInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <algorithm> // std::sort
Expand Down Expand Up @@ -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<std::string, ChunkTable> chunkGroups;
ChunkTable &sourceChunks = res.notAssigned;
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 75b2571

Please sign in to comment.