Skip to content

Commit

Permalink
Select ADIOS2 file ending more specifically
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Jan 18, 2024
1 parent 9f5b0cb commit 8288c63
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
35 changes: 25 additions & 10 deletions src/IO/ADIOS/ADIOS2IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,32 @@ std::string ADIOS2IOHandlerImpl::fileSuffix(bool verbose) const
{
// SST engine adds its suffix unconditionally
// so we don't add it
#if defined(ADIOS2_HAVE_BP5) && openPMD_HAS_ADIOS_2_9
constexpr char const *const default_file_ending = ".bp5";
#else
constexpr char const *const default_file_ending = ".bp4";
#endif

static std::map<std::string, AcceptedEndingsForEngine> const endings{
{"sst", {{"", ""}, {".sst", ""}}},
{"staging", {{"", ""}, {".sst", ""}}},
{"filestream", {{".bp", ".bp"}, {".bp4", ".bp4"}, {".bp5", ".bp5"}}},
{"bp4", {{".bp4", ".bp4"}, {".bp", ".bp"}}},
{"bp5", {{".bp5", ".bp5"}, {".bp", ".bp"}}},
{"bp3", {{".bp", ".bp"}}},
{"file", {{".bp", ".bp"}, {".bp4", ".bp4"}, {".bp5", ".bp5"}}},
{"hdf5", {{".h5", ".h5"}}},
{"nullcore", {{".nullcore", ".nullcore"}, {".bp", ".bp"}}},
{"ssc", {{".ssc", ".ssc"}}}};
{"sst", {{"", ""}, {".sst", ""}, {".%E", ""}}},
{"staging", {{"", ""}, {".sst", ""}, {".%E", ""}}},
{"filestream",
{{".bp", ".bp"},
{".bp4", ".bp4"},
{".bp5", ".bp5"},
{".%E", default_file_ending}}},
{"bp4", {{".bp4", ".bp4"}, {".bp", ".bp"}, {".%E", ".bp4"}}},
{"bp5", {{".bp5", ".bp5"}, {".bp", ".bp"}, {".%E", ".bp5"}}},
{"bp3", {{".bp", ".bp"}, {".%E", ".bp"}}},
{"file",
{{".bp", ".bp"},
{".bp4", ".bp4"},
{".bp5", ".bp5"},
{".%E", default_file_ending}}},
{"hdf5", {{".h5", ".h5"}, {".%E", ".h5"}}},
{"nullcore",
{{".nullcore", ".nullcore"}, {".bp", ".bp"}, {".%E", ".nullcore"}}},
{"ssc", {{".ssc", ".ssc"}, {".%E", ".ssc"}}}};

if (auto engine = endings.find(m_engineType); engine != endings.end())
{
Expand Down
6 changes: 6 additions & 0 deletions src/Series.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,12 @@ auto Series::initIOHandler(
"Unable to automatically determine filename extension. Please "
"specify in some way.");
}
else if (input->format == Format::ADIOS2_BP)
{
// Since ADIOS2 has multiple extensions depending on the engine,
// we need to pass this job on to the backend
input->filenameExtension = ".%E";
}
else
{
input->filenameExtension = suffix(input->format);
Expand Down

0 comments on commit 8288c63

Please sign in to comment.