Skip to content

Guard VTXWriter use when ADIOS2 is unavailable - #4254

Merged
schnellerhase merged 2 commits into
FEniCS:mainfrom
masaqif:fix-adios2-test-skip
Jul 2, 2026
Merged

Guard VTXWriter use when ADIOS2 is unavailable#4254
schnellerhase merged 2 commits into
FEniCS:mainfrom
masaqif:fix-adios2-test-skip

Conversation

@masaqif

@masaqif masaqif commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Skip the ADIOS2 VTXWriter test module when DOLFINx itself is built without ADIOS2 support, while still using the Python adios2 import check for tests that inspect BP output.\n\nAlso guard VTXWriter output in the scattering boundary conditions demo so the demo can continue when ADIOS2-backed VTX output is unavailable.\n\nFixes #3995.\n\nSplit out from #4249 per maintainer request.

@francesco-ballarin

francesco-ballarin commented Jul 1, 2026

Copy link
Copy Markdown
Member

While you are at it, you may also want to look at the following other places which show a similar issue. This is how we patch it for debian, but there are for sure other ways to handle that (e.g., as you did, moving the adios2 import or skip earlier, when that is used inside the test)

https://salsa.debian.org/science-team/fenics/fenics-dolfinx/-/blob/25530d9953e688fa1848ea159c1469f7f89bc3b7/debian/patches/test_adios2_skip.patch
https://salsa.debian.org/science-team/fenics/fenics-dolfinx/-/blob/11ba5c5df4435136ca793d6b63911f4543e82552/debian/patches/demo_no_vtk_adios2.patch

@masaqif
masaqif force-pushed the fix-adios2-test-skip branch from 2685f02 to c560eb5 Compare July 1, 2026 15:07
@masaqif masaqif changed the title Skip ADIOS2 test before importing VTXWriter Guard VTXWriter use when ADIOS2 is unavailable Jul 1, 2026
@masaqif

masaqif commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the pointers. I expanded this beyond the original import-order fix: the ADIOS2 test module now skips when DOLFINx is built without ADIOS2, and the scattering boundary conditions demo guards its VTXWriter output similarly.

@schnellerhase schnellerhase added ci Continuous Integration dependencies Pull requests that update a dependency file labels Jul 2, 2026

@schnellerhase schnellerhase left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you link #3995 so it auto-closes on merge?

@schnellerhase
schnellerhase enabled auto-merge July 2, 2026 16:18
@drew-parsons

Copy link
Copy Markdown
Contributor

Looks good to me too, will help avoiding having to dance around different configurations for the 32-bit architectures.

@schnellerhase
schnellerhase added this pull request to the merge queue Jul 2, 2026
Merged via the queue into FEniCS:main with commit 7aa6811 Jul 2, 2026
16 of 17 checks passed
from dolfinx.graph import adjacencylist
from dolfinx.mesh import CellType, create_mesh, create_unit_cube, create_unit_square

pytestmark = pytest.mark.skipif(not has_adios2, reason="DOLFINx has been built without ADIOS2")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a good change. If we run test_adios2.py it should adios2, and fail if it can't.

We can have a situation where a change could cause in the CI DOLFINx to (silently) not build with ADIOS2. Changes like this one mean the issue is not picked up and we lose test coverage. In tests, skipping should be explicit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ADIOS2 is an optional dependency. The test target pytest should give a suitable set of tests to allow for installation verification for any given configuration. If the we have not compiled with adios2 support a test failure due to a missing import or non-available functionality prohibits this.

Verification of having picked up the desired configuration in a CI run is not limited by this change https://github.com/FEniCS/dolfinx/blob/main/.github/workflows/ccpp.yml#L134.

import_adios2 might not have the right behaviour here, as this will skip a check if adios2 support is enabled and the adios2 python module is not available (skipping silently checks for supported functionality). But that was not altered in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous Integration dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants