From 0d24fad307283e3885526e90dbdfd429393f3b74 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 29 Sep 2016 13:49:19 +0900 Subject: [PATCH] opal: always run opal_class_finalize in the opal_cleanup destructor if MPI_Init[_thread]/MPI_Finalize and MPI_T_init_thread/MPI_T_finalize are balanced, opal_initialized is zero, and hence opal_cleanup destructor never invokes opal_class_finalize. if MPI_Init[_thread] nor MPI_T_init_thread have been called, classes is NULL, so opal_class_finalize does nothing --- opal/runtime/opal_finalize.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/opal/runtime/opal_finalize.c b/opal/runtime/opal_finalize.c index 83beb5ac53..28a0222ec4 100644 --- a/opal/runtime/opal_finalize.c +++ b/opal/runtime/opal_finalize.c @@ -13,6 +13,8 @@ * Copyright (c) 2010-2015 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2013-2015 Intel, Inc. All rights reserved + * Copyright (c) 2016 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -60,11 +62,6 @@ extern bool opal_init_called; static void __opal_attribute_destructor__ opal_cleanup (void) { - if (!opal_initialized) { - /* nothing to do */ - return; - } - /* finalize the class/object system */ opal_class_finalize(); }