From 0a0ab8a23a40798ff0eb30887773cf5517adc200 Mon Sep 17 00:00:00 2001 From: Angus Gibson Date: Mon, 5 Feb 2024 01:10:39 +0000 Subject: [PATCH] Only delete compcomm on icomm if it exists Within the MPI implementation, an inner communicator can optionally contain a compilation commucator. An indentation error meant that the compilation attribute was unconditionally deleted, causing incorrect MPI behaviour if the attribute had never been set in the first place. On MPICH, this doesn't seem to raise any errors, but with OpenMPI it causes errors like: mpi4py.MPI.Exception: MPI_ERR_OTHER: known error not in list --- pyop2/mpi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyop2/mpi.py b/pyop2/mpi.py index a84fa2b51..554155f20 100644 --- a/pyop2/mpi.py +++ b/pyop2/mpi.py @@ -201,7 +201,7 @@ def delcomm_outer(comm, keyval, icomm): if comp_comm is not None: debug('Removing compilation comm on inner comm') decref(comp_comm) - icomm.Delete_attr(compilationcomm_keyval) + icomm.Delete_attr(compilationcomm_keyval) # Once we have removed the reference to the inner/compilation comm we can free it cidx = icomm.Get_attr(cidx_keyval)