Per the meeting on moving the BTLs to OPAL, move the ORTE database "db" framework to OPAL so the relocated BTLs can access it. Because the data is indexed by process, this requires that we define a new "opal_identifier_t" that corresponds to the orte_process_name_t struct. In order to support multiple run-times, this is defined in opal/mca/db/db_types.h as a uint64_t without identifying the meaning of any part of that data.
A few changes were required to support this move: 1. the PMI component used to identify rte-related data (e.g., host name, bind level) and package them as a unit to reduce the number of PMI keys. This code was moved up to the ORTE layer as the OPAL layer has no understanding of these concepts. In addition, the component locally stored data based on process jobid/vpid - this could no longer be supported (see below for the solution). 2. the hash component was updated to use the new opal_identifier_t instead of orte_process_name_t as its index for storing data in the hash tables. Previously, we did a hash on the vpid and stored the data in a 32-bit hash table. In the revised system, we don't see a separate "vpid" field - we only have a 64-bit opaque value. The orte_process_name_t hash turned out to do nothing useful, so we now store the data in a 64-bit hash table. Preliminary tests didn't show any identifiable change in behavior or performance, but we'll have to see if a move back to the 32-bit table is required at some later time. 3. the db framework was a "select one" system. However, since the PMI component could no longer use its internal storage system, the framework has now been changed to a "select many" mode of operation. This allows the hash component to handle all internal storage, while the PMI component only handles pushing/pulling things from the PMI system. This was something we had planned for some time - when fetching data, we first check internal storage to see if we already have it, and then automatically go to the global system to look for it if we don't. Accordingly, the framework was provided with a custom query function used during "select" that lets you seperately specify the "store" and "fetch" ordering. 4. the ORTE grpcomm and ess/pmi components, and the nidmap code, were updated to work with the new db framework and to specify internal/global storage options. No changes were made to the MPI layer, except for modifying the ORTE component of the OMPI/rte framework to support the new db framework. This commit was SVN r28112.
This commit is contained in:
parent
7136dbb5b3
commit
bd9265c560
@ -11,7 +11,7 @@
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2009-2011 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2011 Los Alamos National Security, LLC. All rights
|
||||
# Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
@ -20,9 +20,9 @@
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# ORTE_CHECK_PMI(prefix, [action-if-found], [action-if-not-found])
|
||||
# OPAL_CHECK_PMI(prefix, [action-if-found], [action-if-not-found])
|
||||
# --------------------------------------------------------
|
||||
AC_DEFUN([ORTE_CHECK_PMI],[
|
||||
AC_DEFUN([OPAL_CHECK_PMI],[
|
||||
AC_ARG_WITH([pmi],
|
||||
[AC_HELP_STRING([--with-pmi],
|
||||
[Build PMI support (default: no)])],
|
||||
@ -32,23 +32,23 @@ AC_DEFUN([ORTE_CHECK_PMI],[
|
||||
[Include Cray PMI2 extensions (default: no)])],
|
||||
[], with_cray_pmi2_ext=no)
|
||||
|
||||
orte_enable_pmi=0
|
||||
orte_use_cray_pmi2_ext=0
|
||||
opal_enable_pmi=0
|
||||
opal_use_cray_pmi2_ext=0
|
||||
|
||||
# save flags
|
||||
orte_check_pmi_$1_save_CPPFLAGS="$CPPFLAGS"
|
||||
orte_check_pmi_$1_save_LDFLAGS="$LDFLAGS"
|
||||
orte_check_pmi_$1_save_LIBS="$LIBS"
|
||||
opal_check_pmi_$1_save_CPPFLAGS="$CPPFLAGS"
|
||||
opal_check_pmi_$1_save_LDFLAGS="$LDFLAGS"
|
||||
opal_check_pmi_$1_save_LIBS="$LIBS"
|
||||
|
||||
# set defaults
|
||||
orte_check_pmi_$1_LDFLAGS=
|
||||
orte_check_pmi_$1_CPPFLAGS=
|
||||
orte_check_pmi_$1_LIBS=
|
||||
opal_check_pmi_$1_LDFLAGS=
|
||||
opal_check_pmi_$1_CPPFLAGS=
|
||||
opal_check_pmi_$1_LIBS=
|
||||
|
||||
AC_MSG_CHECKING([if user requested PMI support])
|
||||
AS_IF([test "$with_pmi" = "no"],
|
||||
[AC_MSG_RESULT([no])
|
||||
orte_use_cray_pmi2_ext=0
|
||||
opal_use_cray_pmi2_ext=0
|
||||
$3],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_MSG_CHECKING([if PMI support installed])
|
||||
@ -57,14 +57,14 @@ AC_DEFUN([ORTE_CHECK_PMI],[
|
||||
# work with slurm :-(
|
||||
AS_IF([test ! -z "$with_pmi" -a "$with_pmi" != "yes"],
|
||||
[AS_IF([test -d "$with_pmi/lib64"],
|
||||
[orte_check_pmi_$1_LDFLAGS="-L$with_pmi/lib64"
|
||||
orte_check_pmi_$1_LIBS="-lpmi -Wl,-rpath=$with_pmi/lib64"],
|
||||
[orte_check_pmi_$1_LDFLAGS="-L$with_pmi/lib"
|
||||
orte_check_pmi_$1_LIBS="-lpmi -Wl,-rpath=$with_pmi/lib"])
|
||||
[opal_check_pmi_$1_LDFLAGS="-L$with_pmi/lib64"
|
||||
opal_check_pmi_$1_LIBS="-lpmi -Wl,-rpath=$with_pmi/lib64"],
|
||||
[opal_check_pmi_$1_LDFLAGS="-L$with_pmi/lib"
|
||||
opal_check_pmi_$1_LIBS="-lpmi -Wl,-rpath=$with_pmi/lib"])
|
||||
AS_IF([test -f "$with_pmi/include/pmi.h"],
|
||||
[orte_check_pmi_$1_CPPFLAGS="-I$with_pmi/include"],
|
||||
[opal_check_pmi_$1_CPPFLAGS="-I$with_pmi/include"],
|
||||
[AS_IF([test -f "$with_pmi/include/slurm/pmi.h"],
|
||||
[orte_check_pmi_$1_CPPFLAGS="-I$with_pmi/include/slurm"],
|
||||
[opal_check_pmi_$1_CPPFLAGS="-I$with_pmi/include/slurm"],
|
||||
[AC_MSG_RESULT([not found])
|
||||
AC_MSG_WARN([PMI support requested (via --with-pmi) but pmi.h])
|
||||
AC_MSG_WARN([not found under locations:])
|
||||
@ -74,21 +74,21 @@ AC_DEFUN([ORTE_CHECK_PMI],[
|
||||
AC_MSG_ERROR([Aborting])
|
||||
$3])])],
|
||||
[AS_IF([test -f "/usr/include/slurm/pmi.h"],
|
||||
[orte_check_pmi_$1_CPPFLAGS="-I/usr/include/slurm"])])
|
||||
[opal_check_pmi_$1_CPPFLAGS="-I/usr/include/slurm"])])
|
||||
|
||||
LDFLAGS="$LDFLAGS $orte_check_pmi_$1_LDFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $orte_check_pmi_$1_CPPFLAGS"
|
||||
LIBS="$LIBS $orte_check_pmi_$1_LIBS"
|
||||
orte_have_pmi_support=no
|
||||
LDFLAGS="$LDFLAGS $opal_check_pmi_$1_LDFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $opal_check_pmi_$1_CPPFLAGS"
|
||||
LIBS="$LIBS $opal_check_pmi_$1_LIBS"
|
||||
opal_have_pmi_support=no
|
||||
AC_CHECK_HEADERS([pmi.h],
|
||||
[AC_CHECK_LIB([pmi], [PMI_Init],
|
||||
[orte_have_pmi_support=yes])])
|
||||
[opal_have_pmi_support=yes])])
|
||||
|
||||
AS_IF([test "$orte_have_pmi_support" = "yes"],
|
||||
AS_IF([test "$opal_have_pmi_support" = "yes"],
|
||||
[AC_MSG_RESULT([yes])
|
||||
orte_enable_pmi=1
|
||||
$1_LDFLAGS="$orte_check_pmi_$1_LDFLAGS"
|
||||
$1_CPPFLAGS="$orte_check_pmi_$1_CPPFLAGS"
|
||||
opal_enable_pmi=1
|
||||
$1_LDFLAGS="$opal_check_pmi_$1_LDFLAGS"
|
||||
$1_CPPFLAGS="$opal_check_pmi_$1_CPPFLAGS"
|
||||
$1_LIBS="-lpmi"
|
||||
$2],
|
||||
[AC_MSG_RESULT([no])
|
||||
@ -99,31 +99,31 @@ AC_DEFUN([ORTE_CHECK_PMI],[
|
||||
AC_MSG_CHECKING([if user requested Cray PMI2 extensions])
|
||||
AS_IF([test "$with_cray_pmi2_ext" = "no"],
|
||||
[AC_MSG_RESULT([no])
|
||||
orte_use_pmi2_ext=0],
|
||||
opal_use_pmi2_ext=0],
|
||||
[AC_MSG_RESULT([yes])
|
||||
# check to see if pmi2.h header is present. if it is, then we
|
||||
# will use some of the functions in it.
|
||||
AC_MSG_CHECKING([if PMI2 extensions installed])
|
||||
AS_IF([test -f "$with_pmi/include/pmi2.h"],
|
||||
[orte_use_pmi2_ext=1
|
||||
[opal_use_pmi2_ext=1
|
||||
AC_MSG_RESULT(yes)],
|
||||
[AC_MSG_RESULT([no])
|
||||
AC_MSG_WARN([PMI2 extensions requested (via --with-cray-pmi2-ext) but not found.])
|
||||
AC_MSG_ERROR([Aborting.])
|
||||
orte_use_pmi2_ext=0
|
||||
orte_enable_pmi=0
|
||||
opal_use_pmi2_ext=0
|
||||
opal_enable_pmi=0
|
||||
$3])])])
|
||||
|
||||
# restore flags - have to add CPPFLAGS so base functions can find pmi.h
|
||||
CPPFLAGS="$orte_check_pmi_$1_save_CPPFLAGS $orte_check_pmi_$1_CPPFLAGS"
|
||||
LDFLAGS="$orte_check_pmi_$1_save_LDFLAGS"
|
||||
LIBS="$orte_check_pmi_$1_save_LIBS"
|
||||
CPPFLAGS="$opal_check_pmi_$1_save_CPPFLAGS $opal_check_pmi_$1_CPPFLAGS"
|
||||
LDFLAGS="$opal_check_pmi_$1_save_LDFLAGS"
|
||||
LIBS="$opal_check_pmi_$1_save_LIBS"
|
||||
|
||||
AC_DEFINE_UNQUOTED([WANT_PMI_SUPPORT],
|
||||
[$orte_enable_pmi],
|
||||
[$opal_enable_pmi],
|
||||
[Whether we want PMI support])
|
||||
AC_DEFINE_UNQUOTED([WANT_CRAY_PMI2_EXT],
|
||||
[$orte_use_pmi2_ext],
|
||||
[$opal_use_pmi2_ext],
|
||||
[Whether we want to use Cray PMI2 extensions])
|
||||
AM_CONDITIONAL(WANT_PMI_SUPPORT, [test "$orte_enable_pmi" = 1])
|
||||
AM_CONDITIONAL(WANT_PMI_SUPPORT, [test "$opal_enable_pmi" = 1])
|
||||
])
|
@ -24,7 +24,7 @@ AC_DEFUN([ORTE_CHECK_ALPS],[
|
||||
if test -z "$orte_check_alps_happy"; then
|
||||
# require that we check for pmi support request first so
|
||||
# we can get the static library ordering correct
|
||||
AC_REQUIRE([ORTE_CHECK_PMI])
|
||||
AC_REQUIRE([OPAL_CHECK_PMI])
|
||||
|
||||
AC_ARG_WITH([alps],
|
||||
[AC_HELP_STRING([--with-alps(=DIR|yes|no)],
|
||||
|
@ -12,7 +12,7 @@
|
||||
AC_DEFUN([MCA_ompi_pubsub_pmi_CONFIG], [
|
||||
AC_CONFIG_FILES([ompi/mca/pubsub/pmi/Makefile])
|
||||
|
||||
ORTE_CHECK_PMI([pubsub_pmi], [pubsub_pmi_good=1], [pubsub_pmi_good=0])
|
||||
OPAL_CHECK_PMI([pubsub_pmi], [pubsub_pmi_good=1], [pubsub_pmi_good=0])
|
||||
|
||||
# Evaluate succeed / fail
|
||||
AS_IF([test "$pubsub_pmi_good" = 1],
|
||||
|
@ -22,7 +22,6 @@
|
||||
#include "ompi/info/info.h"
|
||||
|
||||
#include "orte/types.h"
|
||||
#include "orte/mca/db/db.h"
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
#include "orte/mca/grpcomm/grpcomm.h"
|
||||
#include "orte/mca/rml/base/rml_contact.h"
|
||||
@ -79,11 +78,19 @@ OMPI_DECLSPEC void ompi_rte_abort(int error_code, char *fmt, ...);
|
||||
OMPI_DECLSPEC void ompi_rte_wait_for_debugger(void);
|
||||
|
||||
/* Database operations */
|
||||
#define ompi_rte_db_store(a, b, c, d) orte_db.store(a, b, c, d)
|
||||
#define ompi_rte_db_fetch(a, b, c, d) orte_db.fetch(a, b, c, d)
|
||||
#define ompi_rte_db_fetch_pointer(a, b, c, d) orte_db.fetch_pointer(a, b, c, d)
|
||||
#define ompi_rte_db_fetch_multiple(a, b, c) orte_db.fetch_multiple(a, b, c)
|
||||
#define ompi_rte_db_remove(a, b) orte_db.remove(a, b)
|
||||
OMPI_DECLSPEC int ompi_rte_db_store(const ompi_process_name_t *nm, const char* key,
|
||||
const void *data, opal_data_type_t type);
|
||||
OMPI_DECLSPEC int ompi_rte_db_fetch(const ompi_process_name_t *nm,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type);
|
||||
OMPI_DECLSPEC int ompi_rte_db_fetch_pointer(const ompi_process_name_t *nm,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type);
|
||||
OMPI_DECLSPEC int ompi_rte_db_fetch_multiple(const ompi_process_name_t *nm,
|
||||
const char *key,
|
||||
opal_list_t *kvs);
|
||||
OMPI_DECLSPEC int ompi_rte_db_remove(const ompi_process_name_t *nm,
|
||||
const char *key);
|
||||
#define OMPI_DB_HOSTNAME ORTE_DB_HOSTNAME
|
||||
#define OMPI_DB_LOCALITY ORTE_DB_LOCALITY
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Los Alamos National Security, LLC.
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
*/
|
||||
#include "ompi_config.h"
|
||||
@ -12,6 +12,7 @@
|
||||
#include "opal/dss/dss.h"
|
||||
#include "opal/util/argv.h"
|
||||
#include "opal/util/opal_getcwd.h"
|
||||
#include "opal/mca/db/db.h"
|
||||
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
#include "orte/mca/ess/ess.h"
|
||||
@ -139,3 +140,52 @@ void ompi_rte_wait_for_debugger(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ompi_rte_db_store(const orte_process_name_t *nm, const char* key,
|
||||
const void *data, opal_data_type_t type)
|
||||
{
|
||||
opal_identifier_t *id;
|
||||
|
||||
id = (opal_identifier_t*)nm;
|
||||
return opal_db.store((*id), OPAL_DB_GLOBAL, key, data, type);
|
||||
}
|
||||
|
||||
int ompi_rte_db_fetch(const orte_process_name_t *nm,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type)
|
||||
{
|
||||
opal_identifier_t *id;
|
||||
|
||||
id = (opal_identifier_t*)nm;
|
||||
return opal_db.fetch((*id), key, data, type);
|
||||
}
|
||||
|
||||
int ompi_rte_db_fetch_pointer(const orte_process_name_t *nm,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type)
|
||||
{
|
||||
opal_identifier_t *id;
|
||||
|
||||
id = (opal_identifier_t*)nm;
|
||||
return opal_db.fetch_pointer((*id), key, data, type);
|
||||
}
|
||||
|
||||
int ompi_rte_db_fetch_multiple(const orte_process_name_t *nm,
|
||||
const char *key,
|
||||
opal_list_t *kvs)
|
||||
{
|
||||
opal_identifier_t *id;
|
||||
|
||||
id = (opal_identifier_t*)nm;
|
||||
return opal_db.fetch_multiple((*id), key, kvs);
|
||||
}
|
||||
|
||||
int ompi_rte_db_remove(const orte_process_name_t *nm,
|
||||
const char *key)
|
||||
{
|
||||
opal_identifier_t *id;
|
||||
|
||||
id = (opal_identifier_t*)nm;
|
||||
return opal_db.remove((*id), key);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ AC_DEFUN([MCA_ompi_rte_pmi_POST_CONFIG],[
|
||||
AC_DEFUN([MCA_ompi_rte_pmi_CONFIG], [
|
||||
AC_CONFIG_FILES([ompi/mca/rte/pmi/Makefile])
|
||||
|
||||
ORTE_CHECK_PMI([rte_pmi], [rte_pmi_good=1], [rte_pmi_good=0])
|
||||
OPAL_CHECK_PMI([rte_pmi], [rte_pmi_good=1], [rte_pmi_good=0])
|
||||
|
||||
# Evaluate succeed / fail
|
||||
AS_IF([test "$rte_pmi_good" = 1],
|
||||
|
@ -71,7 +71,10 @@ enum {
|
||||
OPAL_ERR_NETWORK_NOT_PARSEABLE = (OPAL_ERR_BASE - 42),
|
||||
OPAL_ERR_SILENT = (OPAL_ERR_BASE - 43),
|
||||
OPAL_ERR_NOT_INITIALIZED = (OPAL_ERR_BASE - 44),
|
||||
OPAL_ERR_NOT_BOUND = (OPAL_ERR_BASE - 45)
|
||||
OPAL_ERR_NOT_BOUND = (OPAL_ERR_BASE - 45),
|
||||
OPAL_ERR_TAKE_NEXT_OPTION = (OPAL_ERR_BASE - 46),
|
||||
OPAL_ERR_PROC_ENTRY_NOT_FOUND = (OPAL_ERR_BASE - 47),
|
||||
OPAL_ERR_DATA_VALUE_NOT_FOUND = (OPAL_ERR_BASE - 48)
|
||||
};
|
||||
|
||||
#define OPAL_ERR_MAX (OPAL_ERR_BASE - 100)
|
||||
|
@ -1,6 +1,8 @@
|
||||
#
|
||||
# Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2012 Sandia National Laboratories. All rights reserved.
|
||||
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights
|
||||
# reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
@ -24,7 +26,7 @@ AM_CPPFLAGS = $(common_pmi_CPPFLAGS)
|
||||
|
||||
# control whether building an installed library or a convenience
|
||||
# (noinst) library
|
||||
if MCA_BUILD_orte_common_pmi_DSO
|
||||
if MCA_BUILD_opal_common_pmi_DSO
|
||||
component_noinst =
|
||||
component_install = libmca_common_pmi.la
|
||||
else
|
@ -12,9 +12,9 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/constants.h"
|
||||
#include "orte/types.h"
|
||||
#include "opal_config.h"
|
||||
#include "opal/constants.h"
|
||||
#include "opal/types.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <pmi.h>
|
||||
@ -79,7 +79,7 @@ void mca_common_pmi_finalize (void) {
|
||||
}
|
||||
|
||||
/* useful util */
|
||||
char* orte_errmgr_base_pmi_error(int pmi_err)
|
||||
char* opal_errmgr_base_pmi_error(int pmi_err)
|
||||
{
|
||||
char * err_msg;
|
||||
|
@ -12,8 +12,8 @@
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#if !defined(ORTE_MCA_COMMON_PMI)
|
||||
#define ORTE_MCA_COMMON_PMI
|
||||
#if !defined(OPAL_MCA_COMMON_PMI)
|
||||
#define OPAL_MCA_COMMON_PMI
|
||||
|
||||
/**
|
||||
* mca_common_pmi_init:
|
||||
@ -33,13 +33,12 @@ bool mca_common_pmi_init (void);
|
||||
*/
|
||||
void mca_common_pmi_finalize (void);
|
||||
|
||||
#define ORTE_PMI_ERROR(pmi_err, pmi_func) \
|
||||
#define OPAL_PMI_ERROR(pmi_err, pmi_func) \
|
||||
do { \
|
||||
opal_output(0, "%s[%s:%d:%s] %s: %s\n", \
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME), \
|
||||
opal_output(0, "[%s:%d:%s] %s: %s\n", \
|
||||
__FILE__, __LINE__, __func__, \
|
||||
pmi_func, orte_errmgr_base_pmi_error(pmi_err)); \
|
||||
pmi_func, opal_errmgr_base_pmi_error(pmi_err)); \
|
||||
} while(0);
|
||||
OPAL_DECLSPEC char* orte_errmgr_base_pmi_error(int pmi_err);
|
||||
OPAL_DECLSPEC char* opal_errmgr_base_pmi_error(int pmi_err);
|
||||
|
||||
#endif
|
@ -1,7 +1,7 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2011 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2011-2012 Los Alamos National Security, LLC.
|
||||
# Copyright (c) 2011-2013 Los Alamos National Security, LLC.
|
||||
# All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
@ -12,13 +12,13 @@
|
||||
|
||||
# MCA_common_pmi_CONFIG([action-if-found], [action-if-not-found])
|
||||
# -----------------------------------------------------------
|
||||
AC_DEFUN([MCA_orte_common_pmi_CONFIG], [
|
||||
AC_CONFIG_FILES([orte/mca/common/pmi/Makefile])
|
||||
AC_DEFUN([MCA_opal_common_pmi_CONFIG], [
|
||||
AC_CONFIG_FILES([opal/mca/common/pmi/Makefile])
|
||||
|
||||
ORTE_CHECK_PMI([common_pmi], [common_pmi_good=1], [common_pmi_good=0])
|
||||
OPAL_CHECK_PMI([common_pmi], [common_pmi_good=1], [common_pmi_good=0])
|
||||
|
||||
# Evaluate succeed / fail
|
||||
AS_IF([test "$common_pmi_good" = 1 -a "$orte_without_full_support" = 0],
|
||||
AS_IF([test "$common_pmi_good" = 1],
|
||||
[$1],
|
||||
[$2])
|
||||
|
@ -22,8 +22,8 @@ libmca_db_la_SOURCES += $(headers)
|
||||
|
||||
# Conditionally install the header files
|
||||
if WANT_INSTALL_HEADERS
|
||||
ortedir = $(includedir)/openmpi/$(subdir)
|
||||
nobase_orte_HEADERS = $(headers)
|
||||
opaldir = $(includedir)/openmpi/$(subdir)
|
||||
nobase_opal_HEADERS = $(headers)
|
||||
endif
|
||||
|
||||
include base/Makefile.am
|
@ -1,6 +1,6 @@
|
||||
#
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
# Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -13,65 +13,69 @@
|
||||
#ifndef MCA_DB_BASE_H
|
||||
#define MCA_DB_BASE_H
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/types.h"
|
||||
#include "opal_config.h"
|
||||
#include "opal/types.h"
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "opal/dss/dss.h"
|
||||
|
||||
#include "orte/mca/db/db.h"
|
||||
#include "opal/mca/db/db.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/**
|
||||
* Open the db framework
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_db_base_open(void);
|
||||
OPAL_DECLSPEC int opal_db_base_open(void);
|
||||
|
||||
/**
|
||||
* Select a db module
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_db_base_select(void);
|
||||
OPAL_DECLSPEC int opal_db_base_select(void);
|
||||
|
||||
/**
|
||||
* Close the db framework
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_db_base_close(void);
|
||||
OPAL_DECLSPEC int opal_db_base_close(void);
|
||||
|
||||
typedef struct {
|
||||
opal_list_item_t super;
|
||||
int pri;
|
||||
orte_db_base_module_t *module;
|
||||
mca_base_component_t *component;
|
||||
} orte_db_active_module_t;
|
||||
OBJ_CLASS_DECLARATION(orte_db_active_module_t);
|
||||
opal_db_base_module_t *module;
|
||||
opal_db_base_component_t *component;
|
||||
} opal_db_active_module_t;
|
||||
OBJ_CLASS_DECLARATION(opal_db_active_module_t);
|
||||
|
||||
typedef struct {
|
||||
int output;
|
||||
opal_list_t available_components;
|
||||
opal_list_t active_modules;
|
||||
} orte_db_base_t;
|
||||
ORTE_DECLSPEC extern orte_db_base_t orte_db_base;
|
||||
opal_list_t store_order;
|
||||
opal_list_t fetch_order;
|
||||
} opal_db_base_t;
|
||||
|
||||
ORTE_DECLSPEC int orte_db_base_store(const orte_process_name_t *proc,
|
||||
OPAL_DECLSPEC extern opal_db_base_t opal_db_base;
|
||||
|
||||
OPAL_DECLSPEC int opal_db_base_store(opal_identifier_t proc,
|
||||
opal_db_locality_t locality,
|
||||
const char *key, const void *object,
|
||||
opal_data_type_t type);
|
||||
ORTE_DECLSPEC int orte_db_base_store_pointer(const orte_process_name_t *proc,
|
||||
OPAL_DECLSPEC int opal_db_base_store_pointer(opal_identifier_t proc,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv);
|
||||
ORTE_DECLSPEC int orte_db_base_fetch(const orte_process_name_t *proc,
|
||||
OPAL_DECLSPEC int opal_db_base_fetch(opal_identifier_t proc,
|
||||
const char *key, void **data,
|
||||
opal_data_type_t type);
|
||||
ORTE_DECLSPEC int orte_db_base_fetch_pointer(const orte_process_name_t *proc,
|
||||
OPAL_DECLSPEC int opal_db_base_fetch_pointer(opal_identifier_t proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type);
|
||||
ORTE_DECLSPEC int orte_db_base_fetch_multiple(const orte_process_name_t *proc,
|
||||
OPAL_DECLSPEC int opal_db_base_fetch_multiple(opal_identifier_t proc,
|
||||
const char *key,
|
||||
opal_list_t *kvs);
|
||||
ORTE_DECLSPEC int orte_db_base_remove_data(const orte_process_name_t *proc,
|
||||
OPAL_DECLSPEC int opal_db_base_remove_data(opal_identifier_t proc,
|
||||
const char *key);
|
||||
|
||||
ORTE_DECLSPEC int orte_db_base_add_log(const char *table,
|
||||
OPAL_DECLSPEC int opal_db_base_add_log(const char *table,
|
||||
const opal_value_t *kvs, int nkvs);
|
||||
|
||||
|
43
opal/mca/db/base/db_base_close.c
Normal file
43
opal/mca/db/base/db_base_close.c
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "opal_config.h"
|
||||
#include "opal/constants.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_component_repository.h"
|
||||
|
||||
#include "opal/mca/db/base/base.h"
|
||||
|
||||
extern opal_list_t opal_db_base_components_available;
|
||||
|
||||
int
|
||||
opal_db_base_close(void)
|
||||
{
|
||||
if (NULL != opal_db.finalize) {
|
||||
opal_db.finalize();
|
||||
}
|
||||
|
||||
mca_base_components_close(opal_db_base.output,
|
||||
&opal_db_base.available_components, NULL);
|
||||
|
||||
OBJ_DESTRUCT(&opal_db_base.available_components);
|
||||
|
||||
/* Close the framework output */
|
||||
opal_output_close (opal_db_base.output);
|
||||
opal_db_base.output = -1;
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -8,277 +8,250 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/constants.h"
|
||||
#include "opal_config.h"
|
||||
#include "opal/constants.h"
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/util/error.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/dss/dss_types.h"
|
||||
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
|
||||
#include "orte/mca/db/base/base.h"
|
||||
#include "opal/mca/db/base/base.h"
|
||||
|
||||
|
||||
int orte_db_base_store(const orte_process_name_t *proc,
|
||||
int opal_db_base_store(opal_identifier_t proc,
|
||||
opal_db_locality_t locality,
|
||||
const char *key, const void *object,
|
||||
opal_data_type_t type)
|
||||
{
|
||||
bool did_op;
|
||||
opal_list_item_t *item;
|
||||
orte_db_active_module_t *mod;
|
||||
opal_db_active_module_t *mod;
|
||||
int rc;
|
||||
|
||||
/* cycle thru the actiove modules until one agrees to perform the op */
|
||||
did_op = false;
|
||||
for (item = opal_list_get_first(&orte_db_base.active_modules);
|
||||
item != opal_list_get_end(&orte_db_base.active_modules);
|
||||
item = opal_list_get_next(item)) {
|
||||
mod = (orte_db_active_module_t*)item;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.store_order, opal_db_active_module_t) {
|
||||
if (NULL == mod->module->store) {
|
||||
continue;
|
||||
}
|
||||
if (ORTE_SUCCESS == (rc = mod->module->store(proc, key, object, type))) {
|
||||
if (OPAL_SUCCESS == (rc = mod->module->store(proc, locality, key, object, type))) {
|
||||
did_op = true;
|
||||
break;
|
||||
}
|
||||
/* modules return "next option" if they didn't perform
|
||||
* the operation - anything else is a true error.
|
||||
*/
|
||||
if (ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
if (OPAL_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
OPAL_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we get here without performing the operation, that's an error */
|
||||
if (!did_op) {
|
||||
ORTE_ERROR_LOG(ORTE_ERROR);
|
||||
return ORTE_ERROR;
|
||||
OPAL_ERROR_LOG(OPAL_ERROR);
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int orte_db_base_store_pointer(const orte_process_name_t *proc,
|
||||
int opal_db_base_store_pointer(opal_identifier_t proc,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv)
|
||||
{
|
||||
bool did_op;
|
||||
opal_list_item_t *item;
|
||||
orte_db_active_module_t *mod;
|
||||
opal_db_active_module_t *mod;
|
||||
int rc;
|
||||
|
||||
/* cycle thru the actiove modules until one agrees to perform the op */
|
||||
did_op = false;
|
||||
for (item = opal_list_get_first(&orte_db_base.active_modules);
|
||||
item != opal_list_get_end(&orte_db_base.active_modules);
|
||||
item = opal_list_get_next(item)) {
|
||||
mod = (orte_db_active_module_t*)item;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.store_order, opal_db_active_module_t) {
|
||||
if (NULL == mod->module->store_pointer) {
|
||||
continue;
|
||||
}
|
||||
if (ORTE_SUCCESS == (rc = mod->module->store_pointer(proc, kv))) {
|
||||
if (OPAL_SUCCESS == (rc = mod->module->store_pointer(proc, locality, kv))) {
|
||||
did_op = true;
|
||||
break;
|
||||
}
|
||||
/* modules return "next option" if they didn't perform
|
||||
* the operation - anything else is a true error.
|
||||
*/
|
||||
if (ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
if (OPAL_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
OPAL_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we get here without performing the operation, that's an error */
|
||||
if (!did_op) {
|
||||
ORTE_ERROR_LOG(ORTE_ERROR);
|
||||
return ORTE_ERROR;
|
||||
OPAL_ERROR_LOG(OPAL_ERROR);
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int orte_db_base_fetch(const orte_process_name_t *proc,
|
||||
int opal_db_base_fetch(opal_identifier_t proc,
|
||||
const char *key, void **data,
|
||||
opal_data_type_t type)
|
||||
{
|
||||
bool did_op;
|
||||
opal_list_item_t *item;
|
||||
orte_db_active_module_t *mod;
|
||||
opal_db_active_module_t *mod;
|
||||
int rc;
|
||||
|
||||
/* cycle thru the actiove modules until one agrees to perform the op */
|
||||
did_op = false;
|
||||
for (item = opal_list_get_first(&orte_db_base.active_modules);
|
||||
item != opal_list_get_end(&orte_db_base.active_modules);
|
||||
item = opal_list_get_next(item)) {
|
||||
mod = (orte_db_active_module_t*)item;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.fetch_order, opal_db_active_module_t) {
|
||||
if (NULL == mod->module->fetch) {
|
||||
continue;
|
||||
}
|
||||
if (ORTE_SUCCESS == (rc = mod->module->fetch(proc, key, data, type))) {
|
||||
if (OPAL_SUCCESS == (rc = mod->module->fetch(proc, key, data, type))) {
|
||||
did_op = true;
|
||||
break;
|
||||
}
|
||||
/* modules return "next option" if they didn't perform
|
||||
* the operation - anything else is a true error.
|
||||
*/
|
||||
if (ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
if (OPAL_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
OPAL_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we get here without performing the operation, that's an error */
|
||||
if (!did_op) {
|
||||
ORTE_ERROR_LOG(ORTE_ERROR);
|
||||
return ORTE_ERROR;
|
||||
OPAL_ERROR_LOG(OPAL_ERR_DATA_VALUE_NOT_FOUND);
|
||||
return OPAL_ERR_DATA_VALUE_NOT_FOUND;
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int orte_db_base_fetch_pointer(const orte_process_name_t *proc,
|
||||
int opal_db_base_fetch_pointer(opal_identifier_t proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type)
|
||||
{
|
||||
bool did_op;
|
||||
opal_list_item_t *item;
|
||||
orte_db_active_module_t *mod;
|
||||
opal_db_active_module_t *mod;
|
||||
int rc;
|
||||
|
||||
/* cycle thru the actiove modules until one agrees to perform the op */
|
||||
did_op = false;
|
||||
for (item = opal_list_get_first(&orte_db_base.active_modules);
|
||||
item != opal_list_get_end(&orte_db_base.active_modules);
|
||||
item = opal_list_get_next(item)) {
|
||||
mod = (orte_db_active_module_t*)item;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.fetch_order, opal_db_active_module_t) {
|
||||
if (NULL == mod->module->fetch_pointer) {
|
||||
continue;
|
||||
}
|
||||
if (ORTE_SUCCESS == (rc = mod->module->fetch_pointer(proc, key, data, type))) {
|
||||
if (OPAL_SUCCESS == (rc = mod->module->fetch_pointer(proc, key, data, type))) {
|
||||
did_op = true;
|
||||
break;
|
||||
}
|
||||
/* modules return "next option" if they didn't perform
|
||||
* the operation - anything else is a true error.
|
||||
*/
|
||||
if (ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
if (OPAL_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
OPAL_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we get here without performing the operation, that's an error */
|
||||
if (!did_op) {
|
||||
ORTE_ERROR_LOG(ORTE_ERROR);
|
||||
return ORTE_ERROR;
|
||||
OPAL_ERROR_LOG(OPAL_ERR_DATA_VALUE_NOT_FOUND);
|
||||
return OPAL_ERR_DATA_VALUE_NOT_FOUND;
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int orte_db_base_fetch_multiple(const orte_process_name_t *proc,
|
||||
int opal_db_base_fetch_multiple(opal_identifier_t proc,
|
||||
const char *key,
|
||||
opal_list_t *kvs)
|
||||
{
|
||||
bool did_op;
|
||||
opal_list_item_t *item;
|
||||
orte_db_active_module_t *mod;
|
||||
opal_db_active_module_t *mod;
|
||||
int rc;
|
||||
|
||||
/* cycle thru the actiove modules until one agrees to perform the op */
|
||||
did_op = false;
|
||||
for (item = opal_list_get_first(&orte_db_base.active_modules);
|
||||
item != opal_list_get_end(&orte_db_base.active_modules);
|
||||
item = opal_list_get_next(item)) {
|
||||
mod = (orte_db_active_module_t*)item;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.fetch_order, opal_db_active_module_t) {
|
||||
if (NULL == mod->module->fetch_multiple) {
|
||||
continue;
|
||||
}
|
||||
if (ORTE_SUCCESS == (rc = mod->module->fetch_multiple(proc, key, kvs))) {
|
||||
if (OPAL_SUCCESS == (rc = mod->module->fetch_multiple(proc, key, kvs))) {
|
||||
did_op = true;
|
||||
break;
|
||||
}
|
||||
/* modules return "next option" if they didn't perform
|
||||
* the operation - anything else is a true error.
|
||||
*/
|
||||
if (ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
if (OPAL_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
OPAL_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we get here without performing the operation, that's an error */
|
||||
if (!did_op) {
|
||||
ORTE_ERROR_LOG(ORTE_ERROR);
|
||||
return ORTE_ERROR;
|
||||
OPAL_ERROR_LOG(OPAL_ERR_DATA_VALUE_NOT_FOUND);
|
||||
return OPAL_ERR_DATA_VALUE_NOT_FOUND;
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
int orte_db_base_remove_data(const orte_process_name_t *proc,
|
||||
int opal_db_base_remove_data(opal_identifier_t proc,
|
||||
const char *key)
|
||||
{
|
||||
bool did_op;
|
||||
opal_list_item_t *item;
|
||||
orte_db_active_module_t *mod;
|
||||
opal_db_active_module_t *mod;
|
||||
int rc;
|
||||
|
||||
/* cycle thru the actiove modules until one agrees to perform the op */
|
||||
did_op = false;
|
||||
for (item = opal_list_get_first(&orte_db_base.active_modules);
|
||||
item != opal_list_get_end(&orte_db_base.active_modules);
|
||||
item = opal_list_get_next(item)) {
|
||||
mod = (orte_db_active_module_t*)item;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.store_order, opal_db_active_module_t) {
|
||||
if (NULL == mod->module->remove) {
|
||||
continue;
|
||||
}
|
||||
if (ORTE_SUCCESS == (rc = mod->module->remove(proc, key))) {
|
||||
if (OPAL_SUCCESS == (rc = mod->module->remove(proc, key))) {
|
||||
did_op = true;
|
||||
break;
|
||||
}
|
||||
/* modules return "next option" if they didn't perform
|
||||
* the operation - anything else is a true error.
|
||||
*/
|
||||
if (ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
if (OPAL_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
OPAL_ERROR_LOG(rc);
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
||||
/* if we get here without performing the operation, that's an error */
|
||||
if (!did_op) {
|
||||
ORTE_ERROR_LOG(ORTE_ERROR);
|
||||
return ORTE_ERROR;
|
||||
OPAL_ERROR_LOG(OPAL_ERROR);
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int orte_db_base_add_log(const char *table,
|
||||
int opal_db_base_add_log(const char *table,
|
||||
const opal_value_t *kvs, int nkvs)
|
||||
{
|
||||
bool did_op;
|
||||
opal_list_item_t *item;
|
||||
orte_db_active_module_t *mod;
|
||||
opal_db_active_module_t *mod;
|
||||
int rc;
|
||||
|
||||
/* cycle thru the active modules until one agrees to perform the op */
|
||||
did_op = false;
|
||||
for (item = opal_list_get_first(&orte_db_base.active_modules);
|
||||
item != opal_list_get_end(&orte_db_base.active_modules);
|
||||
item = opal_list_get_next(item)) {
|
||||
mod = (orte_db_active_module_t*)item;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.store_order, opal_db_active_module_t) {
|
||||
if (NULL == mod->module->add_log) {
|
||||
continue;
|
||||
}
|
||||
if (ORTE_SUCCESS == (rc = mod->module->add_log(table, kvs, nkvs))) {
|
||||
if (OPAL_SUCCESS == (rc = mod->module->add_log(table, kvs, nkvs))) {
|
||||
did_op = true;
|
||||
break;
|
||||
}
|
||||
/* modules return "next option" if they didn't perform
|
||||
* the operation - anything else is a true error.
|
||||
*/
|
||||
if (ORTE_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
if (OPAL_ERR_TAKE_NEXT_OPTION != rc) {
|
||||
/* don't error log it here */
|
||||
return rc;
|
||||
}
|
||||
@ -287,7 +260,7 @@ int orte_db_base_add_log(const char *table,
|
||||
/* if we get here without performing the operation, let the caller know */
|
||||
if (!did_op) {
|
||||
/* don't error log it here */
|
||||
return ORTE_ERROR;
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
return OPAL_SUCCESS;
|
||||
}
|
65
opal/mca/db/base/db_base_open.c
Normal file
65
opal/mca/db/base/db_base_open.c
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
|
||||
#include "opal_config.h"
|
||||
#include "opal/constants.h"
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/dss/dss_types.h"
|
||||
|
||||
#include "opal/mca/db/base/base.h"
|
||||
|
||||
|
||||
/*
|
||||
* The following file was created by configure. It contains extern
|
||||
* dbments and the definition of an array of pointers to each
|
||||
* module's public mca_base_module_t struct.
|
||||
*/
|
||||
|
||||
#include "opal/mca/db/base/static-components.h"
|
||||
|
||||
opal_db_base_module_t opal_db = {
|
||||
NULL,
|
||||
NULL,
|
||||
opal_db_base_store,
|
||||
opal_db_base_store_pointer,
|
||||
opal_db_base_fetch,
|
||||
opal_db_base_fetch_pointer,
|
||||
opal_db_base_fetch_multiple,
|
||||
opal_db_base_remove_data,
|
||||
opal_db_base_add_log
|
||||
};
|
||||
opal_db_base_t opal_db_base;
|
||||
|
||||
int opal_db_base_open(void)
|
||||
{
|
||||
opal_db_base.output = opal_output_open(NULL);
|
||||
|
||||
OBJ_CONSTRUCT(&opal_db_base.available_components, opal_list_t);
|
||||
OBJ_CONSTRUCT(&opal_db_base.fetch_order, opal_list_t);
|
||||
OBJ_CONSTRUCT(&opal_db_base.store_order, opal_list_t);
|
||||
|
||||
/* Open up all available components */
|
||||
if (OPAL_SUCCESS !=
|
||||
mca_base_components_open("db", opal_db_base.output, mca_db_base_static_components,
|
||||
&opal_db_base.available_components,
|
||||
true)) {
|
||||
return OPAL_ERROR;
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
|
||||
OBJ_CLASS_INSTANCE(opal_db_active_module_t,
|
||||
opal_list_item_t,
|
||||
NULL, NULL);
|
134
opal/mca/db/base/db_base_select.c
Normal file
134
opal/mca/db/base/db_base_select.c
Normal file
@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "opal_config.h"
|
||||
#include "opal/constants.h"
|
||||
|
||||
#include "opal/class/opal_list.h"
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_component_repository.h"
|
||||
|
||||
#include "opal/mca/db/base/base.h"
|
||||
|
||||
static bool selected = false;
|
||||
|
||||
int
|
||||
opal_db_base_select(void)
|
||||
{
|
||||
mca_base_component_list_item_t *cli = NULL;
|
||||
opal_db_base_component_t *component = NULL;
|
||||
opal_db_base_module_t *module = NULL;
|
||||
opal_db_active_module_t *nmodule, *mod;
|
||||
int rc, fetch, store;
|
||||
bool inserted;
|
||||
|
||||
if (selected) {
|
||||
/* ensure we don't do this twice */
|
||||
return OPAL_SUCCESS;
|
||||
}
|
||||
selected = true;
|
||||
|
||||
/* Query all available components and ask if they have a module */
|
||||
OPAL_LIST_FOREACH(cli, &opal_db_base.available_components, mca_base_component_list_item_t) {
|
||||
component = (opal_db_base_component_t *) cli->cli_component;
|
||||
|
||||
opal_output_verbose(5, opal_db_base.output,
|
||||
"mca:db:select: checking available component %s",
|
||||
component->base_version.mca_component_name);
|
||||
|
||||
/* If there's no query function, skip it */
|
||||
if (NULL == component->query) {
|
||||
opal_output_verbose(5, opal_db_base.output,
|
||||
"mca:db:select: Skipping component [%s]. It does not implement a query function",
|
||||
component->base_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Query the component */
|
||||
opal_output_verbose(5, opal_db_base.output,
|
||||
"mca:db:select: Querying component [%s]",
|
||||
component->base_version.mca_component_name);
|
||||
rc = component->query(&module, &store, &fetch);
|
||||
|
||||
/* If no module was returned, then skip component */
|
||||
if (OPAL_SUCCESS != rc || NULL == module) {
|
||||
opal_output_verbose(5, opal_db_base.output,
|
||||
"mca:db:select: Skipping component [%s]. Query failed to return a module",
|
||||
component->base_version.mca_component_name );
|
||||
continue;
|
||||
}
|
||||
|
||||
/* attempt to initialize the module */
|
||||
if (NULL != module->init) {
|
||||
if (OPAL_SUCCESS != (rc = module->init())) {
|
||||
/* skip the module */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we got a module, add to the store list */
|
||||
nmodule = OBJ_NEW(opal_db_active_module_t);
|
||||
nmodule->pri = store;
|
||||
nmodule->module = module;
|
||||
nmodule->component = component;
|
||||
|
||||
/* maintain priority order */
|
||||
inserted = false;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.store_order, opal_db_active_module_t) {
|
||||
if (store > mod->pri) {
|
||||
opal_list_insert_pos(&opal_db_base.store_order,
|
||||
&mod->super, &nmodule->super);
|
||||
inserted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!inserted) {
|
||||
/* must be lowest priority - add to end */
|
||||
opal_list_append(&opal_db_base.store_order, &nmodule->super);
|
||||
}
|
||||
|
||||
/* do the same for fetch list */
|
||||
nmodule = OBJ_NEW(opal_db_active_module_t);
|
||||
nmodule->pri = fetch;
|
||||
nmodule->module = module;
|
||||
nmodule->component = component;
|
||||
|
||||
/* maintain priority order */
|
||||
inserted = false;
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.fetch_order, opal_db_active_module_t) {
|
||||
if (fetch > mod->pri) {
|
||||
opal_list_insert_pos(&opal_db_base.fetch_order,
|
||||
&mod->super, &nmodule->super);
|
||||
inserted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!inserted) {
|
||||
/* must be lowest priority - add to end */
|
||||
opal_list_append(&opal_db_base.fetch_order, &nmodule->super);
|
||||
}
|
||||
}
|
||||
|
||||
if (4 < opal_output_get_verbosity(opal_db_base.output)) {
|
||||
opal_output(0, "Final db priorities");
|
||||
/* show the prioritized list */
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.store_order, opal_db_active_module_t) {
|
||||
opal_output(0, "\tComponent: %s Store Priority: %d",
|
||||
mod->component->base_version.mca_component_name, mod->pri);
|
||||
}
|
||||
OPAL_LIST_FOREACH(mod, &opal_db_base.fetch_order, opal_db_active_module_t) {
|
||||
opal_output(0, "\tComponent: %s Fetch Priority: %d",
|
||||
mod->component->base_version.mca_component_name, mod->pri);
|
||||
}
|
||||
}
|
||||
|
||||
return OPAL_SUCCESS;;
|
||||
}
|
@ -8,12 +8,12 @@
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
# This is the US/English general help file for ORTE Errmgr HNP module.
|
||||
# This is the US/English general help file for OPAL Errmgr HNP module.
|
||||
#
|
||||
[errmgr-hnp:unknown-job-error]
|
||||
An error has occurred in an unknown job. This generally should not happen
|
||||
except due to an internal ORTE error.
|
||||
except due to an internal OPAL error.
|
||||
|
||||
Job state: %s
|
||||
|
||||
This information should probably be reported to the OMPI developers.
|
||||
This information should probably be repopald to the OMPI developers.
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2012 Los Alamos National Security, Inc. All rights reserved.
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
@ -9,25 +9,25 @@
|
||||
*/
|
||||
/** @file:
|
||||
*
|
||||
* The OpenRTE Database Framework
|
||||
* The Database Framework
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ORTE_DB_H
|
||||
#define ORTE_DB_H
|
||||
#ifndef OPAL_DB_H
|
||||
#define OPAL_DB_H
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/types.h"
|
||||
#include "opal_config.h"
|
||||
#include "opal/types.h"
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/dss/dss_types.h"
|
||||
|
||||
#include "orte/mca/db/db_types.h"
|
||||
#include "opal/mca/db/db_types.h"
|
||||
|
||||
/**
|
||||
* DATABASE DESIGN
|
||||
*
|
||||
* Data is always associated with a given orte process name. Individual
|
||||
* Data is always associated with a given opal identifier. Individual
|
||||
* modules may store the data local to the calling process, or on one
|
||||
* or more remote sites. Time lags between when data is written and
|
||||
* when it is available at a remote proc will therefore exist.
|
||||
@ -35,30 +35,48 @@
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/* define a flag to indicate the scope of data being
|
||||
* stored in the database. Three options are supported:
|
||||
*
|
||||
* GLOBAL: data is to be published such that any proc
|
||||
* in the job can access it
|
||||
* LOCAL: data is to be published such that any proc
|
||||
* on the same node can access it
|
||||
* INTERNAL: data is to be stored in this app only
|
||||
*/
|
||||
typedef enum {
|
||||
OPAL_DB_GLOBAL,
|
||||
OPAL_DB_LOCAL,
|
||||
OPAL_DB_INTERNAL
|
||||
} opal_db_locality_t;
|
||||
|
||||
/*
|
||||
* Initialize the module
|
||||
*/
|
||||
typedef int (*orte_db_base_module_init_fn_t)(void);
|
||||
typedef int (*opal_db_base_module_init_fn_t)(void);
|
||||
|
||||
/*
|
||||
* Finalize the module
|
||||
*/
|
||||
typedef void (*orte_db_base_module_finalize_fn_t)(void);
|
||||
typedef void (*opal_db_base_module_finalize_fn_t)(void);
|
||||
|
||||
/*
|
||||
* Store a copy of data in the database - overwrites if already present. The data is
|
||||
* copied into the database and therefore does not need to be preserved by
|
||||
* the caller.
|
||||
*/
|
||||
typedef int (*orte_db_base_module_store_fn_t)(const orte_process_name_t *proc,
|
||||
const char *key, const void *data, opal_data_type_t type);
|
||||
typedef int (*opal_db_base_module_store_fn_t)(opal_identifier_t proc,
|
||||
opal_db_locality_t locality,
|
||||
const char *key, const void *data,
|
||||
opal_data_type_t type);
|
||||
|
||||
/*
|
||||
* Store a pointer to data in the database - data must be retained by the user.
|
||||
* This allows users to share data across the code base without consuming
|
||||
* additional memory, but while retaining local access
|
||||
*/
|
||||
typedef int (*orte_db_base_module_store_pointer_fn_t)(const orte_process_name_t *proc,
|
||||
typedef int (*opal_db_base_module_store_pointer_fn_t)(opal_identifier_t proc,
|
||||
opal_db_locality_t locality,
|
||||
opal_value_t *kv);
|
||||
|
||||
/*
|
||||
@ -68,7 +86,7 @@ typedef int (*orte_db_base_module_store_pointer_fn_t)(const orte_process_name_t
|
||||
* are supported here as well. Caller is responsible for releasing any returned
|
||||
* object.
|
||||
*/
|
||||
typedef int (*orte_db_base_module_fetch_fn_t)(const orte_process_name_t *proc,
|
||||
typedef int (*opal_db_base_module_fetch_fn_t)(opal_identifier_t proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type);
|
||||
|
||||
@ -80,7 +98,7 @@ typedef int (*orte_db_base_module_fetch_fn_t)(const orte_process_name_t *proc,
|
||||
* will directly alter information in the database! A local copy of the data should be made
|
||||
* wherever modification is possible.
|
||||
*/
|
||||
typedef int (*orte_db_base_module_fetch_pointer_fn_t)(const orte_process_name_t *proc,
|
||||
typedef int (*opal_db_base_module_fetch_pointer_fn_t)(opal_identifier_t proc,
|
||||
const char *key,
|
||||
void **data, opal_data_type_t type);
|
||||
/*
|
||||
@ -89,7 +107,7 @@ typedef int (*orte_db_base_module_fetch_pointer_fn_t)(const orte_process_name_t
|
||||
* Retrieve data for the given proc associated with the specified key. Wildcards
|
||||
* are supported here as well. Caller is responsible for releasing the objects on the list.
|
||||
*/
|
||||
typedef int (*orte_db_base_module_fetch_multiple_fn_t)(const orte_process_name_t *proc,
|
||||
typedef int (*opal_db_base_module_fetch_multiple_fn_t)(opal_identifier_t proc,
|
||||
const char *key,
|
||||
opal_list_t *kvs);
|
||||
|
||||
@ -103,51 +121,58 @@ typedef int (*orte_db_base_module_fetch_multiple_fn_t)(const orte_process_name_t
|
||||
* that ALL data in the database is to be purged. A WILDCARD vpid will delete all matching
|
||||
* keys from that jobid. Etc.
|
||||
*/
|
||||
typedef int (*orte_db_base_module_remove_fn_t)(const orte_process_name_t *proc, const char *key);
|
||||
typedef int (*opal_db_base_module_remove_fn_t)(opal_identifier_t proc, const char *key);
|
||||
|
||||
/*
|
||||
* Log data
|
||||
*
|
||||
* Insert statistical, non-process oriented data into a logging system.
|
||||
*/
|
||||
typedef int (*orte_db_base_module_add_log_fn_t)(const char *table, const opal_value_t *kvs, int nkvs);
|
||||
typedef int (*opal_db_base_module_add_log_fn_t)(const char *table, const opal_value_t *kvs, int nkvs);
|
||||
|
||||
/*
|
||||
* the standard module data structure
|
||||
*/
|
||||
struct orte_db_base_module_1_0_0_t {
|
||||
orte_db_base_module_init_fn_t init;
|
||||
orte_db_base_module_finalize_fn_t finalize;
|
||||
orte_db_base_module_store_fn_t store;
|
||||
orte_db_base_module_store_pointer_fn_t store_pointer;
|
||||
orte_db_base_module_fetch_fn_t fetch;
|
||||
orte_db_base_module_fetch_pointer_fn_t fetch_pointer;
|
||||
orte_db_base_module_fetch_multiple_fn_t fetch_multiple;
|
||||
orte_db_base_module_remove_fn_t remove;
|
||||
orte_db_base_module_add_log_fn_t add_log;
|
||||
struct opal_db_base_module_1_0_0_t {
|
||||
opal_db_base_module_init_fn_t init;
|
||||
opal_db_base_module_finalize_fn_t finalize;
|
||||
opal_db_base_module_store_fn_t store;
|
||||
opal_db_base_module_store_pointer_fn_t store_pointer;
|
||||
opal_db_base_module_fetch_fn_t fetch;
|
||||
opal_db_base_module_fetch_pointer_fn_t fetch_pointer;
|
||||
opal_db_base_module_fetch_multiple_fn_t fetch_multiple;
|
||||
opal_db_base_module_remove_fn_t remove;
|
||||
opal_db_base_module_add_log_fn_t add_log;
|
||||
};
|
||||
typedef struct orte_db_base_module_1_0_0_t orte_db_base_module_1_0_0_t;
|
||||
typedef struct orte_db_base_module_1_0_0_t orte_db_base_module_t;
|
||||
typedef struct opal_db_base_module_1_0_0_t opal_db_base_module_1_0_0_t;
|
||||
typedef struct opal_db_base_module_1_0_0_t opal_db_base_module_t;
|
||||
|
||||
/* we need to get two priorities back from our components, so
|
||||
* define a customized query function for our use
|
||||
*/
|
||||
typedef int (*opal_db_component_query_fn_t)(opal_db_base_module_t **module,
|
||||
int *store_priority,
|
||||
int *fetch_priority);
|
||||
/*
|
||||
* the standard component data structure
|
||||
*/
|
||||
struct orte_db_base_component_1_0_0_t {
|
||||
struct opal_db_base_component_1_0_0_t {
|
||||
mca_base_component_t base_version;
|
||||
mca_base_component_data_t base_data;
|
||||
opal_db_component_query_fn_t query;
|
||||
};
|
||||
typedef struct orte_db_base_component_1_0_0_t orte_db_base_component_1_0_0_t;
|
||||
typedef struct orte_db_base_component_1_0_0_t orte_db_base_component_t;
|
||||
typedef struct opal_db_base_component_1_0_0_t opal_db_base_component_1_0_0_t;
|
||||
typedef struct opal_db_base_component_1_0_0_t opal_db_base_component_t;
|
||||
|
||||
/*
|
||||
* Macro for use in components that are of type db
|
||||
*/
|
||||
#define ORTE_DB_BASE_VERSION_1_0_0 \
|
||||
#define OPAL_DB_BASE_VERSION_1_0_0 \
|
||||
MCA_BASE_VERSION_2_0_0, \
|
||||
"db", 1, 0, 0
|
||||
|
||||
/* Global structure for accessing DB functions */
|
||||
ORTE_DECLSPEC extern orte_db_base_module_t orte_db; /* holds selected module's function pointers */
|
||||
OPAL_DECLSPEC extern opal_db_base_module_t opal_db; /* holds base function pointers */
|
||||
|
||||
END_C_DECLS
|
||||
|
28
opal/mca/db/db_types.h
Normal file
28
opal/mca/db/db_types.h
Normal file
@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/** @file:
|
||||
*
|
||||
* The OPAL Database Framework
|
||||
*
|
||||
*/
|
||||
|
||||
# |