Skip to content

Commit

Permalink
[WIP] Remove adios2.usesteps, set it always to true
Browse files Browse the repository at this point in the history
This uncovered loads of bugs
  • Loading branch information
franzpoeschel committed Oct 19, 2023
1 parent f2db458 commit 3f629cc
Show file tree
Hide file tree
Showing 9 changed files with 170 additions and 144 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1363,16 +1363,18 @@ if(openPMD_BUILD_TESTING)
${MPI_TEST_EXE} ${Python_EXECUTABLE} \
${openPMD_RUNTIME_OUTPUT_DIRECTORY}/openpmd-pipe \
--infile ../samples/git-sample/data00000100.h5 \
--outfile ../samples/git-sample/single_iteration.bp && \
--outfile \
../samples/git-sample/single_iteration_%T.bp && \
\
${MPI_TEST_EXE} ${Python_EXECUTABLE} \
${openPMD_RUNTIME_OUTPUT_DIRECTORY}/openpmd-pipe \
--infile ../samples/git-sample/thetaMode/data%T.h5 \
--outfile ../samples/git-sample/thetaMode/data.bp && \
--outfile \
../samples/git-sample/thetaMode/data_%T.bp && \
\
${Python_EXECUTABLE} \
${openPMD_RUNTIME_OUTPUT_DIRECTORY}/openpmd-pipe \
--infile ../samples/git-sample/thetaMode/data.bp \
--infile ../samples/git-sample/thetaMode/data_%T.bp \
--outfile ../samples/git-sample/thetaMode/data%T.json \
"
WORKING_DIRECTORY ${openPMD_RUNTIME_OUTPUT_DIRECTORY}
Expand All @@ -1381,17 +1383,17 @@ if(openPMD_BUILD_TESTING)
add_test(NAME CLI.pipe.py
COMMAND sh -c
"${Python_EXECUTABLE} \
${openPMD_RUNTIME_OUTPUT_DIRECTORY}/openpmd-pipe \
${openPMD_RUNTIME_OUTPUT_DIRECTORY}/openpmd-pipe \
--infile ../samples/git-sample/data%T.h5 \
--outfile ../samples/git-sample/data%T.bp && \
\
${Python_EXECUTABLE} \
${openPMD_RUNTIME_OUTPUT_DIRECTORY}/openpmd-pipe \
${openPMD_RUNTIME_OUTPUT_DIRECTORY}/openpmd-pipe \
--infile ../samples/git-sample/thetaMode/data%T.h5 \
--outfile ../samples/git-sample/thetaMode/data%T.bp && \
\
${Python_EXECUTABLE} \
${openPMD_RUNTIME_OUTPUT_DIRECTORY}/openpmd-pipe \
${openPMD_RUNTIME_OUTPUT_DIRECTORY}/openpmd-pipe \
--infile ../samples/git-sample/thetaMode/data%T.bp \
--outfile ../samples/git-sample/thetaMode/data%T.json \
"
Expand Down
12 changes: 9 additions & 3 deletions include/openPMD/IO/ADIOS/ADIOS2IOHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ class ADIOS2IOHandlerImpl
* If the iteration encoding is variableBased, we default to using a group
* table, since it is the only reliable way to recover currently active
* groups.
* If group-based encoding is used without group table, then
* READ_RANDOM_ACCESS is forbidden as it will be unreliable in reporting
* currently available data.
* Use AbstractIOHandler::m_encoding for this though
*/
IterationEncoding m_iterationEncoding = IterationEncoding::groupBased;
/**
Expand Down Expand Up @@ -434,6 +438,8 @@ namespace ADIOS2Defaults
"__openPMD_internal/openPMD2_adios2_schema";
constexpr const_str str_isBoolean = "__is_boolean__";
constexpr const_str str_activeTablePrefix = "__openPMD_groups";
constexpr const_str str_groupBasedWarning =
"__openPMD_internal/warning_bugprone_groupbased_encoding";
} // namespace ADIOS2Defaults

namespace detail
Expand Down Expand Up @@ -1064,7 +1070,7 @@ namespace detail
* without steps. This is not a workaround since not using steps,
* while inefficient in ADIOS2, is something that we support.
*/
NoStream,
ReadWithoutStream,
/**
* Rationale behind this state:
* When user code opens a Series, series.iterations should contain
Expand Down Expand Up @@ -1152,8 +1158,8 @@ namespace detail
void create_IO();

void configure_IO(ADIOS2IOHandlerImpl &impl);
void configure_IO_Read(std::optional<bool> userSpecifiedUsesteps);
void configure_IO_Write(std::optional<bool> userSpecifiedUsesteps);
void configure_IO_Read();
void configure_IO_Write();
};

} // namespace detail
Expand Down
9 changes: 9 additions & 0 deletions include/openPMD/IO/AbstractIOHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "openPMD/IO/Access.hpp"
#include "openPMD/IO/Format.hpp"
#include "openPMD/IO/IOTask.hpp"
#include "openPMD/IterationEncoding.hpp"
#include "openPMD/config.hpp"

#if openPMD_HAVE_MPI
Expand Down Expand Up @@ -180,6 +181,12 @@ class AbstractIOHandler
{
friend class Series;

public:
/* @todo access control, remove this from open_file, create_file tasks,
* remove the same field from ADIOS2IOHandlerImpl
*/
IterationEncoding m_encoding = IterationEncoding::groupBased;

private:
void setIterationEncoding(IterationEncoding encoding)
{
Expand All @@ -193,6 +200,8 @@ class AbstractIOHandler
// do we really want to have those as const members..?
*const_cast<Access *>(&m_backendAccess) = Access::CREATE;
}

m_encoding = encoding;
}

public:
Expand Down
2 changes: 1 addition & 1 deletion include/openPMD/cli/ls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ namespace cli
{
auto s = Series(
argv[1],
Access::READ_ONLY,
Access::READ_LINEAR,
R"({"defer_iteration_parsing": true})");

helper::listSeries(s, true, std::cout);
Expand Down
Loading

0 comments on commit 3f629cc

Please sign in to comment.