File: fix_example_hello_bpFWriteCRead_PR4239.patch

package info (click to toggle)
adios2 2.10.2%2Bdfsg1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,804 kB
  • sloc: cpp: 175,964; ansic: 160,510; f90: 14,630; yacc: 12,668; python: 7,275; perl: 7,126; sh: 2,850; lisp: 1,106; xml: 1,049; makefile: 583; lex: 557
file content (53 lines) | stat: -rw-r--r-- 1,691 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From: Adrian Jackson <a.jackson@epcc.ed.ac.uk>
Date: Tue, 9 Jul 2024 15:35:29 +0100
Subject: Fixing Fortran example to include steps

---
 examples/hello/bpFWriteCRead/CppReader.cpp | 4 ++--
 examples/hello/bpFWriteCRead/FReader.f90   | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/examples/hello/bpFWriteCRead/CppReader.cpp b/examples/hello/bpFWriteCRead/CppReader.cpp
index 0c4af26..3b3e522 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,8 @@ 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 ac03857..ea023c3 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)