1
1

* remove need to edit project/Makefile.am and project/{dynamic-,}mca/Makefile.am when adding a new component. Configure / autogen now do it for you.

* Add base to memory framework so that we can do something sane with
  ompi_info
* Updated ompi_info to print components for memory framework and
  show whether we have memory hooks active or not.

This commit was SVN r6861.
Этот коммит содержится в:
Brian Barrett 2005-08-13 20:19:24 +00:00
родитель c83cb66bf2
Коммит 8aca9ef966
22 изменённых файлов: 347 добавлений и 93 удалений

Просмотреть файл

@ -240,12 +240,34 @@ AC_DEFUN([MCA_CONFIGURE_PROJECT],[
# first argument. Protect against calling MCA_CONFIGURE_FRAMEWORK
# with an empty second argument. Grrr....
# if there isn't a project list, abort
#
# Also setup two variables for Makefiles:
# MCA_project_FRAMEWORKS - list of frameworks in that project
# MCA_project_FRAMEWORK_LIBS - list of libraries (or variables pointing
# to more libraries) that must be included
# in the project's main library
m4_ifdef([mca_$1_framework_list], [],
[m4_fatal([Could not find mca_$1_framework_list - rerun autogen.sh without -l])])
MCA_$1_FRAMEWORKS=
MCA_$1_FRAMEWORK_LIBS=
m4_foreach(mca_framework, [mca_$1_framework_list],
[m4_ifval(mca_framework,
[MCA_CONFIGURE_FRAMEWORK($1, mca_framework)])])
[# common has to go up front
if test "mca_framework" = "common" ; then
MCA_$1_FRAMEWORKS="mca_framework $MCA_$1_FRAMEWORKS"
else
MCA_$1_FRAMEWORKS="$MCA_$1_FRAMEWORKS mca_framework"
fi
if test "mca_framework" != "common" ; then
MCA_$1_FRAMEWORK_LIBS="$MCA_$1_FRAMEWORK_LIBS [mca/]mca_framework[/base/libmca_]mca_framework[_base.la]"
fi
MCA_$1_FRAMEWORK_LIBS="$MCA_$1_FRAMEWORK_LIBS [\$(MCA_]mca_framework[_STATIC_LTLIBS)]"
MCA_CONFIGURE_FRAMEWORK($1, mca_framework)])])
AC_SUBST(MCA_$1_FRAMEWORKS)
AC_SUBST(MCA_$1_FRAMEWORK_LIBS)
])
######################################################################

Просмотреть файл

@ -136,20 +136,13 @@ libmpi_la_LIBADD = \
file/libfile.la \
group/libgroup.la \
info/libinfo.la \
mca/allocator/base/libmca_allocator_base.la $(MCA_allocator_STATIC_LTLIBS) \
mca/btl/base/libmca_btl_base.la $(MCA_btl_STATIC_LTLIBS) \
mca/coll/base/libmca_coll_base.la $(MCA_coll_STATIC_LTLIBS) \
$(MCA_common_STATIC_LTLIBS) \
mca/io/base/libmca_io_base.la $(MCA_io_STATIC_LTLIBS) \
mca/mpool/base/libmca_mpool_base.la $(MCA_mpool_STATIC_LTLIBS) \
mca/pml/base/libmca_pml_base.la $(MCA_pml_STATIC_LTLIBS) \
mca/bml/base/libmca_bml_base.la $(MCA_bml_STATIC_LTLIBS) \
mca/ptl/base/libmca_ptl_base.la $(MCA_ptl_STATIC_LTLIBS) \
mca/topo/base/libmca_topo_base.la $(MCA_topo_STATIC_LTLIBS) \
mpi/c/libmpi_c.la $(c_mpi_lib) $(c_pmpi_lib) \
$(f77_base_lib) $(f77_mpi_lib) $(f77_pmpi_lib) \
runtime/libmpiruntime.la \
op/libop.la \
proc/libproc.la \
request/librequest.la
request/librequest.la \
$(MCA_ompi_FRAMEWORK_LIBS)
libmpi_la_DEPENDENCIES = $(libmpi_la_LIBADD)

Просмотреть файл

@ -16,14 +16,4 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = \
common \
allocator \
bml \
btl \
coll \
io \
mpool \
pml \
ptl \
topo
SUBDIRS = $(MCA_ompi_FRAMEWORKS)

Просмотреть файл

@ -18,14 +18,4 @@ include $(top_srcdir)/config/Makefile.options
EXTRA_DIST = win_makefile
SUBDIRS = \
common \
allocator \
bml \
btl \
coll \
io \
mpool \
pml \
ptl \
topo
SUBDIRS = $(MCA_ompi_FRAMEWORKS)

Просмотреть файл

