From 2e7d7f220fcbc1eac8b1b6ccff0eba5338a335d9 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Thu, 24 Sep 2015 09:37:15 -0600 Subject: [PATCH 1/4] Open opal frameworks in opal_init not ompi_mpi_init The allocator, rcache, and mpool frameworks were moved down to opal some time ago. The framework open calls should have been moved as well. Signed-off-by: Nathan Hjelm --- ompi/runtime/ompi_mpi_finalize.c | 9 --------- ompi/runtime/ompi_mpi_init.c | 12 ------------ opal/runtime/opal_finalize.c | 6 ++++++ opal/runtime/opal_init.c | 15 +++++++++++++++ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ompi/runtime/ompi_mpi_finalize.c b/ompi/runtime/ompi_mpi_finalize.c index 14159958290..869adc732d1 100644 --- a/ompi/runtime/ompi_mpi_finalize.c +++ b/ompi/runtime/ompi_mpi_finalize.c @@ -401,15 +401,6 @@ int ompi_mpi_finalize(void) if (OMPI_SUCCESS != (ret = mca_base_framework_close(&ompi_bml_base_framework))) { return ret; } - if (OMPI_SUCCESS != (ret = mca_base_framework_close(&opal_mpool_base_framework))) { - return ret; - } - if (OMPI_SUCCESS != (ret = mca_base_framework_close(&opal_rcache_base_framework))) { - return ret; - } - if (OMPI_SUCCESS != (ret = mca_base_framework_close(&opal_allocator_base_framework))) { - return ret; - } /* free proc resources */ if ( OMPI_SUCCESS != (ret = ompi_proc_finalize())) { diff --git a/ompi/runtime/ompi_mpi_init.c b/ompi/runtime/ompi_mpi_init.c index 8c23e17b180..52e4bdaed18 100644 --- a/ompi/runtime/ompi_mpi_init.c +++ b/ompi/runtime/ompi_mpi_init.c @@ -556,18 +556,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided) /* Open up MPI-related MCA components */ - if (OMPI_SUCCESS != (ret = mca_base_framework_open(&opal_allocator_base_framework, 0))) { - error = "mca_allocator_base_open() failed"; - goto error; - } - if (OMPI_SUCCESS != (ret = mca_base_framework_open(&opal_rcache_base_framework, 0))) { - error = "mca_rcache_base_open() failed"; - goto error; - } - if (OMPI_SUCCESS != (ret = mca_base_framework_open(&opal_mpool_base_framework, 0))) { - error = "mca_mpool_base_open() failed"; - goto error; - } if (OMPI_SUCCESS != (ret = mca_base_framework_open(&ompi_bml_base_framework, 0))) { error = "mca_bml_base_open() failed"; goto error; diff --git a/opal/runtime/opal_finalize.c b/opal/runtime/opal_finalize.c index 382deb3c324..5bfbd68cce3 100644 --- a/opal/runtime/opal_finalize.c +++ b/opal/runtime/opal_finalize.c @@ -55,6 +55,8 @@ #include "opal/runtime/opal_cr.h" #include "opal/mca/crs/base/base.h" +#include "opal/frameworks.h" + extern int opal_initialized; extern int opal_util_initialized; extern bool opal_init_called; @@ -139,6 +141,10 @@ opal_finalize(void) /* close the checkpoint and restart service */ opal_cr_finalize(); + (void) mca_base_framework_close (&opal_mpool_base_framework); + (void) mca_base_framework_close (&opal_rcache_base_framework); + (void) mca_base_framework_close (&opal_allocator_base_framework); + /* close the security framework */ (void) mca_base_framework_close(&opal_sec_base_framework); diff --git a/opal/runtime/opal_init.c b/opal/runtime/opal_init.c index cea62629119..c0ba59a7ba4 100644 --- a/opal/runtime/opal_init.c +++ b/opal/runtime/opal_init.c @@ -60,6 +60,8 @@ #include "opal/mca/event/base/base.h" #include "opal/mca/backtrace/base/base.h" +#include "opal/frameworks.h" + #include "opal/constants.h" #include "opal/util/error.h" #include "opal/util/stacktrace.h" @@ -529,6 +531,19 @@ opal_init(int* pargc, char*** pargv) goto return_error; } + if (OPAL_SUCCESS != (ret = mca_base_framework_open(&opal_allocator_base_framework, 0))) { + error = "mca_allocator_base_open() failed"; + goto return_error; + } + if (OPAL_SUCCESS != (ret = mca_base_framework_open(&opal_rcache_base_framework, 0))) { + error = "mca_rcache_base_open() failed"; + goto return_error; + } + if (OPAL_SUCCESS != (ret = mca_base_framework_open(&opal_mpool_base_framework, 0))) { + error = "mca_mpool_base_open() failed"; + goto return_error; + } + return OPAL_SUCCESS; return_error: From 7d9f629496aeaf68d7d2c75701919ea07869ebb7 Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Thu, 24 Sep 2015 09:54:53 -0600 Subject: [PATCH 2/4] mpool: remote unnecessary mca_mpool_base_init function The mca_mpool_base_init function did nothing other than set a few static variables. These variables are not used ever. If mpool components wish to know that threads are in use they can use opal_using_threads (). Signed-off-by: Nathan Hjelm --- ompi/runtime/ompi_mpi_init.c | 11 ------- opal/mca/mpool/base/Makefile.am | 3 +- opal/mca/mpool/base/base.h | 1 - opal/mca/mpool/base/mpool_base_alloc.c | 2 ++ opal/mca/mpool/base/mpool_base_init.c | 43 -------------------------- 5 files changed, 4 insertions(+), 56 deletions(-) delete mode 100644 opal/mca/mpool/base/mpool_base_init.c diff --git a/ompi/runtime/ompi_mpi_init.c b/ompi/runtime/ompi_mpi_init.c index 52e4bdaed18..dbe05f89f76 100644 --- a/ompi/runtime/ompi_mpi_init.c +++ b/ompi/runtime/ompi_mpi_init.c @@ -54,10 +54,6 @@ #include "opal/util/show_help.h" #include "opal/runtime/opal.h" #include "opal/mca/event/event.h" -#include "opal/mca/allocator/base/base.h" -#include "opal/mca/rcache/base/base.h" -#include "opal/mca/rcache/rcache.h" -#include "opal/mca/mpool/base/base.h" #include "opal/mca/pmix/pmix.h" #include "opal/util/timings.h" @@ -589,13 +585,6 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided) /* Select which MPI components to use */ - if (OMPI_SUCCESS != - (ret = mca_mpool_base_init(OPAL_ENABLE_PROGRESS_THREADS, - ompi_mpi_thread_multiple))) { - error = "mca_mpool_base_init() failed"; - goto error; - } - if (OMPI_SUCCESS != (ret = mca_pml_base_select(OPAL_ENABLE_PROGRESS_THREADS, ompi_mpi_thread_multiple))) { diff --git a/opal/mca/mpool/base/Makefile.am b/opal/mca/mpool/base/Makefile.am index 4ab8570d94a..d571ae08a6d 100644 --- a/opal/mca/mpool/base/Makefile.am +++ b/opal/mca/mpool/base/Makefile.am @@ -10,6 +10,8 @@ # Copyright (c) 2004-2005 The Regents of the University of California. # All rights reserved. # Copyright (c) 2007 Cisco Systems, Inc. All rights reserved. +# Copyright (c) 2015 Los Alamos National Security, LLC. All rights +# reserved. # $COPYRIGHT$ # # Additional copyrights may follow @@ -23,7 +25,6 @@ headers += \ base/mpool_base_tree.h libmca_mpool_la_SOURCES += \ base/mpool_base_frame.c \ - base/mpool_base_init.c \ base/mpool_base_lookup.c \ base/mpool_base_alloc.c \ base/mpool_base_mem_cb.c \ diff --git a/opal/mca/mpool/base/base.h b/opal/mca/mpool/base/base.h index 355a64dfd15..7deb81aef64 100644 --- a/opal/mca/mpool/base/base.h +++ b/opal/mca/mpool/base/base.h @@ -65,7 +65,6 @@ OPAL_DECLSPEC OBJ_CLASS_DECLARATION(mca_mpool_base_selected_module_t); * Global functions for MCA: overall mpool open and close */ -OPAL_DECLSPEC int mca_mpool_base_init(bool enable_progress_threads, bool enable_mpi_threads); OPAL_DECLSPEC mca_mpool_base_component_t* mca_mpool_base_component_lookup(const char* name); OPAL_DECLSPEC mca_mpool_base_module_t* mca_mpool_base_module_create( const char* name, diff --git a/opal/mca/mpool/base/mpool_base_alloc.c b/opal/mca/mpool/base/mpool_base_alloc.c index d72b0b8d98d..7b5bdb09f2a 100644 --- a/opal/mca/mpool/base/mpool_base_alloc.c +++ b/opal/mca/mpool/base/mpool_base_alloc.c @@ -44,6 +44,8 @@ struct opal_info_t { }; typedef struct opal_info_t opal_info_t; +OBJ_CLASS_INSTANCE(mca_mpool_base_selected_module_t, opal_list_item_t, NULL, NULL); + /** * Memory Pool Registration */ diff --git a/opal/mca/mpool/base/mpool_base_init.c b/opal/mca/mpool/base/mpool_base_init.c deleted file mode 100644 index 85c01f301a4..00000000000 --- a/opal/mca/mpool/base/mpool_base_init.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -#include "opal_config.h" - -#include "opal/mca/mca.h" -#include "opal/mca/base/base.h" -#include "opal/mca/mpool/base/base.h" - -OBJ_CLASS_INSTANCE(mca_mpool_base_selected_module_t, opal_list_item_t, NULL, NULL); -static bool mca_mpool_enable_progress_threads = true; -static bool mca_mpool_enable_mpi_thread_multiple = true; - -/** - * Function for weeding out mpool modules that don't want to run. - * - * Call the init function on all available components to find out if they - * want to run. Select all components that don't fail. Failing modules - * will be closed and unloaded. The selected modules will be returned - * to the caller in a opal_list_t. - */ -int mca_mpool_base_init(bool enable_progress_threads, bool enable_mpi_thread_multiple) -{ - mca_mpool_enable_progress_threads = enable_progress_threads; - mca_mpool_enable_mpi_thread_multiple = enable_mpi_thread_multiple; - return OPAL_SUCCESS; -} - From 6f30ccb9a31e33bdaf4fe7b9fa2917a9d54d0fac Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Thu, 24 Sep 2015 09:57:52 -0600 Subject: [PATCH 3/4] ompi_mpi_finalize: remote unused headers Signed-off-by: Nathan Hjelm --- ompi/runtime/ompi_mpi_finalize.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ompi/runtime/ompi_mpi_finalize.c b/ompi/runtime/ompi_mpi_finalize.c index 869adc732d1..7c57f79b61d 100644 --- a/ompi/runtime/ompi_mpi_finalize.c +++ b/ompi/runtime/ompi_mpi_finalize.c @@ -11,7 +11,7 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2006-2013 Cisco Systems, Inc. All rights reserved. - * Copyright (c) 2006-2014 Los Alamos National Security, LLC. All rights + * Copyright (c) 2006-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2006 University of Houston. All rights reserved. * Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. @@ -47,10 +47,7 @@ #include "opal/sys/atomic.h" #include "opal/runtime/opal.h" #include "opal/util/show_help.h" -#include "opal/mca/mpool/base/base.h" #include "opal/mca/mpool/base/mpool_base_tree.h" -#include "opal/mca/rcache/base/base.h" -#include "opal/mca/allocator/base/base.h" #include "opal/mca/pmix/pmix.h" #include "opal/util/timings.h" From 18d5e750debde0b92097aabcbc8838d5de67af8f Mon Sep 17 00:00:00 2001 From: Nathan Hjelm Date: Thu, 24 Sep 2015 10:43:49 -0600 Subject: [PATCH 4/4] ompi_mpi_init: use opal_init not opal_init_util opal_init is responsible for loading frameworks that will be used by the ompi layer. Many of these frameworks are not loaded by opal_init_util. Before this commit things were working because orte_init does use opal_init. Signed-off-by: Nathan Hjelm --- ompi/runtime/ompi_mpi_finalize.c | 2 +- ompi/runtime/ompi_mpi_init.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ompi/runtime/ompi_mpi_finalize.c b/ompi/runtime/ompi_mpi_finalize.c index 7c57f79b61d..19f75b0e42f 100644 --- a/ompi/runtime/ompi_mpi_finalize.c +++ b/ompi/runtime/ompi_mpi_finalize.c @@ -422,7 +422,7 @@ int ompi_mpi_finalize(void) return ret; } - if (OPAL_SUCCESS != (ret = opal_finalize_util())) { + if (OPAL_SUCCESS != (ret = opal_finalize ())) { return ret; } diff --git a/ompi/runtime/ompi_mpi_init.c b/ompi/runtime/ompi_mpi_init.c index dbe05f89f76..6427dd6f7b7 100644 --- a/ompi/runtime/ompi_mpi_init.c +++ b/ompi/runtime/ompi_mpi_init.c @@ -386,8 +386,8 @@ int ompi_mpi_init(int argc, char **argv, int requested, int *provided) /* Setup enough to check get/set MCA params */ - if (OPAL_SUCCESS != (ret = opal_init_util(&argc, &argv))) { - error = "ompi_mpi_init: opal_init_util failed"; + if (OPAL_SUCCESS != (ret = opal_init (&argc, &argv))) { + error = "ompi_mpi_init: opal_init failed"; goto error; }