--- a/src/adios4dolfinx/__init__.py +++ b/src/adios4dolfinx/__init__.py @@ -6,6 +6,16 @@ """Top-level package for ADIOS2Wrappers.""" +# Debian ships python3-adios2-serial and python3-adios2-mpi +# with the mpi build being used if the code is run under mpirun -n N python3 file.py +# regardless of the value of N (be it 1 or > 1). +# If the user runs instead python3 file.py, the serial build will be imported. +# Since adios4dolfinx always requires the mpi build, we will set an environment +# variable to force it over the serial one, regardless of how the user run the code. +import os +os.environ["ADIOS2_ALWAYS_USE_MPI"] = "1" +del os + from importlib.metadata import metadata from .checkpointing import (