Skip to content

Commit

Permalink
Make ADIOS tests compatible with 2.9 and 2.10 (#3128)
Browse files Browse the repository at this point in the history
* Upper bound on ADIOS2 version

We know we are not compatible and will do a minor DOLFINx release once ADIOS 2.10 is widely available.

* Add forward/backward compatibility in Python for adios2

* Add back set_engine

* Apply suggestions from code review

---------

Co-authored-by: Jorgen S. Dokken <[email protected]>
Co-authored-by: Jørgen Schartum Dokken <[email protected]>
  • Loading branch information
3 people authored Apr 15, 2024
1 parent e2f55cf commit 31d4a32
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion python/test/unit/io/test_adios2.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,16 @@ def test_vtx_reuse_mesh(tempdir, dim, simplex, reuse):
1 if reuse else 3
) # For mesh variables the step count is 1 if reuse else number of writes

adios_file = adios2.open(str(filename), "r", comm=mesh.comm, engine_type="BP4")
# backwards compatibility adios2 < 2.10.0
try:
adios_file = adios2.open(str(filename), "r", comm=mesh.comm, engine_type="BP4")
except AttributeError:
# adios2 >= v2.10.0
adios = adios2.Adios(comm=mesh.comm)
io = adios.declare_io("TestData")
io.set_engine("BP4")
adios_file = adios2.Stream(io, str(filename), "r", mesh.comm)

for name, var in adios_file.available_variables().items():
if name in reuse_variables:
assert int(var["AvailableStepsCount"]) == target_mesh
Expand Down

0 comments on commit 31d4a32

Please sign in to comment.