This is actually a much smaller commit than it appears at first glance - it just touches a lot of files. The --without-rte-support configuration option has never really been implemented completely. The option caused various objects not to be defined and conditionally compiled some base functions, but did nothing to prevent build of the component libraries. Unfortunately, since many of those components use objects covered by the option, it caused builds to break if those components were allowed to build.
Brian dealt with this in the past by creating platform files and using "no-build" to block the components. This was clunky, but acceptable when only one organization was using that option. However, that number has now expanded to at least two more locations. Accordingly, make --without-rte-support actually work by adding appropriate configury to prevent components from building when they shouldn't. While doing so, remove two frameworks (db and rmcast) that are no longer used as ORCM comes to a close (besides, they belonged in ORCM now anyway). Do some minor cleanups along the way. This commit was SVN r25497.
This commit is contained in:
parent
cce0949bda
commit
9b59d8de6f
@ -21,8 +21,8 @@ r2_sources = \
|
||||
bml_r2.c \
|
||||
bml_r2.h \
|
||||
bml_r2_component.c \
|
||||
bml_r2_ft.c \
|
||||
bml_r2_ft.h
|
||||
bml_r2_ft.c \
|
||||
bml_r2_ft.h
|
||||
|
||||
dist_pkgdata_DATA = help-mca-bml-r2.txt
|
||||
|
||||
|
@ -38,6 +38,7 @@
|
||||
|
||||
int mca_bml_r2_ft_event(int state)
|
||||
{
|
||||
#if !ORTE_DISABLE_FULL_SUPPORT
|
||||
static bool first_continue_pass = false;
|
||||
ompi_proc_t** procs = NULL;
|
||||
size_t num_procs;
|
||||
@ -297,6 +298,7 @@ int mca_bml_r2_ft_event(int state)
|
||||
else {
|
||||
;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
21
ompi/mca/dpm/orte/configure.m4
Normal file
21
ompi/mca/dpm/orte/configure.m4
Normal file
@ -0,0 +1,21 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2011 Los Alamos National Security, LLC.
|
||||
# All rights reserved.
|
||||
#
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# MCA_dpm_orte_CONFIG([action-if-found], [action-if-not-found])
|
||||
# -----------------------------------------------------------
|
||||
AC_DEFUN([MCA_ompi_dpm_orte_CONFIG],[
|
||||
AC_CONFIG_FILES([ompi/mca/dpm/orte/Makefile])
|
||||
|
||||
AS_IF([test "$orte_without_full_support" = 0],
|
||||
[$1],
|
||||
[$2])
|
||||
])dnl
|
21
ompi/mca/pubsub/orte/configure.m4
Normal file
21
ompi/mca/pubsub/orte/configure.m4
Normal file
@ -0,0 +1,21 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2011 Los Alamos National Security, LLC.
|
||||
# All rights reserved.
|
||||
#
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# MCA_pubsub_orte_CONFIG([action-if-found], [action-if-not-found])
|
||||
# -----------------------------------------------------------
|
||||
AC_DEFUN([MCA_ompi_pubsub_orte_CONFIG],[
|
||||
AC_CONFIG_FILES([ompi/mca/pubsub/orte/Makefile])
|
||||
|
||||
AS_IF([test "$orte_without_full_support" = 0],
|
||||
[$1],
|
||||
[$2])
|
||||
])dnl
|
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2006-2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2010 Los Alamos National Security, LLC.
|
||||
* Copyright (c) 2010-2011 Los Alamos National Security, LLC.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2011 University of Houston. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -103,15 +103,13 @@
|
||||
#include "orte/mca/errmgr/base/base.h"
|
||||
#include "orte/mca/grpcomm/grpcomm.h"
|
||||
#include "orte/mca/grpcomm/base/base.h"
|
||||
#include "orte/mca/db/db.h"
|
||||
#include "orte/mca/db/base/base.h"
|
||||
#include "orte/mca/ess/ess.h"
|
||||
#include "orte/mca/ess/base/base.h"
|
||||
#include "orte/mca/notifier/notifier.h"
|
||||
#include "orte/mca/notifier/base/base.h"
|
||||
#include "orte/util/show_help.h"
|
||||
#include "orte/util/proc_info.h"
|
||||
#if !ORTE_DISABLE_FULL_SUPPORT
|
||||
#include "orte/mca/notifier/notifier.h"
|
||||
#include "orte/mca/notifier/base/base.h"
|
||||
#include "orte/mca/debugger/debugger.h"
|
||||
#include "orte/mca/debugger/base/base.h"
|
||||
#include "orte/mca/iof/iof.h"
|
||||
@ -124,8 +122,6 @@
|
||||
#include "orte/mca/ras/base/ras_private.h"
|
||||
#include "orte/mca/rmaps/rmaps.h"
|
||||
#include "orte/mca/rmaps/base/base.h"
|
||||
#include "orte/mca/rmcast/rmcast.h"
|
||||
#include "orte/mca/rmcast/base/base.h"
|
||||
#include "orte/mca/rml/rml.h"
|
||||
#include "orte/mca/rml/base/base.h"
|
||||
#include "orte/mca/routed/routed.h"
|
||||
@ -418,14 +414,6 @@ void ompi_info_open_components(void)
|
||||
map->components = &orte_grpcomm_base.components_available;
|
||||
opal_pointer_array_add(&component_map, map);
|
||||
|
||||
if (ORTE_SUCCESS != orte_db_base_open()) {
|
||||
goto error;
|
||||
}
|
||||
map = OBJ_NEW(ompi_info_component_map_t);
|
||||
map->type = strdup("db");
|
||||
map->components = &orte_db_base_components_available;
|
||||
opal_pointer_array_add(&component_map, map);
|
||||
|
||||
if (ORTE_SUCCESS != orte_ess_base_open()) {
|
||||
goto error;
|
||||
}
|
||||
@ -434,6 +422,7 @@ void ompi_info_open_components(void)
|
||||
map->components = &orte_ess_base_components_available;
|
||||
opal_pointer_array_add(&component_map, map);
|
||||
|
||||
#if !ORTE_DISABLE_FULL_SUPPORT
|
||||
if (ORTE_SUCCESS != orte_notifier_base_open()) {
|
||||
goto error;
|
||||
}
|
||||
@ -442,7 +431,6 @@ void ompi_info_open_components(void)
|
||||
map->components = &orte_notifier_base_components_available;
|
||||
opal_pointer_array_add(&component_map, map);
|
||||
|
||||
#if !ORTE_DISABLE_FULL_SUPPORT
|
||||
if (ORTE_SUCCESS != orte_debugger_base_open()) {
|
||||
goto error;
|
||||
}
|
||||
@ -491,14 +479,6 @@ void ompi_info_open_components(void)
|
||||
map->components = &orte_rmaps_base.available_components;
|
||||
opal_pointer_array_add(&component_map, map);
|
||||
|
||||
if (ORTE_SUCCESS != orte_rmcast_base_open()) {
|
||||
goto error;
|
||||
}
|
||||
map = OBJ_NEW(ompi_info_component_map_t);
|
||||
map->type = strdup("rmcast");
|
||||
map->components = &orte_rmcast_base.rmcast_opened;
|
||||
opal_pointer_array_add(&component_map, map);
|
||||
|
||||
if (ORTE_SUCCESS != orte_rml_base_open()) {
|
||||
goto error;
|
||||
}
|
||||
@ -799,8 +779,6 @@ void ompi_info_close_components()
|
||||
(void) ompi_osc_base_close();
|
||||
|
||||
(void) orte_grpcomm_base_close();
|
||||
(void) orte_db_base_close();
|
||||
(void) orte_notifier_base_close();
|
||||
(void) orte_ess_base_close();
|
||||
(void) orte_show_help_finalize();
|
||||
#if !ORTE_DISABLE_FULL_SUPPORT
|
||||
@ -808,6 +786,7 @@ void ompi_info_close_components()
|
||||
(void) orte_snapc_base_close();
|
||||
(void) orte_sstore_base_close();
|
||||
#endif
|
||||
(void) orte_notifier_base_close();
|
||||
(void) orte_filem_base_close();
|
||||
(void) orte_iof_base_close();
|
||||
(void) orte_plm_base_close();
|
||||
@ -818,7 +797,6 @@ void ompi_info_close_components()
|
||||
(void) orte_routed_base_close();
|
||||
(void) mca_oob_base_close();
|
||||
|
||||
(void) orte_rmcast_base_close();
|
||||
#endif
|
||||
(void) orte_errmgr_base_close();
|
||||
|
||||
|
@ -239,7 +239,6 @@ int main(int argc, char *argv[])
|
||||
opal_pointer_array_add(&mca_types, "odls");
|
||||
opal_pointer_array_add(&mca_types, "ras");
|
||||
opal_pointer_array_add(&mca_types, "rmaps");
|
||||
opal_pointer_array_add(&mca_types, "rmcast");
|
||||
opal_pointer_array_add(&mca_types, "rml");
|
||||
opal_pointer_array_add(&mca_types, "routed");
|
||||
opal_pointer_array_add(&mca_types, "plm");
|
||||
@ -256,7 +255,6 @@ int main(int argc, char *argv[])
|
||||
opal_pointer_array_add(&mca_types, "errmgr");
|
||||
opal_pointer_array_add(&mca_types, "ess");
|
||||
opal_pointer_array_add(&mca_types, "grpcomm");
|
||||
opal_pointer_array_add(&mca_types, "db");
|
||||
opal_pointer_array_add(&mca_types, "notifier");
|
||||
|
||||
/* Execute the desired action(s) */
|
||||
|
@ -77,25 +77,6 @@ AC_DEFINE_UNQUOTED([ORTE_WANT_ORTERUN_PREFIX_BY_DEFAULT],
|
||||
[$orte_want_orterun_prefix_by_default],
|
||||
[Whether we want orterun to effect "--prefix $prefix" by default])
|
||||
|
||||
#
|
||||
# Do we want reliable multicast enabled?
|
||||
#
|
||||
|
||||
AC_MSG_CHECKING([if want reliable multicast])
|
||||
AC_ARG_ENABLE([multicast],
|
||||
[AC_HELP_STRING([--enable-multicast],
|
||||
[Enable reliable multicast messaging (default: disabled)])])
|
||||
if test "$enable_multicast" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
orte_want_multicast=1
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
orte_want_multicast=0
|
||||
fi
|
||||
AC_DEFINE_UNQUOTED([ORTE_ENABLE_MULTICAST],
|
||||
[$orte_want_multicast],
|
||||
[Whether we want multicast messaging enabled])
|
||||
|
||||
#
|
||||
# Do we want sensors enabled?
|
||||
|
||||
@ -135,16 +116,22 @@ AC_DEFINE_UNQUOTED([ORTE_ENABLE_HEARTBEAT],
|
||||
#
|
||||
# Compile in resilient runtime code
|
||||
#
|
||||
AC_MSG_CHECKING([if want resilient runtime code enabled])
|
||||
AC_ARG_ENABLE(resilient-orte,
|
||||
[AC_HELP_STRING([--enable-resilient-orte], [Enable the resilient runtime code.])])
|
||||
AS_IF( [test "$enable_resilient_orte" = "yes"], [result=1], [result=0] )
|
||||
|
||||
if test "$enable_resilient_orte" = "yes"; then
|
||||
AC_MSG_RESULT([yes])
|
||||
orte_enable_resilient_code=1
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
orte_enable_resilient_code=0
|
||||
fi
|
||||
AM_CONDITIONAL(ORTE_RESIL_ORTE, [test "$enable_resilient_orte" = "yes"])
|
||||
AC_DEFINE_UNQUOTED([ORTE_RESIL_ORTE], [$result],
|
||||
AC_DEFINE_UNQUOTED([ORTE_RESIL_ORTE], [$orte_enable_resilient_code],
|
||||
[Compile a resilient version of Open MPI])
|
||||
|
||||
AM_CONDITIONAL(ORTE_ENABLE_EPOCH, [test "$enable_resilient_orte" = "yes"])
|
||||
AC_DEFINE_UNQUOTED([ORTE_ENABLE_EPOCH], [$result],
|
||||
AC_DEFINE_UNQUOTED([ORTE_ENABLE_EPOCH], [$orte_enable_resilient_code],
|
||||
[Support for epoch in the ORTE process name enabled or not])
|
||||
|
||||
|
||||
|
@ -1,32 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
AM_CPPFLAGS = $(LTDLINCL)
|
||||
|
||||
# main library setup
|
||||
noinst_LTLIBRARIES = libmca_db.la
|
||||
libmca_db_la_SOURCES =
|
||||
|
||||
# pkgdata setup
|
||||
dist_pkgdata_DATA =
|
||||
|
||||
# local files
|
||||
headers = db.h
|
||||
libmca_db_la_SOURCES += $(headers)
|
||||
|
||||
# Conditionally install the header files
|
||||
if WANT_INSTALL_HEADERS
|
||||
ortedir = $(includedir)/openmpi/$(subdir)
|
||||
nobase_orte_HEADERS = $(headers)
|
||||
endif
|
||||
|
||||
include base/Makefile.am
|
||||
|
||||
distclean-local:
|
||||
rm -f base/static-components.h
|
@ -1,18 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
dist_pkgdata_DATA += base/help-db-base.txt
|
||||
|
||||
headers += \
|
||||
base/base.h
|
||||
|
||||
libmca_db_la_SOURCES += \
|
||||
base/db_base_open.c \
|
||||
base/db_base_close.c \
|
||||
base/db_base_select.c
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/** @file:
|
||||
*/
|
||||
|
||||
#ifndef MCA_DB_BASE_H
|
||||
#define MCA_DB_BASE_H
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/types.h"
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/class/opal_list.h"
|
||||
|
||||
#include "orte/mca/db/db.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/*
|
||||
* Global functions for MCA overall collective open and close
|
||||
*/
|
||||
|
||||
/**
|
||||
* Open the db framework
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_db_base_open(void);
|
||||
|
||||
/**
|
||||
* Select a db module
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_db_base_select(void);
|
||||
|
||||
/**
|
||||
* Close the db framework
|
||||
*/
|
||||
ORTE_DECLSPEC int orte_db_base_close(void);
|
||||
|
||||
/*
|
||||
* The verbose channel for debug output
|
||||
*/
|
||||
ORTE_DECLSPEC extern int orte_db_base_output;
|
||||
|
||||
ORTE_DECLSPEC extern opal_list_t orte_db_base_components_available;
|
||||
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif
|
@ -1,50 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/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 "orte/mca/db/base/base.h"
|
||||
|
||||
extern opal_list_t orte_db_base_components_available;
|
||||
|
||||
int
|
||||
orte_db_base_close(void)
|
||||
{
|
||||
opal_list_item_t *item;
|
||||
mca_base_component_list_item_t *cli;
|
||||
|
||||
if (NULL != orte_db.finalize) {
|
||||
orte_db.finalize();
|
||||
}
|
||||
|
||||
/* unload all remaining components */
|
||||
while (NULL != (item = opal_list_remove_first(&orte_db_base_components_available))) {
|
||||
orte_db_base_component_t* component;
|
||||
cli = (mca_base_component_list_item_t *) item;
|
||||
component = (orte_db_base_component_t*) cli->cli_component;
|
||||
opal_output_verbose(10, 0,
|
||||
"orte_db_base_close: module %s unloaded",
|
||||
component->base_version.mca_component_name);
|
||||
mca_base_component_repository_release((mca_base_component_t *) component);
|
||||
OBJ_RELEASE(item);
|
||||
}
|
||||
|
||||
OBJ_DESTRUCT(&orte_db_base_components_available);
|
||||
opal_output_close(orte_db_base_output);
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
@ -1,97 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/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 "orte/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 "orte/mca/db/base/static-components.h"
|
||||
|
||||
opal_list_t orte_db_base_components_available;
|
||||
|
||||
/* provide "NULL" functions */
|
||||
static int init(void);
|
||||
static int finalize(void);
|
||||
static int store(char *key, void *object, opal_data_type_t type);
|
||||
static int set_source(orte_process_name_t *name);
|
||||
static int fetch(char *key, void *object, opal_data_type_t type);
|
||||
static int update(char *key, void *object, opal_data_type_t type);
|
||||
static int remove_data(char *key);
|
||||
|
||||
orte_db_base_module_t orte_db = {
|
||||
init,
|
||||
finalize,
|
||||
store,
|
||||
set_source,
|
||||
fetch,
|
||||
update,
|
||||
remove_data
|
||||
};
|
||||
int orte_db_base_output;
|
||||
|
||||
int
|
||||
orte_db_base_open(void)
|
||||
{
|
||||
orte_db_base_output = opal_output_open(NULL);
|
||||
|
||||
OBJ_CONSTRUCT(&orte_db_base_components_available, opal_list_t);
|
||||
|
||||
/* Open up all available components */
|
||||
if (ORTE_SUCCESS !=
|
||||
mca_base_components_open("db", orte_db_base_output, mca_db_base_static_components,
|
||||
&orte_db_base_components_available,
|
||||
true)) {
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int init(void)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
static int finalize(void)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
static int store(char *key, void *object, opal_data_type_t type)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
static int set_source(orte_process_name_t *name)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
static int fetch(char *key, void *object, opal_data_type_t type)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
static int update(char *key, void *object, opal_data_type_t type)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
static int remove_data(char *key)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/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 "orte/mca/db/base/base.h"
|
||||
|
||||
extern opal_list_t orte_db_base_components_available;
|
||||
|
||||
int
|
||||
orte_db_base_select(void)
|
||||
{
|
||||
orte_db_base_component_t *best_component = NULL;
|
||||
orte_db_base_module_t *best_module = NULL;
|
||||
|
||||
/*
|
||||
* Select the best component
|
||||
*/
|
||||
if( OPAL_SUCCESS != mca_base_select("db", orte_db_base_output,
|
||||
&orte_db_base_components_available,
|
||||
(mca_base_module_t **) &best_module,
|
||||
(mca_base_component_t **) &best_component) ) {
|
||||
/* It is okay to not select a component - default
|
||||
* to using the base NULL component
|
||||
*/
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* Save and init the winner */
|
||||
orte_db = *best_module;
|
||||
if (NULL != orte_db.init) {
|
||||
orte_db.init();
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
-*- text -*-
|
||||
#
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
#
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
# This is the US/English general help file for ORTE 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.
|
||||
|
||||
Job state: %s
|
||||
|
||||
This information should probably be reported to the OMPI developers.
|
@ -1,38 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
sources = \
|
||||
db_daemon.h \
|
||||
db_daemon_component.c \
|
||||
db_daemon.c
|
||||
|
||||
# Make the output library in this directory, and name it either
|
||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||
# (for static builds).
|
||||
|
||||
if MCA_BUILD_orte_db_daemon_DSO
|
||||
component_noinst =
|
||||
component_install = mca_db_daemon.la
|
||||
else
|
||||
component_noinst = libmca_db_daemon.la
|
||||
component_install =
|
||||
endif
|
||||
|
||||
mcacomponentdir = $(pkglibdir)
|
||||
mcacomponent_LTLIBRARIES = $(component_install)
|
||||
mca_db_daemon_la_CPPFLAGS = $(db_daemon_CPPFLAGS)
|
||||
mca_db_daemon_la_SOURCES = $(sources)
|
||||
mca_db_daemon_la_LDFLAGS = -module -avoid-version $(db_daemon_LDFLAGS)
|
||||
mca_db_daemon_la_LIBADD = $(db_daemon_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES = $(component_noinst)
|
||||
libmca_db_daemon_la_CPPFLAGS = $(db_daemon_CPPFLAGS)
|
||||
libmca_db_daemon_la_SOURCES =$(sources)
|
||||
libmca_db_daemon_la_LDFLAGS = -module -avoid-version $(db_daemon_LDFLAGS)
|
||||
libmca_db_daemon_la_LIBADD = $(db_daemon_LIBS)
|
@ -1,19 +0,0 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# MCA_db_daemon_CONFIG([action-if-found], [action-if-not-found])
|
||||
# -----------------------------------------------------------
|
||||
AC_DEFUN([MCA_orte_db_daemon_CONFIG], [
|
||||
AC_CONFIG_FILES([orte/mca/db/daemon/Makefile])
|
||||
|
||||
# cant run this component without multicast
|
||||
AS_IF([test "$orte_want_multicast" = "1"],
|
||||
[$1], [$2])
|
||||
])dnl
|
@ -1,440 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2004-2011 The University of Tennessee and The University
|
||||
* of Tennessee Research Foundation. All rights
|
||||
* reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/constants.h"
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include "opal/class/opal_pointer_array.h"
|
||||
#include "opal/dss/dss_types.h"
|
||||
#include "opal/util/output.h"
|
||||
|
||||
#include "orte/util/show_help.h"
|
||||
#include "orte/util/name_fns.h"
|
||||
#include "orte/mca/errmgr/errmgr.h"
|
||||
#include "orte/mca/rmcast/rmcast.h"
|
||||
#include "orte/runtime/orte_globals.h"
|
||||
#include "orte/runtime/orte_wait.h"
|
||||
|
||||
#include "orte/mca/db/base/base.h"
|
||||
#include "db_daemon.h"
|
||||
|
||||
static int init(void);
|
||||
static int finalize(void);
|
||||
static int store(char *key, void *object, opal_data_type_t type);
|
||||
static int set_source(orte_process_name_t *name);
|
||||
static int fetch(char *key, void *object, opal_data_type_t type);
|
||||
static int update(char *key, void *object, opal_data_type_t type);
|
||||
static int remove_data(char *key);
|
||||
|
||||
orte_db_base_module_t orte_db_daemon_module = {
|
||||
init,
|
||||
finalize,
|
||||
store,
|
||||
set_source,
|
||||
fetch,
|
||||
update,
|
||||
remove_data
|
||||
};
|
||||
|
||||
/* local types */
|
||||
typedef struct {
|
||||
opal_object_t super;
|
||||
orte_process_name_t name;
|
||||
char *key;
|
||||
int32_t size;
|
||||
uint8_t *bytes;
|
||||
} orte_db_data_t;
|
||||
static void dtconstructor(orte_db_data_t *dt)
|
||||
{
|
||||
dt->key = NULL;
|
||||
dt->bytes = NULL;
|
||||
dt->size = 0;
|
||||
}
|
||||
static void dtdestructor(orte_db_data_t *dt)
|
||||
{
|
||||
if (NULL != dt->key) {
|
||||
free(dt->key);
|
||||
}
|
||||
if (NULL != dt->bytes) {
|
||||
free(dt->bytes);
|
||||
}
|
||||
}
|
||||
OBJ_CLASS_INSTANCE(orte_db_data_t,
|
||||
opal_object_t,
|
||||
dtconstructor,
|
||||
dtdestructor);
|
||||
|
||||
/* local variables */
|
||||
static orte_vpid_t num_recvd;
|
||||
static bool ack_reqd;
|
||||
static opal_pointer_array_t datastore;
|
||||
static orte_rmcast_channel_t my_group_channel;
|
||||
|
||||
/* local functions */
|
||||
static void callback_fn(int status,
|
||||
orte_rmcast_channel_t channel,
|
||||
orte_rmcast_seq_t seq_num,
|
||||
orte_rmcast_tag_t tag,
|
||||
orte_process_name_t *sender,
|
||||
opal_buffer_t *buf, void* cbdata);
|
||||
|
||||
static void recv_cmd(int status,
|
||||
orte_rmcast_channel_t channel,
|
||||
orte_rmcast_seq_t seq_num,
|
||||
orte_rmcast_tag_t tag,
|
||||
orte_process_name_t *sender,
|
||||
opal_buffer_t *buf, void* cbdata);
|
||||
|
||||
static void recv_ack(int status,
|
||||
orte_rmcast_channel_t channel,
|
||||
orte_rmcast_seq_t seq_num,
|
||||
orte_rmcast_tag_t tag,
|
||||
orte_process_name_t *sender,
|
||||
opal_buffer_t *buf, void* cbdata);
|
||||
|
||||
#include MCA_timer_IMPLEMENTATION_HEADER
|
||||
static inline double gettime(void) __opal_attribute_always_inline__;
|
||||
static inline double gettime(void)
|
||||
{
|
||||
double wtime;
|
||||
#if OPAL_TIMER_USEC_NATIVE
|
||||
wtime = ((double) opal_timer_base_get_usec()) / 1000000.0;
|
||||
#else
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
wtime = tv.tv_sec;
|
||||
wtime += (double)tv.tv_usec / 1000000.0;
|
||||
#endif
|
||||
return wtime;
|
||||
}
|
||||
#define TIMER_START(x) (x) = gettime();
|
||||
#define TIMER_STOP(y,x) (y) = (gettime() - (x));
|
||||
|
||||
static int init(void)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP) {
|
||||
/* daemons recv data server cmds */
|
||||
if (ORTE_SUCCESS != (rc = orte_rmcast.recv_buffer_nb(ORTE_RMCAST_DATA_SERVER_CHANNEL,
|
||||
ORTE_RMCAST_TAG_DATA,
|
||||
ORTE_RMCAST_PERSISTENT,
|
||||
recv_cmd, NULL))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
OBJ_CONSTRUCT(&datastore, opal_pointer_array_t);
|
||||
opal_pointer_array_init(&datastore, 16, INT_MAX, 16);
|
||||
} else if (ORTE_PROC_IS_APP) {
|
||||
/* get my multicast output group */
|
||||
orte_rmcast.query_channel(&my_group_channel, NULL);
|
||||
|
||||
/* recv responses */
|
||||
if (ORTE_SUCCESS != (rc = orte_rmcast.recv_buffer_nb(my_group_channel,
|
||||
ORTE_RMCAST_TAG_CMD_ACK,
|
||||
ORTE_RMCAST_PERSISTENT,
|
||||
recv_ack, NULL))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
}
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int finalize(void)
|
||||
{
|
||||
int i;
|
||||
orte_db_data_t *dat;
|
||||
|
||||
/* cancel the callbacks */
|
||||
if (ORTE_PROC_IS_DAEMON || ORTE_PROC_IS_HNP) {
|
||||
orte_rmcast.cancel_recv(ORTE_RMCAST_DATA_SERVER_CHANNEL, ORTE_RMCAST_TAG_DATA);
|
||||
for (i=0; i < datastore.size; i++) {
|
||||
if (NULL != (dat = (orte_db_data_t*)opal_pointer_array_get_item(&datastore, i))) {
|
||||
OBJ_RELEASE(dat);
|
||||
}
|
||||
}
|
||||
OBJ_DESTRUCT(&datastore);
|
||||
} else if (ORTE_PROC_IS_APP) {
|
||||
orte_rmcast.cancel_recv(my_group_channel, ORTE_RMCAST_TAG_WILDCARD);
|
||||
}
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int send_data(orte_db_cmd_t cmd, char *key, void *object, opal_data_type_t type)
|
||||
{
|
||||
opal_buffer_t *buf, dat;
|
||||
orte_job_t *jdata;
|
||||
orte_proc_t *proc;
|
||||
orte_job_state_t *job_state;
|
||||
orte_proc_state_t *proc_state;
|
||||
int rc;
|
||||
bool got_response;
|
||||
opal_byte_object_t bo;
|
||||
|
||||
/* construct the buffer we will use for packing the data */
|
||||
buf = OBJ_NEW(opal_buffer_t);
|
||||
opal_dss.pack(buf, &cmd, 1, ORTE_DB_CMD_T); /* add cmd */
|
||||
opal_dss.pack(buf, &my_group_channel, 1, ORTE_RMCAST_CHANNEL_T); /* tell the server my channel */
|
||||
opal_dss.pack(buf, &key, 1, OPAL_STRING); /* pack the key */
|
||||
|
||||
if (NULL != object) {
|
||||
OBJ_CONSTRUCT(&dat, opal_buffer_t);
|
||||
/* pack the data */
|
||||
switch (type) {
|
||||
case ORTE_JOB:
|
||||
jdata = (orte_job_t*)object;
|
||||
opal_dss.pack(&dat, &jdata, 1, ORTE_JOB);
|
||||
break;
|
||||
case ORTE_JOB_STATE:
|
||||
job_state = (orte_job_state_t*)object;
|
||||
opal_dss.pack(&dat, job_state, 1, ORTE_JOB_STATE);
|
||||
break;
|
||||
|
||||
case ORTE_PROC:
|
||||
proc = (orte_proc_t*)object;
|
||||
opal_dss.pack(&dat, &proc, 1, ORTE_PROC);
|
||||
break;
|
||||
case ORTE_PROC_STATE:
|
||||
proc_state = (orte_proc_state_t*)object;
|
||||
opal_dss.pack(&dat, proc_state, 1, ORTE_PROC_STATE);
|
||||
break;
|
||||
|
||||
default:
|
||||
orte_show_help("help-db-base.txt", "unrecognized-type", true, type);
|
||||
rc = ORTE_ERR_BAD_PARAM;
|
||||
goto cleanup;
|
||||
break;
|
||||
}
|
||||
opal_dss.unload(&dat, (void**)&bo.bytes, &bo.size);
|
||||
opal_dss.pack(buf, &bo.size, 1, OPAL_INT32);
|
||||
opal_dss.pack(buf, &bo.bytes, bo.size, OPAL_UINT8);
|
||||
OBJ_DESTRUCT(&dat);
|
||||
free(bo.bytes);
|
||||
}
|
||||
|
||||
got_response = false;
|
||||
num_recvd = 0;
|
||||
ack_reqd = true;
|
||||
|
||||
/* send the data to all the daemons */
|
||||
if (ORTE_SUCCESS != (rc = orte_rmcast.send_buffer_nb(ORTE_RMCAST_DATA_SERVER_CHANNEL,
|
||||
ORTE_RMCAST_TAG_DATA, buf,
|
||||
callback_fn, NULL))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
/* wait for all daemons to ack the request */
|
||||
ORTE_PROGRESSED_WAIT(got_response, num_recvd, orte_process_info.num_daemons);
|
||||
ack_reqd = false;
|
||||
|
||||
cleanup:
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int store(char *key, void *object, opal_data_type_t type)
|
||||
{
|
||||
int rc;
|
||||
double start;
|
||||
double cpu_time_used;
|
||||
|
||||
TIMER_START(start);
|
||||
|
||||
if (ORTE_SUCCESS != (rc = send_data(ORTE_DB_STORE_CMD, key, object, type))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
|
||||
TIMER_STOP(cpu_time_used, start);
|
||||
opal_output(0, "%s TOOK %g usecs TO STORE",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
cpu_time_used * 1000000.0);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int set_source(orte_process_name_t *name)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int fetch(char *key, void *object, opal_data_type_t type)
|
||||
{
|
||||
int rc;
|
||||
double cpu_time_used, start;
|
||||
|
||||
TIMER_START(start);
|
||||
|
||||
if (ORTE_SUCCESS != (rc = send_data(ORTE_DB_FETCH_CMD, key, NULL, OPAL_INT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
|
||||
TIMER_STOP(cpu_time_used, start);
|
||||
opal_output(0, "%s TOOK %g usecs TO FETCH",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
cpu_time_used * 1000000.0);
|
||||
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
static int update(char *key, void *object, opal_data_type_t type)
|
||||
{
|
||||
int rc;
|
||||
double start;
|
||||
double cpu_time_used;
|
||||
|
||||
TIMER_START(start);
|
||||
|
||||
if (ORTE_SUCCESS != (rc = send_data(ORTE_DB_UPDATE_CMD, key, object, type))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
|
||||
TIMER_STOP(cpu_time_used, start);
|
||||
opal_output(0, "%s TOOK %g usecs TO UPDATE",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
cpu_time_used * 1000000.0);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int remove_data(char *key)
|
||||
{
|
||||
int rc;
|
||||
double start;
|
||||
double cpu_time_used;
|
||||
|
||||
TIMER_START(start);
|
||||
|
||||
if (ORTE_SUCCESS != (rc = send_data(ORTE_DB_REMOVE_CMD, key, NULL, OPAL_INT32))) {
|
||||
ORTE_ERROR_LOG(rc);
|
||||
}
|
||||
|
||||
TIMER_STOP(cpu_time_used, start);
|
||||
opal_output(0, "%s TOOK %g usecs TO REMOVE",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
cpu_time_used * 1000000.0);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void callback_fn(int status,
|
||||
orte_rmcast_channel_t channel,
|
||||
orte_rmcast_seq_t seq_num,
|
||||
orte_rmcast_tag_t tag,
|
||||
orte_process_name_t *sender,
|
||||
opal_buffer_t *buf, void* cbdata)
|
||||
{
|
||||
OBJ_RELEASE(buf);
|
||||
}
|
||||
|
||||
static void recv_ack(int status,
|
||||
orte_rmcast_channel_t channel,
|
||||
orte_rmcast_seq_t seq_num,
|
||||
orte_rmcast_tag_t tag,
|
||||
orte_process_name_t *sender,
|
||||
opal_buffer_t *buf, void* cbdata)
|
||||
{
|
||||
if (ack_reqd) {
|
||||
num_recvd++;
|
||||
}
|
||||
}
|
||||
|
||||
static void recv_cmd(int status,
|
||||
orte_rmcast_channel_t channel,
|
||||
orte_rmcast_seq_t seq_num,
|
||||
orte_rmcast_tag_t tag,
|
||||
orte_process_name_t *sender,
|
||||
opal_buffer_t *buf, void* cbdata)
|
||||
{
|
||||
orte_db_cmd_t cmd;
|
||||
opal_buffer_t *ans;
|
||||
int count, i;
|
||||
int32_t rc;
|
||||
char *key;
|
||||
orte_db_data_t *dat;
|
||||
orte_rmcast_channel_t ch;
|
||||
char *ch_name;
|
||||
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_db_base_output,
|
||||
"%s db:daemon: cmd recvd from %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
ORTE_NAME_PRINT(sender)));
|
||||
|
||||
count=1;
|
||||
opal_dss.unpack(buf, &cmd, &count, ORTE_DB_CMD_T);
|
||||
count=1;
|
||||
opal_dss.unpack(buf, &ch, &count, ORTE_RMCAST_CHANNEL_T);
|
||||
count=1;
|
||||
opal_dss.unpack(buf, &ch_name, &count, OPAL_STRING);
|
||||
count=1;
|
||||
opal_dss.unpack(buf, &key, &count, OPAL_STRING);
|
||||
|
||||
ans = OBJ_NEW(opal_buffer_t);
|
||||
opal_dss.pack(ans, &cmd, 1, ORTE_DB_CMD_T);
|
||||
|
||||
switch (cmd) {
|
||||
case ORTE_DB_STORE_CMD:
|
||||
dat = OBJ_NEW(orte_db_data_t);
|
||||
dat->name.jobid = sender->jobid;
|
||||
dat->name.vpid = sender->vpid;
|
||||
ORTE_EPOCH_SET(dat->name.epoch,sender->epoch);
|
||||
dat->key = key;
|
||||
count=1;
|
||||
opal_dss.unpack(buf, &dat->size, &count, OPAL_INT32);
|
||||
dat->bytes = (uint8_t*)malloc(dat->size);
|
||||
opal_dss.unpack(buf, dat->bytes, &dat->size, OPAL_UINT8);
|
||||
opal_pointer_array_add(&datastore, dat);
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_db_base_output,
|
||||
"%s db:daemon: data from %s stored: key %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
ORTE_NAME_PRINT(sender), key));
|
||||
rc = ORTE_SUCCESS;
|
||||
opal_dss.pack(ans, &rc, 1, OPAL_INT32);
|
||||
break;
|
||||
case ORTE_DB_FETCH_CMD:
|
||||
/* find the key */
|
||||
for (i=0; i < datastore.size; i++) {
|
||||
if (NULL == (dat = (orte_db_data_t*)opal_pointer_array_get_item(&datastore, i))) {
|
||||
continue;
|
||||
}
|
||||
if (0 != strcmp(key, dat->key)) {
|
||||
continue;
|
||||
}
|
||||
/* found the data - return it */
|
||||
rc = ORTE_SUCCESS;
|
||||
opal_dss.pack(ans, &rc, 1, OPAL_INT32);
|
||||
opal_dss.pack(ans, &dat->size, 1, OPAL_INT32);
|
||||
opal_dss.pack(ans, dat->bytes, dat->size, OPAL_UINT8);
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_db_base_output,
|
||||
"%s db:daemon: data fetched for %s: key %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
ORTE_NAME_PRINT(sender), key));
|
||||
break;
|
||||
}
|
||||
rc = ORTE_ERR_NOT_FOUND;
|
||||
opal_dss.pack(ans, &rc, 1, OPAL_INT32);
|
||||
OPAL_OUTPUT_VERBOSE((2, orte_db_base_output,
|
||||
"%s db:daemon: data fetch request from %s not found: key %s",
|
||||
ORTE_NAME_PRINT(ORTE_PROC_MY_NAME),
|
||||
ORTE_NAME_PRINT(sender), key));
|
||||
break;
|
||||
|
||||
default:
|
||||
rc = ORTE_ERR_NOT_FOUND;
|
||||
break;
|
||||
}
|
||||
|
||||
/* ensure the return channel is open */
|
||||
orte_rmcast.open_channel(ch, ch_name, NULL, -1, NULL, ORTE_RMCAST_XMIT);
|
||||
|
||||
orte_rmcast.send_buffer_nb(ch, ORTE_RMCAST_TAG_CMD_ACK, ans, callback_fn, NULL);
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#ifndef ORTE_DB_DAEMON_H
|
||||
#define ORTE_DB_DAEMON_H
|
||||
|
||||
#include "orte/mca/db/db.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/*
|
||||
* Module open / close
|
||||
*/
|
||||
int orte_db_daemon_component_open(void);
|
||||
int orte_db_daemon_component_close(void);
|
||||
int orte_db_daemon_component_query(mca_base_module_t **module, int *priority);
|
||||
|
||||
|
||||
ORTE_MODULE_DECLSPEC extern orte_db_base_component_t mca_db_daemon_component;
|
||||
ORTE_DECLSPEC extern orte_db_base_module_t orte_db_daemon_module;
|
||||
extern char *orte_db_daemon_directory;
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif /* ORTE_DB_DAEMON_H */
|
@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
* These symbols are in a file by themselves to provide nice linker
|
||||
* semantics. Since linkers generally pull in symbols by object
|
||||
* files, keeping these symbols as the only symbols in this file
|
||||
* prevents utility programs such as "ompi_info" from having to import
|
||||
* entire components just to query their version and parameters.
|
||||
*/
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/constants.h"
|
||||
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "opal/mca/base/base.h"
|
||||
#include "opal/mca/base/mca_base_param.h"
|
||||
|
||||
#include "orte/util/proc_info.h"
|
||||
|
||||
#include "orte/mca/db/db.h"
|
||||
#include "orte/mca/db/base/base.h"
|
||||
#include "db_daemon.h"
|
||||
|
||||
extern orte_db_base_module_t orte_db_daemon_module;
|
||||
char *orte_db_daemon_directory;
|
||||
|
||||
/*
|
||||
* Instantiate the public struct with all of our public information
|
||||
* and pointers to our public functions in it
|
||||
*/
|
||||
orte_db_base_component_t mca_db_daemon_component = {
|
||||
{
|
||||
ORTE_DB_BASE_VERSION_1_0_0,
|
||||
|
||||
/* Component name and version */
|
||||
"daemon",
|
||||
ORTE_MAJOR_VERSION,
|
||||
ORTE_MINOR_VERSION,
|
||||
ORTE_RELEASE_VERSION,
|
||||
|
||||
/* Component open and close functions */
|
||||
orte_db_daemon_component_open,
|
||||
orte_db_daemon_component_close,
|
||||
orte_db_daemon_component_query
|
||||
},
|
||||
{
|
||||
/* The component is checkpoint ready */
|
||||
MCA_BASE_METADATA_PARAM_CHECKPOINT
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int
|
||||
orte_db_daemon_component_open(void)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
||||
/* only select us if specifically requested */
|
||||
int orte_db_daemon_component_query(mca_base_module_t **module, int *priority)
|
||||
{
|
||||
char *req;
|
||||
|
||||
if (NULL != (req = getenv("OMPI_MCA_db"))) {
|
||||
if (0 == strcasecmp(req, "daemon")) {
|
||||
*priority = 100;
|
||||
*module = (mca_base_module_t*)&orte_db_daemon_module;
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
*priority = 0;
|
||||
*module = NULL;
|
||||
return ORTE_ERROR;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
orte_db_daemon_component_close(void)
|
||||
{
|
||||
return ORTE_SUCCESS;
|
||||
}
|
||||
|
110
orte/mca/db/db.h
110
orte/mca/db/db.h
@ -1,110 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/** @file:
|
||||
*
|
||||
* The OpenRTE State Save/Recovery Service
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef ORTE_DB_H
|
||||
#define ORTE_DB_H
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/types.h"
|
||||
|
||||
#include "opal/mca/mca.h"
|
||||
#include "opal/dss/dss_types.h"
|
||||
|
||||
BEGIN_C_DECLS
|
||||
|
||||
/*
|
||||
* API functions
|
||||
*/
|
||||
|
||||
typedef uint8_t orte_db_cmd_t;
|
||||
#define ORTE_DB_CMD_T OPAL_UINT8
|
||||
|
||||
#define ORTE_DB_STORE_CMD 0x01
|
||||
#define ORTE_DB_FETCH_CMD 0X02
|
||||
#define ORTE_DB_UPDATE_CMD 0x03
|
||||
#define ORTE_DB_REMOVE_CMD 0x04
|
||||
|
||||
/*
|
||||
* Initialize the module
|
||||
*/
|
||||
typedef int (*orte_db_base_module_init_fn_t)(void);
|
||||
|
||||
/*
|
||||
* Finalize the module
|
||||
*/
|
||||
typedef int (*orte_db_base_module_finalize_fn_t)(void);
|
||||
|
||||
/*
|
||||
* Save the db of the provided object
|
||||
*/
|
||||
typedef int (*orte_db_base_module_store_fn_t)(char *key, void *object, opal_data_type_t type);
|
||||
|
||||
/*
|
||||
* Set the source for recovering db info
|
||||
*/
|
||||
typedef int (*orte_db_base_module_set_source_fn_t)(orte_process_name_t *name);
|
||||
|
||||
/*
|
||||
* Retrieve data
|
||||
*/
|
||||
typedef int (*orte_db_base_module_fetch_fn_t)(char *key, void *object, opal_data_type_t type);
|
||||
|
||||
/*
|
||||
* Update data
|
||||
*/
|
||||
typedef int (*orte_db_base_module_update_fn_t)(char *key, void *object, opal_data_type_t type);
|
||||
|
||||
/*
|
||||
* Delete data
|
||||
*/
|
||||
typedef int (*orte_db_base_module_remove_fn_t)(char *key);
|
||||
|
||||
/*
|
||||
* 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_set_source_fn_t set_source;
|
||||
orte_db_base_module_fetch_fn_t fetch;
|
||||
orte_db_base_module_update_fn_t update;
|
||||
orte_db_base_module_remove_fn_t remove;
|
||||
};
|
||||
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;
|
||||
|
||||
/*
|
||||
* the standard component data structure
|
||||
*/
|
||||
struct orte_db_base_component_1_0_0_t {
|
||||
mca_base_component_t base_version;
|
||||
mca_base_component_data_t base_data;
|
||||
};
|
||||
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;
|
||||
|
||||
/*
|
||||
* Macro for use in components that are of type db
|
||||
*/
|
||||
#define ORTE_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 */
|
||||
|
||||
END_C_DECLS
|
||||
|
||||
#endif
|
@ -1,38 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
#
|
||||
# Additional copyrights may follow
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
sources = \
|
||||
db_dbase.h \
|
||||
db_dbase_component.c \
|
||||
db_dbase.c
|
||||
|
||||
# Make the output library in this directory, and name it either
|
||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||
# (for static builds).
|
||||
|
||||
if MCA_BUILD_orte_db_dbase_DSO
|
||||
component_noinst =
|
||||
component_install = mca_db_dbase.la
|
||||
else
|
||||
component_noinst = libmca_db_dbase.la
|
||||
component_install =
|
||||
endif
|
||||
|
||||
mcacomponentdir = $(pkglibdir)
|
||||
mcacomponent_LTLIBRARIES = $(component_install)
|
||||
mca_db_dbase_la_CPPFLAGS = $(db_dbase_CPPFLAGS)
|
||||
mca_db_dbase_la_SOURCES = $(sources)
|
||||
mca_db_dbase_la_LDFLAGS = -module -avoid-version $(db_dbase_LDFLAGS)
|
||||
mca_db_dbase_la_LIBADD = $(db_dbase_LIBS)
|
||||
|
||||
noinst_LTLIBRARIES = $(component_noinst)
|
||||
libmca_db_dbase_la_CPPFLAGS = $(db_dbase_CPPFLAGS)
|
||||
libmca_db_dbase_la_SOURCES =$(sources)
|
||||
libmca_db_dbase_la_LDFLAGS = -module -avoid-version $(db_dbase_LDFLAGS)
|
||||
libmca_db_dbase_la_LIBADD = $(db_dbase_LIBS)
|
@ -1,30 +0,0 @@
|
||||
dnl -*- shell-script -*-
|
||||
dnl
|
||||
dnl Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
dnl $COPYRIGHT$
|
||||
dnl
|
||||
dnl Additional copyrights may follow
|
||||
dnl
|
||||
dnl $HEADER$
|
||||
dnl
|
||||
|
||||
# MCA_db_dbase_CONFIG([action-if-found], [action-if-not-found])
|
||||
# -----------------------------------------------------------
|
||||
AC_DEFUN([MCA_orte_db_dbase_CONFIG], [
|
||||
AC_CONFIG_FILES([orte/mca/db/dbase/Makefile])
|
||||
|
||||
# only build if db.h and its corresponding library are found
|
||||
OMPI_CHECK_PACKAGE([db_db],
|
||||
[db.h],
|
||||
[db],
|
||||
[dbopen],
|
||||
[],
|
||||
[],
|
||||
[],
|
||||
[$1],
|
||||
[$2])])
|
||||
|
||||
AC_SUBST(db_dbase_CPPFLAGS)
|
||||
AC_SUBST(db_dbase_LDFLAGS)
|
||||
AC_SUBST(db_dbase_LIBS)
|
||||
])dnl
|
@ -1,224 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
*
|
||||
* Additional copyrights may follow
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "orte_config.h"
|
||||
#include "orte/constants.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <db.h>
|
||||
|
||||
#include "opal/dss/dss_types.h"
|
||||
#include "opal/util/os_dirpath.h"
|
||||
#include "opal/util/os_path.h"
|
||||
#include "opal/util/output.h"
|
||||
#include "opal/util/malloc.h"
|
||||
#include "opal/util/basename.h"
|
||||
#include "opal/mca/pstat/base/base.h"
|
||||
#include "opal/mca/paffinity/base/base.h"
|
||||
#include "opal/mca/sysinfo/base/base.h"
|
||||
|
||||
#include "orte/util/show_help.h"
|
||||
#include "orte/mca/errmgr/base/base.h"
|
||||
#include "orte/runtime/orte_globals.h"
|
||||
|
||||
#include "db_dbase.h"
|
||||
|
||||
static int init(void);
|
||||