From 3a00f86166be8bbf9980d30f2cdd6a502df2b70c Mon Sep 17 00:00:00 2001 From: Jack Betteridge Date: Fri, 12 Jan 2024 16:29:18 +0000 Subject: [PATCH] Reverse duped comm dict --- pyop2/mpi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyop2/mpi.py b/pyop2/mpi.py index 7a0ed1f63..a84fa2b51 100644 --- a/pyop2/mpi.py +++ b/pyop2/mpi.py @@ -532,7 +532,7 @@ def _free_comms(): debug("STATE2") debug(pyop2_comm_status()) debug(f"Freeing comms in list (length {len(_DUPED_COMM_DICT)})") - for key in sorted(_DUPED_COMM_DICT.keys()): + for key in sorted(_DUPED_COMM_DICT.keys(), reverse=True): comm = _DUPED_COMM_DICT[key] if comm != MPI.COMM_NULL: refcount = comm.Get_attr(refcount_keyval)