1
1

Remove all remnants of the component framework "registry".

Registry is dead; long live gpr!

This commit was SVN r1359.
Этот коммит содержится в:
Jeff Squyres 2004-06-17 13:53:10 +00:00
родитель a0472f7f5a
Коммит 1b542d409b
22 изменённых файлов: 4 добавлений и 754 удалений

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

@ -43,7 +43,7 @@ unset msg
# The list of MCA types (it's fixed)
AC_MSG_CHECKING([for MCA types])
found_types="allocator coll common io gpr mpool oob one pcm pml ptl registry topo"
found_types="allocator coll common io gpr mpool oob one pcm pml ptl topo"
AC_MSG_RESULT([$found_types])
# Get the list of all the non-configure MCA modules that were found by
@ -252,11 +252,6 @@ AC_SUBST(MCA_gpr_STATIC_SUBDIRS)
AC_SUBST(MCA_gpr_DYNAMIC_SUBDIRS)
AC_SUBST(MCA_gpr_STATIC_LTLIBS)
AC_SUBST(MCA_registry_ALL_SUBDIRS)
AC_SUBST(MCA_registry_STATIC_SUBDIRS)
AC_SUBST(MCA_registry_DYNAMIC_SUBDIRS)
AC_SUBST(MCA_registry_STATIC_LTLIBS)
# MPI types
AC_SUBST(MCA_allocator_ALL_SUBDIRS)

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

