Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fortran BP5 reader fails to read any variables #4106

Closed
JamieJQuinn opened this issue Mar 25, 2024 · 3 comments
Closed

Fortran BP5 reader fails to read any variables #4106

JamieJQuinn opened this issue Mar 25, 2024 · 3 comments

Comments

@JamieJQuinn
Copy link
Contributor

Describe the bug

Using the Fortran bindings and the BP5 format, the BPReader fails to read any variables from a valid BP5 file. The engine successfully opens the file but reading any valid variables fails and calling adios2_available_variables reports zero variables in the file. The BP4 reader works as expected.

To Reproduce

The example examples/hello/bpReader/bpReaderHeatMap3D.F90 suffers from this problem. To build & run from ADIOS source:

cd ADIOS2
cmake -B build -DADIOS2_BUILD_EXAMPLE=ON
cmake --build build
build/bin/adios2_hello_bpReaderHeatMap3D_f

The output from the example's write step can be verified by inspecting with bpls build/bin/HeatMap3D_f.bp.

The MPI-enabled exe build/bin/adios2_hello_bpReaderHeatMap3D_f_mpi also fails.

Note: these examples fail silently. Run the equivalent C++ exe build/bin/adios2_hello_bpReaderHeatMap3D to see a successful run.

Expected behavior

The BP5 reader should be able to inspect & read variables from a BP5 file. In the above example, the output should match that from the equivalent C++ version:

Pre-allocated 64 elements, 256 bytes
Temperature map selection: { start = [2,2,2], count = [4,4,4] }
111 112 113 114
121 122 123 124
131 132 133 134
141 142 143 144
211 212 213 214
221 222 223 224
231 232 233 234
241 242 243 244
311 312 313 314
321 322 323 324
331 332 333 334
341 342 343 344
411 412 413 414
421 422 423 424
431 432 433 434
441 442 443 444

Desktop (please complete the following information):
Build 1:

Build 2:

  • 5.15.0-75-generic 20.04.1-Ubuntu
  • ADIOS2 built from source, version v2.10.0-rc1
@eisenhauer
Copy link
Member

At first glance, this seems to be the case of the Fortran version of this example program not being updated to call BeginStep() (as is required for BP5, but wasn't strictly necessary for BP4). Sorry about that, we'll take care of getting it updated. But to continue work with ADIOS, simply call adios2_begin_step() before adios2_inquire_variable(), OR for something more like the old semantics specify adios2_mode_readRandomAccess instead of adios2_mode_read.

(There were significant metadata scalability problems with the BP4 approach of not differentiating at the time of open() whether or not a file was going to be accessed step-by-step or in a more random way by doing set_step() on specific variables. This was one of the reasons why BP5 was developed, but when BP5 became the default, some old code that relied upon that ambiguity was necessarily invalidated.)

@JamieJQuinn
Copy link
Contributor Author

adios2_mode_readRandomAccess works well, thanks!

Does this mean adios2_available_variables just doesn't work for BP5 files without adios2_mode_readRandomAccess?

@eisenhauer
Copy link
Member

In the default streaming mode (read), variables are available between begin_step/end_step pairs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants