From e4f5f321dd6e076ddbd257b591d7b419eeb924c0 Mon Sep 17 00:00:00 2001 From: Gerhard Theurich Date: Mon, 31 Jul 2023 12:00:23 -0700 Subject: [PATCH] Move MPI tool finalization, i.e. MPI_T_finalize(), after MPI_Finalize(). As per MPI standard it can be done either way, but for some reason the Darshan I/O performance profiler dies with SEGV if done in the other order. It is not clear to me why that is. --- src/Infrastructure/VM/src/ESMCI_VMKernel.C | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Infrastructure/VM/src/ESMCI_VMKernel.C b/src/Infrastructure/VM/src/ESMCI_VMKernel.C index 194eb5abe8..de8c1353f7 100644 --- a/src/Infrastructure/VM/src/ESMCI_VMKernel.C +++ b/src/Infrastructure/VM/src/ESMCI_VMKernel.C @@ -682,8 +682,6 @@ void VMK::finalize(int finalizeMpi){ delete [] cid[i]; delete [] cid; delete [] ssiLocalPetList; - // finalize the MPI tool interface - MPI_T_finalize(); // conditionally finalize MPI int finalized; MPI_Finalized(&finalized); @@ -695,6 +693,9 @@ void VMK::finalize(int finalizeMpi){ if (finalizeMpi) MPI_Finalize(); } + // finalize the MPI tool interface + // do this _after_ MPI_Finalize() or else Darshan dies with SEGV (not clear why) + MPI_T_finalize(); }