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(); diff --git a/examples/hello/bpFWriteCRead/FReader.f90 b/examples/hello/bpFWriteCRead/FReader.f90 index ac0385794e..ea023c3d9d 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(engine, 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(engine, ierr) + call adios2_close(engine, ierr) call adios2_finalize(adios, ierr)