diff --git a/ompi/runtime/ompi_mpi_finalize.c b/ompi/runtime/ompi_mpi_finalize.c index 14159958290..19f75b0e42f 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" @@ -401,15 +398,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())) { @@ -434,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 8c23e17b180..6427dd6f7b7 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" @@ -390,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; } @@ -556,18 +552,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; @@ -601,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; -} - 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: