Skip to content

Commit

Permalink
ADIOS2: Ensure that a step is always active at write time
Browse files Browse the repository at this point in the history
Even when not using steps, dump everything into a single large step. BP5
will fail otherwise.
  • Loading branch information
franzpoeschel committed Aug 2, 2023
1 parent e7d7a4b commit 4efdd44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/IO/ADIOS/ADIOS2IOHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "openPMD/auxiliary/StringManip.hpp"
#include "openPMD/auxiliary/TypeTraits.hpp"

#include <adios2/common/ADIOSTypes.h>
#include <algorithm>
#include <cctype> // std::tolower
#include <iostream>
Expand Down Expand Up @@ -2560,7 +2561,9 @@ namespace detail
// might have been closed previously
if (engine)
{
if (streamStatus == StreamStatus::DuringStep)
if (streamStatus == StreamStatus::DuringStep ||
(streamStatus == StreamStatus::NoStream &&
m_mode == adios2::Mode::Write))
{
engine.EndStep();
}
Expand Down Expand Up @@ -3114,6 +3117,11 @@ namespace detail
// the streaming API was used.
m_engine = std::make_optional(
adios2::Engine(m_IO.Open(m_file, tempMode)));
if (streamStatus == StreamStatus::NoStream)
{
// Write everything into one big step
m_engine->BeginStep();
}
break;
}
#if HAS_ADIOS_2_8
Expand Down
3 changes: 2 additions & 1 deletion test/SerialIOTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4328,7 +4328,8 @@ TEST_CASE("adios2_bp5_flush", "[serial][adios2]")
[adios2]
[adios2.engine]
usesteps = true
# Check that BP5 can also be used without steps
usesteps = false
type = "bp5"
preferred_flush_target = "disk"
Expand Down

0 comments on commit 4efdd44

Please sign in to comment.