@ -31,6 +31,8 @@
#include "opal/mca/paffinity/paffinity.h"
#include "opal/mca/paffinity/base/base.h"
#include "opal/mca/paffinity/base/internal.h"
#include "opal/mca/memory/memory.h"
#include "opal/mca/memory/base/base.h"
#include "ompi/mca/allocator/allocator.h"
#include "ompi/mca/allocator/base/base.h"
@ -144,6 +146,9 @@ void ompi_info::open_components()
// OPAL frameworks
opal_memory_base_open();
component_map["memory"] = &opal_memory_base_components_opened;
opal_paffinity_base_open();
component_map["paffinity"] = &opal_paffinity_base_components_opened;
@ -254,6 +259,7 @@ void ompi_info::close_components()
orte_rml_base_close();
mca_oob_base_close();
opal_memory_base_close();
opal_paffinity_base_close();
component_map.clear();

Просмотреть файл

@ -33,6 +33,7 @@
#include "opal/class/opal_value_array.h"
#include "opal/util/printf.h"
#include "opal/util/show_help.h"
#include "opal/memory/memory.h"
#include "mca/base/mca_base_param.h"
#include "tools/ompi_info/ompi_info.h"
@ -329,6 +330,7 @@ void ompi_info::do_config(bool want_all)
const string f90(OMPI_WANT_F90_BINDINGS ? "yes" : "no");
const string memprofile(OMPI_ENABLE_MEM_PROFILE ? "yes" : "no");
const string memdebug(OMPI_ENABLE_MEM_DEBUG ? "yes" : "no");
const string memhooks(opal_mem_free_is_supported() ? "yes" : "no");
const string debug(OMPI_ENABLE_DEBUG ? "yes" : "no");
const string cprofiling(OMPI_ENABLE_MPI_PROFILING ? "yes" : "no");
const string cxxprofiling(OMPI_ENABLE_MPI_PROFILING ? "yes" : "no");
@ -341,7 +343,7 @@ void ompi_info::do_config(bool want_all)
const string paramcheck(0 == MPI_PARAM_CHECK ? "never" :
1 == MPI_PARAM_CHECK ? "always" : "runtime");
string threads;
if (OMPI_HAVE_SOLARIS_THREADS || OMPI_HAVE_POSIX_THREADS) {
threads = OMPI_HAVE_SOLARIS_THREADS ? "solaris" :
OMPI_HAVE_POSIX_THREADS ? "posix" : "type unknown";
@ -563,5 +565,6 @@ void ompi_info::do_config(bool want_all)
out("MPI parameter check", "option:mpi-param-check", paramcheck);
out("Memory profiling support", "option:mem-profile", memprofile);
out("Memory debugging support", "option:mem-debug", memdebug);
out("Memory hook support", "option:mem-hook", memhooks);
out("libltdl support", "option:dlopen", OMPI_WANT_LIBLTDL);
}

Просмотреть файл

@ -40,12 +40,12 @@ libopal_la_LIBADD = \
class/libclass.la \
event/libevent.la \
mca/base/libmca_base.la \
mca/paffinity/base/libmca_paffinity_base.la $(MCA_paffinity_STATIC_LTLIBS) \
memory/libopalmemory.la \
runtime/libruntime.la \
$(MCA_memory_STATIC_LTLIBS) \
threads/libthreads.la \
util/libopalutil.la
util/libopalutil.la \
$(MCA_opal_FRAMEWORK_LIBS)
libopal_la_DEPENDENCIES = $(libopal_la_LIBADD)
# Conditionally install the header files

Просмотреть файл

@ -16,6 +16,5 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = \
memory \
paffinity
SUBDIRS = $(MCA_opal_FRAMEWORKS)

Просмотреть файл

@ -18,8 +18,7 @@ include $(top_srcdir)/config/Makefile.options
SUBDIRS = \
base \
memory \
paffinity
$(MCA_opal_FRAMEWORKS)
# Source code files

Просмотреть файл

@ -16,4 +16,24 @@
include $(top_srcdir)/config/Makefile.options
# nothing to do but sit around and wait for the grass to grow.
noinst_LTLIBRARIES = libmca_memory_base.la
headers = \
base.h
libmca_memory_base_la_SOURCES = \
$(headers) \
memory_base_close.c \
memory_base_open.c
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(includedir)/openmpi/ompi/mca/memory/base
ompi_HEADERS = $(headers)
else
ompidir = $(includedir)
endif
distclean-local:
rm -f static-components.h

75
opal/mca/memory/base/base.h Обычный файл
Просмотреть файл

