Skip to content

Commit

Permalink
Further CI Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Feb 28, 2024
1 parent 4418f46 commit ad8ba7e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 20 deletions.
3 changes: 2 additions & 1 deletion src/snapshots/StatefulIterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ namespace detail
}

template <typename V>
auto CurrentStep::get_variant() const -> std::optional<V const *>
[[nodiscard]] auto CurrentStep::get_variant() const
-> std::optional<V const *>
{
auto res = std::get_if<V>(*this);
if (res)
Expand Down
28 changes: 13 additions & 15 deletions test/Files_SerialIO/close_iteration_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "SerialIOTests.hpp"
#include "openPMD/IO/ADIOS/macros.hpp"
#include "openPMD/IO/Access.hpp"
#include "openPMD/auxiliary/Filesystem.hpp"

Expand All @@ -9,18 +10,23 @@ namespace close_and_reopen_test
using namespace openPMD;
#if openPMD_HAVE_ADIOS2

constexpr char const *write_cfg =
#if openPMD_HAS_ADIOS_2_9
R"(adios2.use_group_table = true
adios2.modifiable_attributes = true)";
#else
R"(adios2.use_group_table = false
adios2.modifiable_attributes = false)";
#endif

template <typename WriteIterations>
auto run_test_filebased(
WriteIterations &&writeIterations, std::string const &ext)
{
std::string filename =
"../samples/close_iteration_reopen/filebased_%T." + ext;
auxiliary::remove_directory("../samples/close_iteration_reopen");
Series series(
filename,
Access::CREATE,
R"(adios2.use_group_table = true
adios2.modifiable_attributes = true)");
Series series(filename, Access::CREATE, write_cfg);
{
auto it = writeIterations(series)[0];
auto E_x = it.meshes["E"]["x"];
Expand Down Expand Up @@ -64,11 +70,7 @@ auto run_test_filebased(
}
series.close();

series = Series(
filename,
Access::READ_WRITE,
R"(adios2.use_group_table = true
adios2.modifiable_attributes = true)");
series = Series(filename, Access::READ_WRITE, write_cfg);

{
// @todo proper support for READ_WRITE in snapshots()
Expand Down Expand Up @@ -172,11 +174,7 @@ auto run_test_groupbased(
{
std::string filename =
"../samples/close_iteration_reopen/groupbased." + ext;
Series series(
filename,
Access::CREATE,
R"(adios2.use_group_table = true
adios2.modifiable_attributes = true)");
Series series(filename, Access::CREATE, write_cfg);
{
auto it = writeIterations(series)[0];
auto E_x = it.meshes["E"]["x"];
Expand Down
20 changes: 16 additions & 4 deletions test/Files_SerialIO/filebased_write_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,24 @@ void close_and_reopen_iterations(
void close_and_reopen_iterations(std::string const &filename)
{
close_and_reopen_iterations(
filename, Access::READ_LINEAR, "defer_iteration_parsing=false", false);
filename,
Access::READ_LINEAR,
R"({"defer_iteration_parsing":false})",
false);
close_and_reopen_iterations(
filename, Access::READ_LINEAR, "defer_iteration_parsing=true", false);
filename,
Access::READ_LINEAR,
R"({"defer_iteration_parsing":true})",
false);
close_and_reopen_iterations(
filename, Access::READ_ONLY, "defer_iteration_parsing=false", false);
filename,
Access::READ_ONLY,
R"({"defer_iteration_parsing":false})",
false);
close_and_reopen_iterations(
filename, Access::READ_ONLY, "defer_iteration_parsing=true", true);
filename,
Access::READ_ONLY,
R"({"defer_iteration_parsing":true})",
true);
}
} // namespace filebased_write_test

0 comments on commit ad8ba7e

Please sign in to comment.