Skip to content

Commit

Permalink
Bug fix: use mpi_rank_%i.toml when writing to TOML
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Nov 24, 2023
1 parent b4c98db commit b9df508
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/IO/JSON/JSONIOHandlerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1409,7 +1409,16 @@ auto JSONIOHandlerImpl::putJsonContents(
// writeSingleFile will prepend the base dir
subfilePath << *filename << ".parallel/mpi_rank_"
<< std::setw(num_digits(size - 1)) << std::setfill('0')
<< rank << ".json";
<< rank << [&]() {
switch (m_fileFormat)
{
case FileFormat::Json:
return ".json";
case FileFormat::Toml:
return ".toml";
}
throw std::runtime_error("Unreachable!");
}();
writeSingleFile(subfilePath.str());
if (rank == 0)
{
Expand Down

0 comments on commit b9df508

Please sign in to comment.