diff --git a/python/test/unit/io/test_adios2.py b/python/test/unit/io/test_adios2.py index 980558415dd..cad2c2a697e 100644 --- a/python/test/unit/io/test_adios2.py +++ b/python/test/unit/io/test_adios2.py @@ -293,7 +293,9 @@ def test_vtx_reuse_mesh(self, tempdir, dim, simplex, reuse): """Test reusage of mesh by VTXWriter.""" from dolfinx.io import VTXMeshPolicy, VTXWriter - adios2 = pytest.importorskip("adios2") + adios2 = pytest.importorskip("adios2", minversion="2.10.0") + if not adios2.is_built_with_mpi: + pytest.skip("Require adios2 built with MPI support") mesh = generate_mesh(dim, simplex) v = Function(functionspace(mesh, ("Lagrange", 1))) @@ -312,19 +314,12 @@ def test_vtx_reuse_mesh(self, tempdir, dim, simplex, reuse): reuse_variables = ["NumberOfEntities", "NumberOfNodes", "connectivity", "geometry", "types"] target_all = 3 # For all other variables the step count is number of writes - target_mesh = ( - 1 if reuse else 3 - ) # For mesh variables the step count is 1 if reuse else number of writes - - # 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) + target_mesh = 1 if reuse else 3 + # For mesh variables the step count is 1 if reuse else number of writes + 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: