diff --git a/python/test/fixtures.py b/python/test/fixtures.py index 537ee3777..cca2f33ce 100644 --- a/python/test/fixtures.py +++ b/python/test/fixtures.py @@ -75,6 +75,7 @@ def repo_path(): def _finalize_mpi(): if _mpi4py_enabled: from mpi4py import MPI + MPI.Finalize() else: A.mpi_finalize() @@ -88,6 +89,7 @@ def context(): if _mpi_enabled: if _mpi4py_enabled: from mpi4py import MPI + if not MPI.Is_initialized(): MPI.Initialize() atexit.register(_finalize_mpi) diff --git a/python/test/unit/test_diffusion.py b/python/test/unit/test_diffusion.py index 344b40f61..7e5405390 100644 --- a/python/test/unit/test_diffusion.py +++ b/python/test/unit/test_diffusion.py @@ -80,6 +80,7 @@ def __init__(self, args): mpi = None if A.config()["mpi"]: from mpi4py import MPI + mpi = MPI.COMM_WORLD gpu_id = None if A.config()["gpu"]: