File: force-adios2-mpi.patch

package info (click to toggle)
adios4dolfinx 0.10.0.post0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 536 kB
  • sloc: python: 4,180; sh: 28; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 719 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--- 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 (