From 0ac30e3d963bc8c22a02c15955d9693f1cf96fe4 Mon Sep 17 00:00:00 2001 From: Adrian Jackson Date: Tue, 9 Jul 2024 15:35:29 +0100 Subject: [PATCH 1/3] Fixing Fortran example to include steps --- examples/hello/bpFWriteCRead/FReader.f90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/hello/bpFWriteCRead/FReader.f90 b/examples/hello/bpFWriteCRead/FReader.f90 index ac0385794e..372935138d 100644 --- a/examples/hello/bpFWriteCRead/FReader.f90 +++ b/examples/hello/bpFWriteCRead/FReader.f90 @@ -29,6 +29,8 @@ program FReader ! Open in write mode, this launches an engine call adios2_open(engine, io, "CppWriter.bp", adios2_mode_read, ierr) + call adios2_begin_step(io, ierr) + call adios2_inquire_variable(var, io, 'data2D', ierr) if( ierr == adios2_found ) then @@ -56,6 +58,8 @@ program FReader end if + call adios2_end_step(io, ierr) + call adios2_close(engine, ierr) call adios2_finalize(adios, ierr) From e7fbd42e8ea155b7da8fb4005f44281b61524d8f Mon Sep 17 00:00:00 2001 From: Adrian Jackson Date: Tue, 9 Jul 2024 15:39:08 +0100 Subject: [PATCH 2/3] Fixing FReader to use steps r.e. https://github.com/ornladios/ADIOS2/issues/4232 --- examples/hello/bpFWriteCRead/FReader.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/hello/bpFWriteCRead/FReader.f90 b/examples/hello/bpFWriteCRead/FReader.f90 index 372935138d..ea023c3d9d 100644 --- a/examples/hello/bpFWriteCRead/FReader.f90 +++ b/examples/hello/bpFWriteCRead/FReader.f90 @@ -29,7 +29,7 @@ program FReader ! Open in write mode, this launches an engine call adios2_open(engine, io, "CppWriter.bp", adios2_mode_read, ierr) - call adios2_begin_step(io, ierr) + call adios2_begin_step(engine, ierr) call adios2_inquire_variable(var, io, 'data2D', ierr) @@ -58,7 +58,7 @@ program FReader end if - call adios2_end_step(io, ierr) + call adios2_end_step(engine, ierr) call adios2_close(engine, ierr) call adios2_finalize(adios, ierr) From f4347f04af583067057a308d1dcdcf0cb6a3147e Mon Sep 17 00:00:00 2001 From: Adrian Jackson Date: Tue, 9 Jul 2024 16:08:11 +0100 Subject: [PATCH 3/3] Fixing CppReader to ensure data has appeared (i.e. the end of the step) before it is interrogated --- examples/hello/bpFWriteCRead/CppReader.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/hello/bpFWriteCRead/CppReader.cpp b/examples/hello/bpFWriteCRead/CppReader.cpp index 0c4af26d6c..1d67d53ef5 100644 --- a/examples/hello/bpFWriteCRead/CppReader.cpp +++ b/examples/hello/bpFWriteCRead/CppReader.cpp @@ -57,8 +57,6 @@ int main(int argc, char *argv[]) bpReader.EndStep(); - bpReader.Close(); - std::cout << "Selection size: " << bpData.SelectionSize() << "\n"; for (size_t i = 0; i < bpData.Count()[0]; ++i) { @@ -70,6 +68,9 @@ int main(int argc, char *argv[]) std::cout << "\n"; } std::cout << "\n"; + + bpReader.Close(); + } MPI_Finalize();