@ -0,0 +1,75 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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$
*
*/
#ifndef OPAL_MEMORY_BASE_H
#define OPAL_MEMORY_BASE_H
#include "ompi_config.h"
#include "mca/memory/memory.h"
/*
* Global functions for MCA overall memory open and close
*/
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
/**
* Initialize the memory MCA framework
*
* @retval OPAL_SUCCESS Upon success
* @retval OPAL_ERROR Upon failure
*
* This must be the first function invoked in the memory MCA
* framework. It initializes the memory MCA framework, finds
* and opens memory components, etc.
*
* This function is invoked during opal_init() and during the
* initialization of the special case of the laminfo command.
*
* This function fills in the internal global variable
* opal_memory_base_components_opened, which is a list of all
* memory components that were successfully opened. This
* variable should \em only be used by other memory base
* functions -- it is not considered a public interface member --
* and is only mentioned here for completeness.
*/
OMPI_DECLSPEC int opal_memory_base_open(void);
/**
* Shut down the memory MCA framework.
*
* @retval OPAL_SUCCESS Always
*
* This function shuts down everything in the memory MCA
* framework, and is called during opal_finalize() and the
* special case of the laminfo command.
*
* It must be the last function invoked on the memory MCA framework.
*/
OMPI_DECLSPEC int opal_memory_base_close(void);
extern opal_list_t opal_memory_base_components_opened;
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* OPAL_BASE_MEMORY_H */

35
opal/mca/memory/base/memory_base_close.c Обычный файл
Просмотреть файл

@ -0,0 +1,35 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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 "ompi_config.h"
#include "opal/include/opal_constants.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/memory/memory.h"
#include "opal/mca/memory/base/base.h"
int opal_memory_base_close(void)
{
/* Close all components that are still open (this should only
happen during laminfo). */
mca_base_components_close(0, &opal_memory_base_components_opened, NULL);
OBJ_DESTRUCT(&opal_memory_base_components_opened);
/* All done */
return OPAL_SUCCESS;
}

60
opal/mca/memory/base/memory_base_open.c Обычный файл
Просмотреть файл

@ -0,0 +1,60 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* 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 "ompi_config.h"
#include "opal/include/opal_constants.h"
#include "opal/util/output.h"
#include "opal/mca/mca.h"
#include "opal/mca/base/base.h"
#include "opal/mca/base/mca_base_param.h"
#include "opal/mca/memory/memory.h"
#include "opal/mca/memory/base/base.h"
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
* component's public mca_base_component_t struct.
*/
#include "opal/mca/memory/base/static-components.h"
/*
* Globals
*/
opal_list_t opal_memory_base_components_opened;
/*
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int opal_memory_base_open(void)
{
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("memory", 0,
mca_memory_base_static_components,
&opal_memory_base_components_opened,
true)) {
return OPAL_ERROR;
}
/* All done */
return OPAL_SUCCESS;
}

Просмотреть файл

@ -22,7 +22,35 @@
#define __USE_GNU
#include <dlfcn.h>
#include "opal/mca/memory/memory.h"
#include "opal/memory/memory_internal.h"
const opal_memory_base_component_1_0_0_t mca_memory_malloc_hooks_component = {
/* First, the mca_component_t struct containing meta information
about the component itself */
{
/* Indicate that we are a memory v1.0.0 component (which also
implies a specific MCA version) */
OPAL_MEMORY_BASE_VERSION_1_0_0,
/* Component name and version */
"malloc_hooks",
OPAL_MAJOR_VERSION,
OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION,
/* Component open and close functions */
NULL,
NULL
},
/* Next the MCA v1.0.0 component meta data */
{
/* Whether the component is checkpointable or not */
true
},
};
/* Prototypes for our hooks. */
static void opal_mem_free_init_hook (void);

Просмотреть файл

@ -19,4 +19,43 @@
any of that. The only two functions that a component must call
(note: call, not implement) are defined in
opal/memory/memory_internal.h. Other than that, to each his
own.. */
own..
Components should make some attempt to provide a component struct
via the usual means, just so ompi_info has something rational to
display.
*/
#ifndef OPAL_MCA_MEMORY_MEMORY_H
#define OPAL_MCA_MEMORY_MEMORY_H
#include "ompi_config.h"
#include "mca/mca.h"
#include "mca/base/base.h"
/**
* Structure for memory v1.0.0 components.
* Chained to MCA v1.0.0
*/
struct opal_memory_base_component_1_0_0_t {
/** MCA base component */
mca_base_component_t memoryc_version;
/** MCA base data */
mca_base_component_data_1_0_0_t memoryc_data;
};
/**
* Convenience typedef
*/
typedef struct opal_memory_base_component_1_0_0_t opal_memory_base_component_1_0_0_t;
/*
* Macro for use in components that are of type memory v1.0.0
*/
#define OPAL_MEMORY_BASE_VERSION_1_0_0 \
/* memory v1.0 is chained to MCA v1.0 */ \
MCA_BASE_VERSION_1_0_0, \
/* memory v1.0 */ \
"memory", 1, 0, 0
#endif /* OPAL_MCA_MEMORY_MEMORY_H */