@ -822,8 +822,6 @@ AC_CONFIG_FILES([
src/mca/oob/base/Makefile
src/mca/pcm/Makefile
src/mca/pcm/base/Makefile
src/mca/registry/Makefile
src/mca/registry/base/Makefile
src/mca/allocator/Makefile
src/mca/allocator/base/Makefile
@ -847,7 +845,6 @@ AC_CONFIG_FILES([
src/dynamic-mca/oob/Makefile
src/dynamic-mca/pcm/Makefile
src/dynamic-mca/registry/Makefile
src/dynamic-mca/Makefile
src/dynamic-mca/allocator/Makefile

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

@ -15,8 +15,7 @@ SUBDIRS = \
pcm \
pml \
ptl \
topo \
registry
topo
# JMS Temporary hack to make "make dist" function properly; directories
# mentioned here will eventually be moved into SUBDIRS
DIST_SUBDIRS = $(SUBDIRS) gpr

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

@ -1,14 +0,0 @@
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
SUBDIRS = $(MCA_registry_DYNAMIC_SUBDIRS)
DISTCLEANFILES = $(SUBDIRS)
# Every directory under here is a sym link to something in the main
# share/ssi tree. Hence, we don't want to distribute anything under
# here.
DIST_SUBDIRS =

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

@ -16,8 +16,7 @@ SUBDIRS = \
pcm \
pml \
ptl \
topo \
registry
topo
# JMS Temporary hack to make "make dist" function properly; directories
# mentioned here will eventually be moved into SUBDIRS
DIST_SUBDIRS = $(SUBDIRS) gpr
@ -39,8 +38,7 @@ libmca_la_LIBADD = \
oob/libmca_oob.la \
pcm/libmca_pcm.la \
pml/libmca_pml.la \
ptl/libmca_ptl.la \
registry/libmca_registry.la
ptl/libmca_ptl.la
libmca_la_DEPENDENCIES = $(libmca_la_LIBADD)
not_implemented_yet = \

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

@ -1,31 +0,0 @@
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
SUBDIRS = base $(MCA_registry_STATIC_SUBDIRS)
DIST_SUBDIRS = base $(MCA_registry_ALL_SUBDIRS)
noinst_LTLIBRARIES = libmca_registry.la
# Source code files
headers = registry.h
# Library
libmca_registry_la_SOURCES = $(headers)
libmca_registry_la_LIBADD = \
$(MCA_registry_STATIC_LTLIBS) \
base/libmca_registry_base.la
libmca_registry_la_DEPENDENCIES = $(libmca_registry_la_LIBADD)
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(includedir)/ompi/mca/registry
ompi_HEADERS = $(headers)
else
ompidir = $(includedir)
endif

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

@ -1,33 +0,0 @@
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
noinst_LTLIBRARIES = libmca_registry_base.la
# For VPATH builds, have to specify where static-modules.h will be found
AM_CPPFLAGS = -I$(top_builddir)/src
# Source code files
headers = \
base.h
# Library
libmca_registry_base_la_SOURCES = \
$(headers) \
registry_base_close.c \
registry_base_open.c \
registry_base_select.c
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(includedir)/ompi/mca/registry/base
ompi_HEADERS = $(headers)
else
ompidir = $(includedir)
endif

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

@ -1,43 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*/
#ifndef MCA_REGISTRY_BASE_H_
#define MCA_REGISTRY_BASE_H_
#include "ompi_config.h"
#include "mca/mca.h"
#include "mca/registry/registry.h"
/*
* Global functions for MCA overall collective open and close
*/
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
int mca_registry_base_open(void);
int mca_registry_base_select(bool *allow_multi_user_threads,
bool *have_hidden_threads);
int mca_registry_base_close(void);
bool mca_registry_base_is_checkpointable(void);
int mca_registry_base_checkpoint(void);
int mca_registry_base_continue(void);
int mca_registry_base_restart(void);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
/*
* Global struct holding the selected module's function pointers
*/
extern int mca_registry_base_output;
extern ompi_list_t mca_registry_base_modules_available;
extern mca_registry_base_module_t mca_registry_base_selected_module;
extern mca_registry_t mca_registry;
#endif

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

@ -1,27 +0,0 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "include/constants.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/registry/registry.h"
#include "mca/registry/base/base.h"
int mca_registry_base_close(void)
{
/* Close all remaining available modules (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is ompi_info) */
mca_base_modules_close(mca_registry_base_output,
&mca_registry_base_modules_available, NULL);
/* All done */
return OMPI_SUCCESS;
}

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

@ -1,48 +0,0 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/registry/registry.h"
#include "mca/registry/base/base.h"
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
* module's public mca_base_module_t struct.
*/
#include "mca/registry/base/static-modules.h"
/*
* Global variables
*/
int mca_registry_base_output = -1;
mca_registry_t mca_registry;
ompi_list_t mca_registry_base_modules_available;
mca_registry_base_module_t mca_registry_base_selected_module;
/**
* Function for finding and opening either all MCA modules, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_registry_base_open(void)
{
/* Open up all available modules */
if (OMPI_SUCCESS !=
mca_base_modules_open("registry", 0, mca_registry_base_static_modules,
&mca_registry_base_modules_available)) {
return OMPI_ERROR;
}
/* All done */
return OMPI_SUCCESS;
}

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

@ -1,129 +0,0 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "runtime/runtime.h"
#include "util/output.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/registry/registry.h"
#include "mca/registry/base/base.h"
/**
* Function for selecting one module from all those that are
* available.
*
* Call the init function on all available modules and get their
* priorities. Select the module with the highest priority. All
* other modules will be closed and unloaded.
*/
int mca_registry_base_select(bool *allow_multi_user_threads,
bool *have_hidden_threads)
{
int priority, best_priority;
bool user_threads, hidden_threads;
bool best_user_threads, best_hidden_threads;
ompi_list_item_t *item;
mca_base_module_list_item_t *mli;
mca_registry_base_module_t *module, *best_module;
mca_registry_t *actions, *best_actions;
extern ompi_list_t mca_registry_base_modules_available;
/* Traverse the list of available modules; call their init
functions. */
best_priority = -1;
best_module = NULL;
for (item = ompi_list_get_first(&mca_registry_base_modules_available);
ompi_list_get_end(&mca_registry_base_modules_available) != item;
item = ompi_list_get_next(item)) {
mli = (mca_base_module_list_item_t *) item;
module = (mca_registry_base_module_t *) mli->mli_module;
ompi_output_verbose(10, mca_registry_base_output,
"select: initializing %s module %s",
module->registrym_version.mca_type_name,
module->registrym_version.mca_module_name);
if (NULL == module->registrym_init) {
ompi_output_verbose(10, mca_registry_base_output,
"select: no init function; ignoring module");
} else {
actions = module->registrym_init(&priority, &user_threads,
&hidden_threads);
if (NULL == actions) {
ompi_output_verbose(10, mca_registry_base_output,
"select: init returned failure");
} else {
ompi_output_verbose(10, mca_registry_base_output,
"select: init returned priority %d", priority);
if (priority > best_priority) {
best_priority = priority;
best_user_threads = user_threads;
best_hidden_threads = hidden_threads;
best_module = module;
best_actions = actions;
}
}
}
}
/* Finished querying all modules. Check for the bozo case. */
if (NULL == best_module) {
/* JMS Replace with show_help */
ompi_abort(1, "No REGISTRY module available. This shouldn't happen.");
}
/* Finalize all non-selected modules */
for (item = ompi_list_get_first(&mca_registry_base_modules_available);
ompi_list_get_end(&mca_registry_base_modules_available) != item;
item = ompi_list_get_next(item)) {
mli = (mca_base_module_list_item_t *) item;
module = (mca_registry_base_module_t *) mli->mli_module;
if (module != best_module) {
/* Finalize */
if (NULL != module->registrym_finalize) {
/* Blatently ignore the return code (what would we do to
recover, anyway? This module is going away, so errors
don't matter anymore) */
module->registrym_finalize();
ompi_output_verbose(10, mca_registry_base_output,
"select: module %s finalized",
module->registrym_version.mca_module_name);
}
}
}
/* This base function closes, unloads, and removes from the
available list all unselected modules. The available list will
contain only the selected module. */
mca_base_modules_close(mca_registry_base_output,
&mca_registry_base_modules_available,
(mca_base_module_t *) best_module);
/* Save the winner */
mca_registry_base_selected_module = *best_module;
mca_registry = *best_actions;
*allow_multi_user_threads = best_user_threads;
*have_hidden_threads = best_hidden_threads;
ompi_output_verbose(10, mca_registry_base_output,
"select: module %s initialized",
module->registrym_version.mca_module_name);
/* All done */
return OMPI_SUCCESS;
}

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

@ -1,37 +0,0 @@
# -*- makefile -*-
#
# $HEADER$
#
# Use the top-level OMPI Makefile.options
include $(top_ompi_srcdir)/config/Makefile.options
SUBDIRS = src
EXTRA_DIST = VERSION
# According to the MCA spec, we have to make the output library here
# in the top-level directory, and it has to be named
# libompi_ssi_coll_ompi_basic.la
if OMPI_BUILD_registry_cofs_LOADABLE_MODULE
module_noinst =
module_install = mca_registry_cofs.la
else
module_noinst = libmca_registry_cofs.la
module_install =
endif
mcamoduledir = $(libdir)/ompi
mcamodule_LTLIBRARIES = $(module_install)
mca_registry_cofs_la_SOURCES =
mca_registry_cofs_la_LIBADD = \
src/libmca_registry_cofs.la \
$(LIBOMPI_LA)
mca_registry_cofs_la_LDFLAGS = -module -avoid-version
noinst_LTLIBRARIES = $(module_noinst)
libmca_registry_cofs_la_SOURCES =
libmca_registry_cofs_la_LIBADD = src/libmca_registry_cofs.la
libmca_registry_cofs_la_LDFLAGS = -module -avoid-version

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

@ -1,6 +0,0 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

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

@ -1,9 +0,0 @@
# -*- shell-script -*-
#
# $HEADER$
#
# Specific to this module
PARAM_INIT_FILE=src/registry_cofs.c
PARAM_CONFIG_FILES="Makefile src/Makefile"

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

@ -1,17 +0,0 @@
#
# $HEADER$
#
include $(top_ompi_srcdir)/config/Makefile.options
AM_CPPFLAGS = \
-I$(top_ompi_builddir)/src/include \
-I$(top_ompi_srcdir)/src \
-I$(top_ompi_srcdir)/src/include
noinst_LTLIBRARIES = libmca_registry_cofs.la
libmca_registry_cofs_la_SOURCES = \
registry_cofs.h \
registry_cofs_module.c \
registry_cofs.c

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

@ -1,37 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "mca/registry/registry.h"
#include "mca/registry/cofs/src/registry_cofs.h"
#include "types.h"
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
#include <unistd.h>
int
mca_registry_cofs_publish(char* key, void* data, size_t data_len)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
mca_registry_cofs_lookup(char* key, void** data, size_t* data_len)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
mca_registry_cofs_unpublish(char* key)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}

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

@ -1,35 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "mca/registry/registry.h"
#include "types.h"
/*
* Module open / close
*/
int mca_registry_cofs_open(void);
int mca_registry_cofs_close(void);
/*
* Startup / Shutdown
*/
struct mca_registry_1_0_0_t*
mca_registry_cofs_init(int *priority, bool *allow_multi_user_threads,
bool *have_hidden_user_threads);
int mca_registry_cofs_finalize(void);
/*
* "Action" functions
*/
int mca_registry_cofs_publish(char* key, void* data, size_t data_len);
int mca_registry_cofs_lookup(char* key, void** data, size_t* data_len);
int mca_registry_cofs_unpublish(char* key);
extern char mca_registry_cofs_comm_loc[OMPI_PATH_MAX]; /* location for file drop-off */
extern int mca_registry_cofs_my_vpid;

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

@ -1,126 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "constants.h"
#include "mca/mca.h"
#include "mca/registry/registry.h"
#include "mca/registry/cofs/src/registry_cofs.h"
#include "types.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/*
* Struct of function pointers and all that to let us be initialized
*/
mca_registry_base_module_1_0_0_t mca_registry_cofs_module = {
{
MCA_REGISTRY_BASE_VERSION_1_0_0,
"cofs", /* MCA module name */
1, /* MCA module major version */
0, /* MCA module minor version */
0, /* MCA module release version */
mca_registry_cofs_open, /* module open */
mca_registry_cofs_close /* module close */
},
{
false /* checkpoint / restart */
},
mca_registry_cofs_init, /* module init */
mca_registry_cofs_finalize
};
struct mca_registry_1_0_0_t mca_registry_cofs_1_0_0 = {
mca_registry_cofs_publish,
mca_registry_cofs_lookup,
mca_registry_cofs_unpublish
};
char mca_registry_cofs_comm_loc[OMPI_PATH_MAX];
int mca_registry_cofs_my_vpid;
int
mca_registry_cofs_open(void)
{
return OMPI_SUCCESS;
}
int
mca_registry_cofs_close(void)
{
return OMPI_SUCCESS;
}
struct mca_registry_1_0_0_t*
mca_registry_cofs_init(int *priority, bool *allow_multi_user_threads,
bool *have_hidden_user_threads)
{
char *tmp;
FILE *fp;
*priority = 0;
*allow_multi_user_threads = true;
*have_hidden_user_threads = false;
/*
* BWB - fix me, make register the "right" way...
*/
tmp = getenv("MCA_common_ompi_cofs_comm_dir");
if (tmp == NULL) {
/* make it $HOME */
tmp = getenv("HOME");
if (tmp == NULL) {
printf("registry_cofs can not find communication dir\n");
return NULL;
}
snprintf(mca_registry_cofs_comm_loc, OMPI_PATH_MAX, "%s/cofs", tmp);
} else {
snprintf(mca_registry_cofs_comm_loc, OMPI_PATH_MAX, "%s", tmp);
}
/*
* See if we can write in our directory...
*/
tmp = malloc(strlen(mca_registry_cofs_comm_loc) + 5);
if (tmp == NULL) return NULL;
sprintf(tmp, "%s/me", mca_registry_cofs_comm_loc);
fp = fopen(tmp, "w");
if (fp == NULL) {
printf("registry_cofs can not write in communication dir\n");
free(tmp);
return NULL;
}
fclose(fp);
unlink(tmp);
free(tmp);
/*
* BWB - fix me, make register the "right" way...
*/
/* find our vpid */
tmp = getenv("MCA_common_ompi_cofs_my_vpid");
if (tmp == NULL) {
printf("registry_cofs can not find vpid\n");
return NULL;
}
mca_registry_cofs_my_vpid = atoi(tmp);
return &mca_registry_cofs_1_0_0;
}
int
mca_registry_cofs_finalize(void)
{
return OMPI_SUCCESS;
}

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

@ -1,125 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*/
/** @file **/
/**
* \brief Publish/Subscribe-style global registry database infrastructure
*
* OMPI/MPI provides a global publish/subscribe-style registry database
* for use in both OMPI and MPI layers. Data is stored in a flat
* key=value style database; keys are of type char* and value of type
* void*. No endian correction is performed on the data.
*
* The registry is implemented as an mca module, using the services
* provided by the current run-time environment. In environments with
* limited native out of band message passing and global registry
* infrastructure, this data may be stored in the MPI applications
* themselves. Care should therefore be used when storing potentially
* large amounts of data in the global registry.
*
* Locality of stored data is unspecified and unknown to the calling
* application. The underlying mca module is free to store data
* wherever practical. A high quality implementation will provide
* replication in case of process failure.
*/
#ifndef MCA_REGISTRY_H_
#define MCA_REGISTRY_H_
#include "ompi_config.h"
#include "mca/mca.h"
/*
* Functions every module instance will have to provide
*/
typedef struct mca_registry_1_0_0_t*
(*mca_registry_base_init_fn_t)(int *priority, bool *allow_multi_user_threads,
bool *have_hidden_threads);
/**
* Publish a key=value piece of information
*
* @param key Character string containing the key
* @param data Pointer to value data
* @param data_len Length of data buffer
*
* @retval 0 Update succeeded
* @retval
*
* Add key=value pair to the global registry. Will overwrite any
* existing data for the specified key (if it is already in use).
* Atomicity of the publish is guaranteed - the registry does not
* have to be locked for a publish to occur safely.
*
* \warning May block if the registry entry for key is currently
* locked by another process.
*/
typedef int (*mca_registry_base_publish_fn_t)(char* key, void* data, size_t data_len);
/**
* Get the value for given key
*
* @param key String containing key to search on
* @param data Pointer to a void* pointer to store data
* @param datalen Pointer to size_t containing length of data
*
* @retval 0 Key was found and data successfully obtained
* @retval ENOMATCH No such key was found in the database
* @retval ENOMEM Could not allocate enough memory for data
*
* Search for the given key, downloading the corresponding value
* into the pointer *data if the key exists. *data will point to
* the data buffer and data_len will contain the buffer length if
* the value could be obtained. On error, *data will be NULL and
* data_len will be 0.
*
* \warning Returned buffer was allocated via ompi_malloc and must be
* freed by the caller using ompi_free.
*
* \warning May block if the registry entry for key is currently
* locked by another process.
*/
typedef int (*mca_registry_base_lookup_fn_t)(char* key, void** data, size_t* data_len);
typedef int (*mca_registry_base_unpublish_fn_t)(char* key);
typedef int (*mca_registry_base_finalize_fn_t)(void);
/*
* Ver 1.0.0
*/
struct mca_registry_base_module_1_0_0_t {
mca_base_module_t registrym_version;
mca_base_module_data_1_0_0_t registrym_data;
mca_registry_base_init_fn_t registrym_init;
mca_registry_base_finalize_fn_t registrym_finalize;
};
typedef struct mca_registry_base_module_1_0_0_t mca_registry_base_module_1_0_0_t;
struct mca_registry_1_0_0_t {
mca_registry_base_publish_fn_t registry_publish;
mca_registry_base_lookup_fn_t registry_lookup;
mca_registry_base_unpublish_fn_t registry_unpublish;
};
typedef struct mca_registry_1_0_0_t mca_registry_1_0_0_t;
typedef mca_registry_base_module_1_0_0_t mca_registry_base_module_t;
typedef mca_registry_1_0_0_t mca_registry_t;
/*
* Macro for use in modules that are of type registry v1.0.0
*/
#define MCA_REGISTRY_BASE_VERSION_1_0_0 \
/* registry v1.0 is chained to MCA v1.0 */ \
MCA_BASE_VERSION_1_0_0, \
/* registry v1.0 */ \
"registry", 1, 0, 0
#endif

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

@ -12,7 +12,6 @@
#include "threads/mutex.h"
#include "mca/pcm/base/base.h"
#include "mca/oob/base/base.h"
#include "mca/registry/base/base.h"
/**
@ -25,7 +24,6 @@
*/
int ompi_rte_finalize(void)
{
mca_registry_base_close();
mca_oob_base_close();
mca_pcm_base_close();

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

@ -12,7 +12,6 @@
#include "threads/mutex.h"
#include "mca/pcm/base/base.h"
#include "mca/oob/base/base.h"
#include "mca/registry/base/base.h"
/**
@ -57,18 +56,6 @@ int ompi_rte_init(bool *allow_multi_user_threads, bool *have_hidden_threads)
*allow_multi_user_threads |= user_threads;
*have_hidden_threads |= hidden_threads;
if (OMPI_SUCCESS != (ret = mca_registry_base_open())) {
/* JMS show_help */
return ret;
}
if (OMPI_SUCCESS != (ret = mca_registry_base_select(&user_threads,
&hidden_threads))) {
/* JMS show_help */
return ret;
}
*allow_multi_user_threads |= user_threads;
*have_hidden_threads |= hidden_threads;
#if 0
/*
* BWB - this comment should be removed at some point in the very

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

@ -15,8 +15,6 @@
#include "mca/pcm/base/base.h"
#include "mca/oob/oob.h"
#include "mca/oob/base/base.h"
#include "mca/registry/registry.h"
#include "mca/registry/base/base.h"
#include "mca/pml/pml.h"
#include "mca/pml/base/base.h"
#include "mca/ptl/ptl.h"
@ -84,10 +82,6 @@ void ompi_info::open_modules()
mca_oob_base_open();
module_map["oob"] = &mca_oob_base_modules_available;
// registry module opening not implemented yet
mca_registry_base_open();
module_map["registry"] = &mca_registry_base_modules_available;
// coll module opening not implemented yet
mca_coll_base_open();
module_map["coll"] = &mca_coll_base_modules_opened;
@ -135,7 +129,6 @@ void ompi_info::close_modules()
if (opened_modules) {
mca_pcm_base_close();
mca_oob_base_close();
mca_registry_base_close();
mca_coll_base_close();
mca_pml_base_close();
mca_ptl_base_close();