| 1 |
--- a/src/io4dolfinx/__init__.py |
| 2 |
+++ b/src/io4dolfinx/__init__.py |
| 3 |
@@ -6,6 +6,17 @@ |
| 4 |
|
| 5 |
"""Top-level package for ADIOS2Wrappers.""" |
| 6 |
|
| 7 |
+# With respect to adios2 support, |
| 8 |
+# Debian ships python3-adios2-serial and python3-adios2-mpi |
| 9 |
+# with the mpi build being used if the code is run under mpirun -n N python3 file.py |
| 10 |
+# regardless of the value of N (be it 1 or > 1). |
| 11 |
+# If the user runs instead python3 file.py, the serial build would be imported. |
| 12 |
+# Since io4dolfinx always requires the mpi build of adios2, we will set an environment |
| 13 |
+# variable to force it over the serial one, regardless of how the user runs the code. |
| 14 |
+import os |
| 15 |
+os.environ["ADIOS2_ALWAYS_USE_MPI"] = "1" |
| 16 |
+del os |
| 17 |
+ |
| 18 |
from importlib.metadata import metadata |
| 19 |
|
| 20 |
from .backends import FileMode, get_backend, get_default_backend, set_default_backend |