From ea497a076d56eee1462c60a1790a55637dd18c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20P=C3=B6schel?= Date: Thu, 12 Oct 2023 11:01:22 +0200 Subject: [PATCH] Bug fix: use mpi_rank_%i.toml when writing to TOML --- src/IO/JSON/JSONIOHandlerImpl.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/IO/JSON/JSONIOHandlerImpl.cpp b/src/IO/JSON/JSONIOHandlerImpl.cpp index 68a1699a77..13f1d33d7e 100644 --- a/src/IO/JSON/JSONIOHandlerImpl.cpp +++ b/src/IO/JSON/JSONIOHandlerImpl.cpp @@ -1411,7 +1411,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) {