Просмотреть файл

@ -7,8 +7,35 @@
#include <sys/mman.h>
#include <sys/types.h>
#include "opal/mca/memory/memory.h"
#include "opal/memory/memory_internal.h"
const opal_memory_base_component_1_0_0_t mca_memory_ptmalloc2_component = {
/* First, the mca_component_t struct containing meta information
about the component itself */
{
/* Indicate that we are a memory v1.0.0 component (which also
implies a specific MCA version) */
OPAL_MEMORY_BASE_VERSION_1_0_0,
/* Component name and version */
"ptmalloc2s",
OPAL_MAJOR_VERSION,
OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION,
/* Component open and close functions */
NULL,
NULL
},
/* Next the MCA v1.0.0 component meta data */
{
/* Whether the component is checkpointable or not */
true
},
};
/*
* Not all systems have sbrk() declared, since it's technically not a
* POSIX function.

Просмотреть файл

@ -27,7 +27,7 @@
int opal_paffinity_base_close(void)
{
/* Close all components that are still open (this should only
happen during laminfo). */
happen during ompi_info). */
if (opal_paffinity_base_components_opened_valid) {
mca_base_components_close(opal_paffinity_base_output,

Просмотреть файл

@ -28,6 +28,10 @@
#ifndef OPAL_MEMORY_MEMORY_H
#define OPAl_MEMORY_MEMORY_H
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
int opal_mem_free_init(void);
@ -103,4 +107,8 @@ int opal_mem_free_register_handler(opal_mem_free_unpin_fn_t *func, void *cbdata)
*/
int opal_mem_free_unregister_handler(opal_mem_free_unpin_fn_t *func);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* OPAL_MEMORY_MEMORY_H */

Просмотреть файл

@ -34,20 +34,8 @@ liborte_la_SOURCES =
liborte_la_LIBADD = \
class/libclass.la \
dps/libdps.la \
mca/errmgr/base/libmca_errmgr_base.la \
mca/gpr/base/libmca_gpr_base.la $(MCA_gpr_STATIC_LTLIBS) \
mca/iof/base/libmca_iof_base.la $(MCA_iof_STATIC_LTLIBS) \
mca/ns/base/libmca_ns_base.la $(MCA_ns_STATIC_LTLIBS) \
mca/oob/base/libmca_oob_base.la $(MCA_oob_STATIC_LTLIBS) \
mca/pls/base/libmca_pls_base.la $(MCA_pls_STATIC_LTLIBS) \
mca/ras/base/libmca_ras_base.la $(MCA_ras_STATIC_LTLIBS) \
mca/rds/base/libmca_rds_base.la $(MCA_rds_STATIC_LTLIBS) \
mca/rmaps/base/libmca_rmaps_base.la $(MCA_rmaps_STATIC_LTLIBS) \
mca/rmgr/base/libmca_orte_rmgr_base.la $(MCA_rmgr_STATIC_LTLIBS) \
mca/rml/base/libmca_rml_base.la $(MCA_rml_STATIC_LTLIBS) \
mca/schema/base/libmca_schema_base.la $(MCA_schema_STATIC_LTLIBS) \
mca/sds/base/libmca_sds_base.la $(MCA_sds_STATIC_LTLIBS) \
mca/soh/base/libmca_soh_base.la $(MCA_soh_STATIC_LTLIBS) \
runtime/libruntime.la \
util/liborteutil.la
util/liborteutil.la \
$(MCA_orte_FRAMEWORK_LIBS)
liborte_la_DEPENDENCIES = $(liborte_la_LIBADD)

Просмотреть файл

@ -16,18 +16,4 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = \
errmgr \
gpr \
iof \
ns \
oob \
pls \
ras \
rds \
rmaps \
rmgr \
rml \
schema \
sds \
soh
SUBDIRS = $(MCA_orte_FRAMEWORKS)

Просмотреть файл

@ -16,18 +16,4 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = \
errmgr \
gpr \
iof \
ns \
oob \
pls \
ras \
rds \
rmaps \
rmgr \
rml \
schema \
sds \
soh
SUBDIRS = $(MCA_orte_FRAMEWORKS)

Просмотреть файл

@ -16,7 +16,7 @@
include $(top_srcdir)/config/Makefile.options
noinst_LTLIBRARIES = libmca_orte_rmgr_base.la
noinst_LTLIBRARIES = libmca_rmgr_base.la
# For VPATH builds, have to specify where static-modules.h will be found
@ -29,7 +29,7 @@ headers = \
# Library
libmca_orte_rmgr_base_la_SOURCES = \
libmca_rmgr_base_la_SOURCES = \
$(headers) \
rmgr_base_context.c \
rmgr_base_close.c \