1
1

Add general purpose registry code - not ready for use yet, but this won't hurt anyone since it isn't linked into anything yet.

This commit was SVN r1187.
Этот коммит содержится в:
Ralph Castain 2004-06-04 02:27:19 +00:00
родитель 9361dbf767
Коммит a22c39a0f5
5 изменённых файлов: 1655 добавлений и 1 удалений

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

@ -18,7 +18,9 @@ AM_CPPFLAGS = \
libs = $(top_builddir)/src/libmpi.la
bin_PROGRAMS = openmpi
bin_PROGRAMS = \
openmpi
openmpi_SOURCES = \
openmpi.h \
ompi_init.h \

38
src/rte/universe/registry/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,38 @@
# -*- makefile -*-
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
AM_CPPFLAGS = \
-DLAM_PREFIX="\"$(prefix)\"" \
-DLAM_BINDIR="\"$(bindir)\"" \
-DLAM_LIBDIR="\"$(libdir)\"" \
-DLAM_INCDIR="\"$(includedir)\"" \
-DLAM_PKGLIBDIR="\"$(pkglibdir)\"" \
-DLAM_SYSCONFDIR="\"$(sysconfdir)\"" \
-DLAM_CONFIGURE_USER="\"@LAM_CONFIGURE_USER@\"" \
-DLAM_CONFIGURE_HOST="\"@LAM_CONFIGURE_HOST@\"" \
-DLAM_CONFIGURE_DATE="\"@LAM_CONFIGURE_DATE@\""
libs = $(top_builddir)/src/libmpi.la
bin_PROGRAMS = \
registry
registry_SOURCES = \
registry.h \
registry.c
registry_LDADD = \
$(libs) \
$(LIBMPI_EXTRA_LIBS) \
$(LIBLAM_EXTRA_LIBS)
registry__DFLAGS = $(LIBMPI_EXTRA_LDFLAGS) $(LIBLAM_EXTRA_LDFLAGS)
registry_DEPENDENCIES = $(libs) \
$(registry_LDADD)
clean-local:
test -z "$(LAM_CXX_TEMPLATE_REPOSITORY)" || $(RM) -rf $(LAM_CXX_TEMPLATE_REPOSITORY)

623
src/rte/universe/registry/Makefile.in Обычный файл
Просмотреть файл

@ -0,0 +1,623 @@
# Makefile.in generated by automake 1.8.2 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# -*- makefile -*-
#
# $HEADER$
#
# -*- makefile -*-
#
# $HEADER$
#
SOURCES = $(registry_SOURCES)
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ../../../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_triplet = @host@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/config/Makefile.options
bin_PROGRAMS = registry$(EXEEXT)
subdir = src/rte/universe/registry
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/config/c_get_alignment.m4 \
$(top_srcdir)/config/c_weak_symbols.m4 \
$(top_srcdir)/config/cxx_find_template_parameters.m4 \
$(top_srcdir)/config/cxx_find_template_repository.m4 \
$(top_srcdir)/config/cxx_have_exceptions.m4 \
$(top_srcdir)/config/cxx_find_exception_flags.m4 \
$(top_srcdir)/config/f77_find_ext_symbol_convention.m4 \
$(top_srcdir)/config/f77_get_alignment.m4 \
$(top_srcdir)/config/f77_get_sizeof.m4 \
$(top_srcdir)/config/lam_case_sensitive_fs_setup.m4 \
$(top_srcdir)/config/lam_check_optflags.m4 \
$(top_srcdir)/config/lam_config_subdir.m4 \
$(top_srcdir)/config/lam_config_subdir_args.m4 \
$(top_srcdir)/config/lam_configure_options.m4 \
$(top_srcdir)/config/lam_functions.m4 \
$(top_srcdir)/config/lam_get_version.m4 \
$(top_srcdir)/config/lam_get_libtool_linker_flags.m4 \
$(top_srcdir)/config/lam_mca.m4 \
$(top_srcdir)/config/lam_setup_cc.m4 \
$(top_srcdir)/config/lam_setup_cxx.m4 \
$(top_srcdir)/config/lam_setup_f77.m4 \
$(top_srcdir)/config/lam_setup_f90.m4 \
$(top_srcdir)/config/lam_setup_libevent.m4 \
$(top_srcdir)/config/lam_check_pthread_pids.m4 \
$(top_srcdir)/config/lam_config_pthreads.m4 \
$(top_srcdir)/config/lam_config_solaris_threads.m4 \
$(top_srcdir)/config/lam_config_threads.m4 \
$(top_srcdir)/config/mca_no_configure_modules.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(mkdir_p)
CONFIG_HEADER = $(top_builddir)/include/lam_config.h
CONFIG_CLEAN_FILES =
am__installdirs = $(DESTDIR)$(bindir)
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_registry_OBJECTS = registry.$(OBJEXT)
registry_OBJECTS = $(am_registry_OBJECTS)
am__DEPENDENCIES_1 = $(top_builddir)/src/libmpi.la
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
depcomp = $(SHELL) $(top_srcdir)/./config/depcomp
am__depfiles_maybe = depfiles
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/registry.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
SOURCES = $(registry_SOURCES)
DIST_SOURCES = $(registry_SOURCES)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CASE_SENSITIVE_FS_FALSE = @CASE_SENSITIVE_FS_FALSE@
CASE_SENSITIVE_FS_TRUE = @CASE_SENSITIVE_FS_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CLEANFILES = @CLEANFILES@
COMPILE_PROFILING_SEPARATELY_FALSE = @COMPILE_PROFILING_SEPARATELY_FALSE@
COMPILE_PROFILING_SEPARATELY_TRUE = @COMPILE_PROFILING_SEPARATELY_TRUE@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXCPPFLAGS = @CXXCPPFLAGS@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO = @ECHO@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
F77 = @F77@
FC = @FC@
FCFLAGS = @FCFLAGS@
FCFLAGS_f = @FCFLAGS_f@
FCFLAGS_f90 = @FCFLAGS_f90@
FCFLAGS_f95 = @FCFLAGS_f95@
FFLAGS = @FFLAGS@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LAM_ALPHA_VERSION = @LAM_ALPHA_VERSION@
LAM_BETA_VERSION = @LAM_BETA_VERSION@
LAM_BUILD_coll_basic_LOADABLE_MODULE_FALSE = @LAM_BUILD_coll_basic_LOADABLE_MODULE_FALSE@
LAM_BUILD_coll_basic_LOADABLE_MODULE_TRUE = @LAM_BUILD_coll_basic_LOADABLE_MODULE_TRUE@
LAM_BUILD_io_romio_LOADABLE_MODULE_FALSE = @LAM_BUILD_io_romio_LOADABLE_MODULE_FALSE@
LAM_BUILD_io_romio_LOADABLE_MODULE_TRUE = @LAM_BUILD_io_romio_LOADABLE_MODULE_TRUE@
LAM_BUILD_oob_cofs_LOADABLE_MODULE_FALSE = @LAM_BUILD_oob_cofs_LOADABLE_MODULE_FALSE@
LAM_BUILD_oob_cofs_LOADABLE_MODULE_TRUE = @LAM_BUILD_oob_cofs_LOADABLE_MODULE_TRUE@
LAM_BUILD_pcm_cofs_LOADABLE_MODULE_FALSE = @LAM_BUILD_pcm_cofs_LOADABLE_MODULE_FALSE@
LAM_BUILD_pcm_cofs_LOADABLE_MODULE_TRUE = @LAM_BUILD_pcm_cofs_LOADABLE_MODULE_TRUE@
LAM_BUILD_pcm_rsh_LOADABLE_MODULE_FALSE = @LAM_BUILD_pcm_rsh_LOADABLE_MODULE_FALSE@
LAM_BUILD_pcm_rsh_LOADABLE_MODULE_TRUE = @LAM_BUILD_pcm_rsh_LOADABLE_MODULE_TRUE@
LAM_BUILD_pml_teg_LOADABLE_MODULE_FALSE = @LAM_BUILD_pml_teg_LOADABLE_MODULE_FALSE@
LAM_BUILD_pml_teg_LOADABLE_MODULE_TRUE = @LAM_BUILD_pml_teg_LOADABLE_MODULE_TRUE@
LAM_BUILD_ptl_tcp_LOADABLE_MODULE_FALSE = @LAM_BUILD_ptl_tcp_LOADABLE_MODULE_FALSE@
LAM_BUILD_ptl_tcp_LOADABLE_MODULE_TRUE = @LAM_BUILD_ptl_tcp_LOADABLE_MODULE_TRUE@
LAM_BUILD_registry_cofs_LOADABLE_MODULE_FALSE = @LAM_BUILD_registry_cofs_LOADABLE_MODULE_FALSE@
LAM_BUILD_registry_cofs_LOADABLE_MODULE_TRUE = @LAM_BUILD_registry_cofs_LOADABLE_MODULE_TRUE@
LAM_BUILD_topo_unity_LOADABLE_MODULE_FALSE = @LAM_BUILD_topo_unity_LOADABLE_MODULE_FALSE@
LAM_BUILD_topo_unity_LOADABLE_MODULE_TRUE = @LAM_BUILD_topo_unity_LOADABLE_MODULE_TRUE@
LAM_CONFIGURE_DATE = @LAM_CONFIGURE_DATE@
LAM_CONFIGURE_HOST = @LAM_CONFIGURE_HOST@
LAM_CONFIGURE_USER = @LAM_CONFIGURE_USER@
LAM_CVS_VERSION = @LAM_CVS_VERSION@
LAM_LIBEVENT_SOURCES = @LAM_LIBEVENT_SOURCES@
LAM_MAJOR_VERSION = @LAM_MAJOR_VERSION@
LAM_MINOR_VERSION = @LAM_MINOR_VERSION@
LAM_RELEASE_VERSION = @LAM_RELEASE_VERSION@
LAM_TOP_BUILDDIR = @LAM_TOP_BUILDDIR@
LAM_TOP_SRCDIR = @LAM_TOP_SRCDIR@
LAM_VERSION = @LAM_VERSION@
LAM_WANT_F77_BINDINGS_FALSE = @LAM_WANT_F77_BINDINGS_FALSE@
LAM_WANT_F77_BINDINGS_TRUE = @LAM_WANT_F77_BINDINGS_TRUE@
LAM_WANT_F90_BINDINGS_FALSE = @LAM_WANT_F90_BINDINGS_FALSE@
LAM_WANT_F90_BINDINGS_TRUE = @LAM_WANT_F90_BINDINGS_TRUE@
LDFLAGS = @LDFLAGS@
LIBLTDL = @LIBLTDL@
LIBLTDL_LTLIB = @LIBLTDL_LTLIB@
LIBLTDL_SUBDIR = @LIBLTDL_SUBDIR@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
LTDLINCL = @LTDLINCL@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MCA_coll_ALL_SUBDIRS = @MCA_coll_ALL_SUBDIRS@
MCA_coll_DYNAMIC_SUBDIRS = @MCA_coll_DYNAMIC_SUBDIRS@
MCA_coll_STATIC_LTLIBS = @MCA_coll_STATIC_LTLIBS@
MCA_coll_STATIC_SUBDIRS = @MCA_coll_STATIC_SUBDIRS@
MCA_io_ALL_SUBDIRS = @MCA_io_ALL_SUBDIRS@
MCA_io_DYNAMIC_SUBDIRS = @MCA_io_DYNAMIC_SUBDIRS@
MCA_io_STATIC_LTLIBS = @MCA_io_STATIC_LTLIBS@
MCA_io_STATIC_SUBDIRS = @MCA_io_STATIC_SUBDIRS@
MCA_one_ALL_SUBDIRS = @MCA_one_ALL_SUBDIRS@
MCA_one_DYNAMIC_SUBDIRS = @MCA_one_DYNAMIC_SUBDIRS@
MCA_one_STATIC_LTLIBS = @MCA_one_STATIC_LTLIBS@
MCA_one_STATIC_SUBDIRS = @MCA_one_STATIC_SUBDIRS@
MCA_oob_ALL_SUBDIRS = @MCA_oob_ALL_SUBDIRS@
MCA_oob_DYNAMIC_SUBDIRS = @MCA_oob_DYNAMIC_SUBDIRS@
MCA_oob_STATIC_LTLIBS = @MCA_oob_STATIC_LTLIBS@
MCA_oob_STATIC_SUBDIRS = @MCA_oob_STATIC_SUBDIRS@
MCA_pcm_ALL_SUBDIRS = @MCA_pcm_ALL_SUBDIRS@
MCA_pcm_DYNAMIC_SUBDIRS = @MCA_pcm_DYNAMIC_SUBDIRS@
MCA_pcm_STATIC_LTLIBS = @MCA_pcm_STATIC_LTLIBS@
MCA_pcm_STATIC_SUBDIRS = @MCA_pcm_STATIC_SUBDIRS@
MCA_pml_ALL_SUBDIRS = @MCA_pml_ALL_SUBDIRS@
MCA_pml_DYNAMIC_SUBDIRS = @MCA_pml_DYNAMIC_SUBDIRS@
MCA_pml_STATIC_LTLIBS = @MCA_pml_STATIC_LTLIBS@
MCA_pml_STATIC_SUBDIRS = @MCA_pml_STATIC_SUBDIRS@
MCA_ptl_ALL_SUBDIRS = @MCA_ptl_ALL_SUBDIRS@
MCA_ptl_DYNAMIC_SUBDIRS = @MCA_ptl_DYNAMIC_SUBDIRS@
MCA_ptl_STATIC_LTLIBS = @MCA_ptl_STATIC_LTLIBS@
MCA_ptl_STATIC_SUBDIRS = @MCA_ptl_STATIC_SUBDIRS@
MCA_registry_ALL_SUBDIRS = @MCA_registry_ALL_SUBDIRS@
MCA_registry_DYNAMIC_SUBDIRS = @MCA_registry_DYNAMIC_SUBDIRS@
MCA_registry_STATIC_LTLIBS = @MCA_registry_STATIC_LTLIBS@
MCA_registry_STATIC_SUBDIRS = @MCA_registry_STATIC_SUBDIRS@
MCA_topo_ALL_SUBDIRS = @MCA_topo_ALL_SUBDIRS@
MCA_topo_DYNAMIC_SUBDIRS = @MCA_topo_DYNAMIC_SUBDIRS@
MCA_topo_STATIC_LTLIBS = @MCA_topo_STATIC_LTLIBS@
MCA_topo_STATIC_SUBDIRS = @MCA_topo_STATIC_SUBDIRS@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
WANT_DEPRECATED_EXECUTABLE_NAMES_FALSE = @WANT_DEPRECATED_EXECUTABLE_NAMES_FALSE@
WANT_DEPRECATED_EXECUTABLE_NAMES_TRUE = @WANT_DEPRECATED_EXECUTABLE_NAMES_TRUE@
WANT_INSTALL_HEADERS_FALSE = @WANT_INSTALL_HEADERS_FALSE@
WANT_INSTALL_HEADERS_TRUE = @WANT_INSTALL_HEADERS_TRUE@
WANT_LIBLTDL_FALSE = @WANT_LIBLTDL_FALSE@
WANT_LIBLTDL_TRUE = @WANT_LIBLTDL_TRUE@
WANT_MPI_BINDINGS_LAYER_FALSE = @WANT_MPI_BINDINGS_LAYER_FALSE@
WANT_MPI_BINDINGS_LAYER_TRUE = @WANT_MPI_BINDINGS_LAYER_TRUE@
WANT_MPI_F77_BINDINGS_LAYER_FALSE = @WANT_MPI_F77_BINDINGS_LAYER_FALSE@
WANT_MPI_F77_BINDINGS_LAYER_TRUE = @WANT_MPI_F77_BINDINGS_LAYER_TRUE@
WANT_PMPI_BINDINGS_LAYER_FALSE = @WANT_PMPI_BINDINGS_LAYER_FALSE@
WANT_PMPI_BINDINGS_LAYER_TRUE = @WANT_PMPI_BINDINGS_LAYER_TRUE@
WANT_PMPI_F77_BINDINGS_LAYER_FALSE = @WANT_PMPI_F77_BINDINGS_LAYER_FALSE@
WANT_PMPI_F77_BINDINGS_LAYER_TRUE = @WANT_PMPI_F77_BINDINGS_LAYER_TRUE@
WRAPPER_EXTRA_CFLAGS = @WRAPPER_EXTRA_CFLAGS@
WRAPPER_EXTRA_CXXFLAGS = @WRAPPER_EXTRA_CXXFLAGS@
WRAPPER_EXTRA_FCFLAGS = @WRAPPER_EXTRA_FCFLAGS@
WRAPPER_EXTRA_FFLAGS = @WRAPPER_EXTRA_FFLAGS@
WRAPPER_EXTRA_LDFLAGS = @WRAPPER_EXTRA_LDFLAGS@
WRAPPER_EXTRA_LIBS = @WRAPPER_EXTRA_LIBS@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_F77 = @ac_ct_F77@
ac_ct_FC = @ac_ct_FC@
ac_ct_RANLIB = @ac_ct_RANLIB@
ac_ct_STRIP = @ac_ct_STRIP@
ac_prefix_program = @ac_prefix_program@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_lam_builddir = @top_lam_builddir@
top_lam_srcdir = @top_lam_srcdir@
AUTOMAKE_OPTIONS = foreign dist-bzip2
AM_CPPFLAGS = \
-DLAM_PREFIX="\"$(prefix)\"" \
-DLAM_BINDIR="\"$(bindir)\"" \
-DLAM_LIBDIR="\"$(libdir)\"" \
-DLAM_INCDIR="\"$(includedir)\"" \
-DLAM_PKGLIBDIR="\"$(pkglibdir)\"" \
-DLAM_SYSCONFDIR="\"$(sysconfdir)\"" \
-DLAM_CONFIGURE_USER="\"@LAM_CONFIGURE_USER@\"" \
-DLAM_CONFIGURE_HOST="\"@LAM_CONFIGURE_HOST@\"" \
-DLAM_CONFIGURE_DATE="\"@LAM_CONFIGURE_DATE@\""
libs = $(top_builddir)/src/libmpi.la
registry_SOURCES = \
registry.h \
registry.c
registry_LDADD = \
$(libs) \
$(LIBMPI_EXTRA_LIBS) \
$(LIBLAM_EXTRA_LIBS)
registry__DFLAGS = $(LIBMPI_EXTRA_LDFLAGS) $(LIBLAM_EXTRA_LDFLAGS)
registry_DEPENDENCIES = $(libs) \
$(registry_LDADD)
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/config/Makefile.options $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/rte/universe/registry/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign src/rte/universe/registry/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkdir_p) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
rm -f $(DESTDIR)$(bindir)/$$f; \
done
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
echo " rm -f $$p $$f"; \
rm -f $$p $$f ; \
done
registry$(EXEEXT): $(registry_OBJECTS) $(registry_DEPENDENCIES)
@rm -f registry$(EXEEXT)
$(LINK) $(registry_LDFLAGS) $(registry_OBJECTS) $(registry_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/registry.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
$(mkdir_p) $(distdir)/../../../../config
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
$(mkdir_p) $(DESTDIR)$(bindir)
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
-rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am:
install-exec-am: install-binPROGRAMS
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-info-am
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic clean-libtool clean-local ctags distclean \
distclean-compile distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
install-data-am install-exec install-exec-am install-info \
install-info-am install-man install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
uninstall-info-am
clean-local:
test -z "$(LAM_CXX_TEMPLATE_REPOSITORY)" || $(RM) -rf $(LAM_CXX_TEMPLATE_REPOSITORY)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

651
src/rte/universe/registry/registry.c Обычный файл
Просмотреть файл

@ -0,0 +1,651 @@
/*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry - implementation.
*
*/
/*
* includes
*/
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <libgen.h>
#include "lam_config.h"
#include "include/constants.h"
#include "rte/universe/registry/registry.h"
/*
* globals
*/
struct ompi_registry_t {
lam_list_t registry;
lam_list_t segment_dict;
unsigned long int lastkey;
lam_list_t freekeys;
};
typedef struct ompi_registry_t ompi_registry_t;
ompi_registry_t ompi_registry;
/*
* local type definitions
*/
/** List of keys that describe a stored object.
* Each object stored in the registry may have as many keys describing it as the
* creator desires. This structure is used to create a linked list of keys
* associated with each object.
*/
struct ompi_keylist_t {
lam_list_item_t item; /**< Allows this item to be placed on a list */
unsigned long int key; /**< Numerical key that defines stored object */
};
typedef struct ompi_keylist_t ompi_keylist_t;
/* constructor - used to initialize state of keytable instance */
static void ompi_keylist_construct(ompi_keylist_t* keylist)
{
keylist->key = 0;
}
/* destructor - used to free any resources held by instance */
static void ompi_keylist_destructor(ompi_keylist_t* keylist)
{
}
/* define instance of lam_class_t */
OBJ_CLASS_INSTANCE(
ompi_keylist_t, /* type name */
lam_list_item_t, /* parent "class" name */
ompi_keylist_construct, /* constructor */
ompi_keylist_destructor); /* destructor */
/** List of subscribers to a stored object.
* Each object can have an arbitrary number of subscribers desiring notification
* upon specified actions being performed against the object. This structure is
* used to create a linked list of subscribers for objects.
*/
struct ompi_subscribe_list_t {
lam_list_item_t item; /**< Allows this item to be placed on a list */
unsigned long int id; /**< ID of the subscriber */
uint8_t action; /**< Bit-mask of actions that trigger notification */
};
typedef struct ompi_subscribe_list_t ompi_subscribe_list_t;
/* constructor - used to initialize state of keytable instance */
static void ompi_subscribe_list_construct(ompi_subscribe_list_t* subscriber)
{
subscriber->id = 0;
subscriber->action = 0x00;
}
/* destructor - used to free any resources held by instance */
static void ompi_subscribe_list_destructor(ompi_subscribe_list_t* subscriber)
{
}
/* define instance of lam_class_t */
OBJ_CLASS_INSTANCE(
ompi_subscribe_list_t, /* type name */
lam_list_item_t, /* parent "class" name */
ompi_subscribe_list_construct, /* constructor */
ompi_subscribe_list_destructor); /* destructor */
/** The core registry structure.
* Each segment of the registry contains a linked list of registry entries. This structure
* represents a link in that list. The structure contains a linked list of the keys that
* define this particular object, the size of the object, a pointer to the object, and a linked
* list of subscribers to this object. Objects are stored as unsigned bytes - knowledge of any
* structure within the objects is the responsibility of the calling functions. The repository
* has no knowledge of what is in the structure, nor any way of determining such structure.
*
* At this time, no security is provided on an object-level basis. Thus, all requests for an
* object are automatically granted. This may be changed at some future time by adding an
* "authorization" linked list of ID's and their access rights to this structure.
*/
struct ompi_registry_core_t {
lam_list_item_t item; /**< Allows this item to be placed on a list */
lam_list_t keys; /**< Linked list of keys that define stored object */
int object_size; /**< Size of stored object, in bytes */
uint8_t *object; /**< Pointer to stored object */
lam_list_t subscriber; /**< Linked list of subscribers to this object */
};
typedef struct ompi_registry_core_t ompi_registry_core_t;
/* constructor - used to initialize state of keytable instance */
static void ompi_registry_core_construct(ompi_registry_core_t* reg)
{
reg->object = NULL;
reg->object_size = 0;
OBJ_CONSTRUCT(&reg->subscriber, lam_list_t);
OBJ_CONSTRUCT(&reg->keys, lam_list_t);
}
/* destructor - used to free any resources held by instance */
static void ompi_registry_core_destructor(ompi_registry_core_t* reg)
{
if (NULL != reg->object) {
free(reg->object);
}
OBJ_DESTRUCT(&reg->subscriber);
OBJ_DESTRUCT(&reg->keys);
}
/* define instance of lam_class_t */
OBJ_CLASS_INSTANCE(
ompi_registry_core_t, /* type name */
lam_list_item_t, /* parent "class" name */
ompi_registry_core_construct, /* constructor */
ompi_registry_core_destructor); /* destructor */
/** Registry segment definition.
* The registry is subdivided into segments, each defining a unique domain. The "universe" segment
* is automatically created to allow the exchange of information supporting universe-level functions.
* Similarly, a segment is automatically created for each MPI CommWorld within the universe - the
* name for that segment is stored in each CommWorld's ompi_system_info structure so program
* elements within that CommWorld can access it. The segment structure serves as the "head" of a linked
* list of registry elements for that segment. Each segment also holds its own token-key dictionary
* to avoid naming conflicts between tokens from CommWorlds sharing a given universe.
*/
struct ompi_registry_segment_t {
lam_list_item_t item; /**< Allows this item to be placed on a list */
unsigned long int segment; /**< ID of registry segment */
unsigned long int lastkey; /**< Highest key value used */
lam_list_t reg_list; /**< Linked list of stored objects within this segment */
lam_list_t keytable; /**< Token-key dictionary for this segment */
lam_list_t freekeys; /**< List of keys that have been made available */
};
typedef struct ompi_registry_segment_t ompi_registry_segment_t;
/* constructor - used to initialize state of segment instance */
static void ompi_registry_segment_construct(ompi_registry_segment_t* seg)
{
seg->segment = 0;
seg->lastkey = 0;
OBJ_CONSTRUCT(&seg->reg_list, lam_list_t);
OBJ_CONSTRUCT(&seg->keytable, lam_list_t);
OBJ_CONSTRUCT(&seg->freekeys, lam_list_t);
}
/* destructor - used to free any resources held by instance */
static void ompi_registry_segment_destructor(ompi_registry_segment_t* seg)
{
OBJ_DESTRUCT(&seg->reg_list);
OBJ_DESTRUCT(&seg->keytable);
OBJ_DESTRUCT(&seg->freekeys);
}
/* define instance of lam_class_t */
OBJ_CLASS_INSTANCE(
ompi_registry_segment_t, /* type name */
lam_list_item_t, /* parent "class" name */
ompi_registry_segment_construct, /* constructor */
ompi_registry_segment_destructor); /* destructor */
/*
* internal function prototypes
*/
/** Retrieve a registry key value for a given token string.
* The ompi_registry_getkey() function is used to translate a token string for a particular
* segment of the registry into its associated (integer) key value.
*
* @param segment Pointer to a character string defining the segment of the registry being queried.
* @param token Pointer to a character string containing the token to be translated. If token=NULL,
* the function returns the key value corresponding to the specified segment itself.
*
* @retval key Unsigned long integer value corresponding to the specified token within the specified segment.
* @retval -1 Indicates that the segment and/or token could not be found.
*/
unsigned long int ompi_registry_getkey(char *segment, char *token);
/** Add a token to a segment's dictionary.
* The ompi_registry_definekey() function allows the addition of a new definition to
* the registry's token-key dictionaries. The specified token is assigned an integer
* value within the specified segment, and the entry is added to the segment's token-key
* dictionary.
*
* @param segment Pointer to a character string defining the segment of the registry being queried.
* @param token Pointer to a character string containing the token to be defined. If token=NULL,
* the function adds the token to the segment dictionary, thus defining a new segment name.
*
* @retval key Unsigned long integer value corresponding to the specified token within the specified segment.
* @retval -1 Indicates that the entry could not be created.
*/
unsigned long int ompi_registry_definekey(char *segment, char *token);
/** Delete a token from a segment's dictionary.
* The ompi_registry_deletekey() function allows the removal of a definition from the
* registry's token-key dictionaries. This should be used with caution! Deletion of
* a token-key pair causes the registry to search through all entries within that segment
* for objects that include the specified token-key pair in their description. The reference
* is subsequently removed, and any object for which this was the SOLE key will also
* be removed from the registry!
*
* @param segment Pointer to a character string defining the segment of the registry.
* @param token Pointer to a character string containing the token to be deleted. If token=NULL,
* the function deletes the specified segment name from the segment dictionary.
*
* @retval LAM_SUCCESS Indicating that the operation was successful.
* @retval LAM_ERROR Indicates that the operation failed - most likely caused by specifying
* a token that did not exist within the specified segment, or a non-existent segment.
*/
int ompi_registry_deletekey(char *segment, char *token);
ompi_registry_segment_t *ompi_registry_findseg(char *segment);
ompi_keytable_t *ompi_registry_finddictentry(char *segment, char *token);
int main(int argc, char **argv)
{
/* ompi_keytable_t *keytable;
ompi_registry_core_t *reg;
*/
ompi_registry_segment_t *seg;
uint8_t *object;
/* initialize the global registry list */
OBJ_CONSTRUCT(&ompi_registry.registry, lam_list_t);
/* initialize the global dictionary for segment id's */
OBJ_CONSTRUCT(&ompi_registry.segment_dict, lam_list_t);
OBJ_CONSTRUCT(&ompi_registry.freekeys, lam_list_t);
ompi_registry.lastkey = 0;
/* define the "universe" segment key */
if (0 == ompi_registry_definekey("universe", NULL)) {
fprintf(stderr, "registry_init(error): could not create universe dictionary entry\n");
exit(LAM_ERROR);
}
/* initialize the "universe" segment */
seg = OBJ_NEW(ompi_registry_segment_t); /* allocate a new segment */
seg->segment = ompi_registry_getkey("universe", NULL);
lam_list_append(&ompi_registry.registry, &seg->item); /* add to the global registry */
printf("initialized universe seg %ld\n", seg->segment);
if (0 == ompi_registry_definekey("universe", "ipsy-doodles")) {
fprintf(stderr, "well, ipsy-doodles define didn't work\n");
exit(LAM_ERROR);
}
printf("ipsy-doodles ok: %ld\n", ompi_registry_getkey("universe", "ipsy-doodles"));
if (0 == ompi_registry_definekey("commworld-1", NULL)) {
fprintf(stderr, "commworld 1 failed\n");
exit(LAM_ERROR);
}
printf("commworld ok: %ld\n", ompi_registry_getkey("commworld-1", NULL));
object = (uint8_t *)malloc(200);
ompi_registry_put(false, object, sizeof(object), "commworld-1", "tok1", "tok2", "tok3", "tok4", NULL);
/* keytable = (ompi_keytable *)malloc(sizeof(ompi_keytable));
keytable->token = strdup("universe");
keytable->key = 1;
keytable->next = NULL;
nextkey = (ompi_keytable *)malloc(sizeof(ompi_keytable));
nextkey->token = strdup("commworld-1");
nextkey->key = 1;
keytable->next = nextkey;
nextkey->next = NULL;
registry = (ompi_registry_core *)malloc(sizeof(ompi_registry_core));
registry->primary_key = ompi_getkey("universe");
registry->keys = (ompi_keylist *)malloc(sizeof(ompi_keylist));
registry->keys->key = ompi_getkey("commworld-1");
registry->keys->next = NULL;
registry->object_size = 100;
registry->object = (uint8_t *)malloc(100);
registry->subscriber = (ompi_subscribe_list *)malloc(sizeof(ompi_subscribe_list));
registry->subscriber->id = 1;
registry->subscriber->action = OMPI_REGISTRY_NOTIFY_MODIFICATION | OMPI_REGISTRY_NOTIFY_DELETE;
printf("universe key = %d\n", registry->primary_key);
*/
}
ompi_registry_segment_t *ompi_registry_findseg(char *segment)
{
ompi_keytable_t *ptr_seg;
ompi_registry_segment_t *seg;
/* search the registry segments to find which one is being referenced */
for (ptr_seg = (ompi_keytable_t*)lam_list_get_first(&ompi_registry.segment_dict);
ptr_seg != (ompi_keytable_t*)lam_list_get_end(&ompi_registry.segment_dict);
ptr_seg = (ompi_keytable_t*)lam_list_get_next(ptr_seg)) {
if (0 == strcmp(segment, ptr_seg->token)) {
fprintf(stderr, "findseg: found segment token %s key %ld\n", ptr_seg->token, ptr_seg->key);
/* search ompi_registry to find segment */
for (seg=(ompi_registry_segment_t*)lam_list_get_first(&ompi_registry.registry);
seg != (ompi_registry_segment_t*)lam_list_get_end(&ompi_registry.registry);
seg = (ompi_registry_segment_t*)lam_list_get_next(seg)) {
fprintf(stderr, "findseg: checking seg\n");
if(seg->segment == ptr_seg->key) {
fprintf(stderr, "findseg: found segment key %ld\n", seg->segment);
return(seg);
}
}
}
}
return(NULL); /* couldn't find the specified segment */
}
ompi_keytable_t *ompi_registry_finddictentry(char *segment, char *token)
{
ompi_keytable_t *ptr_seg;
ompi_keytable_t *ptr_key;
ompi_registry_segment_t *seg;
/* search the registry segments to find which one is being referenced */
for (ptr_seg = (ompi_keytable_t*)lam_list_get_first(&ompi_registry.segment_dict);
ptr_seg != (ompi_keytable_t*)lam_list_get_end(&ompi_registry.segment_dict);
ptr_seg = (ompi_keytable_t*)lam_list_get_next(ptr_seg)) {
if (0 == strcmp(segment, ptr_seg->token)) {
if (NULL == token) { /* just want segment token-key pair */
return(ptr_seg);
}
/* search ompi_registry to find segment */
for (seg=(ompi_registry_segment_t*)lam_list_get_first(&ompi_registry.registry);
seg != (ompi_registry_segment_t*)lam_list_get_end(&ompi_registry.registry);
seg = (ompi_registry_segment_t*)lam_list_get_next(seg)) {
if(seg->segment == ptr_seg->key) {
/* got segment - now find specified token-key pair in that dictionary */
for (ptr_key = (ompi_keytable_t*)lam_list_get_first(&seg->keytable);
ptr_key != (ompi_keytable_t*)lam_list_get_end(&seg->keytable);
ptr_key = (ompi_keytable_t*)lam_list_get_next(ptr_key)) {
if (0 == strcmp(token, ptr_key->token)) {
return(ptr_key);
}
}
return(NULL); /* couldn't find the specified entry */
}
}
return(NULL); /* couldn't find segment, even though we found entry in registry dict */
}
}
return(NULL); /* couldn't find segment token-key pair */
}
unsigned long int ompi_registry_getkey(char *segment, char *token)
{
ompi_keytable_t *ptr_key;
/* find registry segment */
ptr_key = ompi_registry_finddictentry(segment, NULL);
if (NULL != ptr_key) {
if (NULL == token) { /* only want segment key */
return(ptr_key->key);
}
/* if token specified, find the dictionary entry that matches token */
ptr_key = ompi_registry_finddictentry(segment, token);
if (NULL != ptr_key) {
return(ptr_key->key);
}
return(0); /* couldn't find dictionary entry */
}
return(0); /* couldn't find segment */
}
unsigned long int ompi_registry_definekey(char *segment, char *token)
{
ompi_registry_segment_t *seg;
ompi_keytable_t *ptr_seg, *ptr_key, *new;
/* protect against errors */
if (NULL == segment) {
return(0);
}
/* if token is NULL, then this is defining a segment name. Check dictionary to ensure uniqueness */
if (NULL == token) {
for (ptr_seg = (ompi_keytable_t*)lam_list_get_first(&ompi_registry.segment_dict);
ptr_seg != (ompi_keytable_t*)lam_list_get_end(&ompi_registry.segment_dict);
ptr_seg = (ompi_keytable_t*)lam_list_get_next(ptr_seg)) {
if (0 == strcmp(segment, ptr_seg->token)) {
return(0);
}
}
/* okay, name is not previously taken. Define a key value for it and return */
new = OBJ_NEW(ompi_keytable_t);
new->token = strdup(segment);
if (0 == lam_list_get_size(&ompi_registry.freekeys)) { /* no keys waiting for reuse */
ompi_registry.lastkey++;
new->key = ompi_registry.lastkey;
} else {
ptr_key = (ompi_keytable_t*)lam_list_remove_first(&ompi_registry.freekeys);
new->key = ptr_key->key;
}
lam_list_append(&ompi_registry.segment_dict, &new->item);
return(new->key);
}
/* okay, token is specified */
/* search the registry segments to find which one is being referenced */
seg = ompi_registry_findseg(segment);
if (NULL != seg) {
/* using that segment, check dictionary to ensure uniqueness */
for (ptr_key = (ompi_keytable_t*)lam_list_get_first(&seg->keytable);
ptr_key != (ompi_keytable_t*)lam_list_get_end(&seg->keytable);
ptr_key = (ompi_keytable_t*)lam_list_get_next(ptr_key)) {
if (0 == strcmp(token, ptr_key->token)) {
return(0); /* already taken, report error */
}
}
/* okay, token is unique - create dictionary entry */
new = OBJ_NEW(ompi_keytable_t);
new->token = strdup(token);
if (0 == lam_list_get_size(&seg->freekeys)) { /* no keys waiting for reuse */
seg->lastkey++;
new->key = seg->lastkey;
} else {
ptr_key = (ompi_keytable_t*)lam_list_remove_first(&seg->freekeys);
new->key = ptr_key->key;
}
lam_list_append(&seg->keytable, &new->item);
return(new->key);
}
/* couldn't find segment */
return(0);
}
int ompi_registry_deletekey(char *segment, char *token)
{
ompi_registry_segment_t *seg;
ompi_registry_core_t *reg, *prev;
ompi_keytable_t *ptr_seg, *ptr_key, *new, *regkey;
ompi_subscribe_list_t *subscriber;
/* protect ourselves against errors */
if (NULL == segment) {
return(LAM_ERROR);
}
/* find the segment */
seg = ompi_registry_findseg(segment);
if (NULL != seg) {
/* if specified token is NULL, then this is deleting a segment name.*/
if (NULL == token) {
/* empty the segment's registry */
while (0 < lam_list_get_size(&seg->reg_list)) {
lam_list_remove_last(&seg->reg_list);
}
/* empty the segment's dictionary */
while (0 < lam_list_get_size(&seg->keytable)) {
lam_list_remove_last(&seg->keytable);
}
/* empty the list of free keys */
while (0 < lam_list_get_size(&seg->freekeys)) {
lam_list_remove_last(&seg->freekeys);
}
/* now remove segment from global registry */
lam_list_remove_item(&ompi_registry.registry, &seg->item);
/* add key to global registry's freekey list */
new = OBJ_NEW(ompi_keytable_t);
new->token = NULL;
new->key = ptr_seg->key;
lam_list_append(&ompi_registry.freekeys, &new->item);
/* NEED TO RE-FIND PTR_SEG */
/* now remove the dictionary entry from the global registry dictionary*/
lam_list_remove_item(&ompi_registry.segment_dict, &ptr_seg->item);
return(LAM_SUCCESS);
} else { /* token not null, so need to find dictionary element to delete */
ptr_key = ompi_registry_finddictentry(segment, token);
if (NULL != ptr_key) {
/* found key in dictionary */
/* need to search this segment's registry to find all instances of key - then delete them */
for (reg = (ompi_registry_core_t*)lam_list_get_first(&seg->reg_list);
reg != (ompi_registry_core_t*)lam_list_get_end(&seg->reg_list);
reg = (ompi_registry_core_t*)lam_list_get_next(reg)) {
/* check the subscriber list */
for (subscriber = (ompi_subscribe_list_t*)lam_list_get_first(&reg->subscriber);
(subscriber != (ompi_subscribe_list_t*)lam_list_get_end(&reg->subscriber)
&& (subscriber->id != ptr_key->key));
subscriber = (ompi_subscribe_list_t*)lam_list_get_next(subscriber));
if (subscriber != (ompi_subscribe_list_t*)lam_list_get_end(&reg->subscriber)) {
lam_list_remove_item(&reg->subscriber, &subscriber->item);
}
/* check the key list */
for (regkey = (ompi_keytable_t*)lam_list_get_first(&reg->keys);
(regkey != (ompi_keytable_t*)lam_list_get_end(&reg->keys))
&& (regkey->key != ptr_key->key);
regkey = (ompi_keytable_t*)lam_list_get_next(regkey));
if (regkey != (ompi_keytable_t*)lam_list_get_end(&reg->keys)) {
lam_list_remove_item(&reg->keys, &regkey->item);
}
/* if this was the last key, then remove the registry entry itself */
if (0 == lam_list_get_size(&reg->keys)) {
while (0 < lam_list_get_size(&reg->subscriber)) {
lam_list_remove_last(&reg->subscriber);
}
prev = (ompi_registry_core_t*)lam_list_get_prev(reg);
lam_list_remove_item(&seg->reg_list, &reg->item);
reg = prev;
}
}
/* add key to this segment's freekey list */
new = OBJ_NEW(ompi_keytable_t);
new->token = NULL;
new->key = ptr_key->key;
lam_list_append(&seg->freekeys, &new->item);
/* now remove the dictionary entry from the segment's dictionary */
lam_list_remove_item(&seg->keytable, &ptr_key->item);
return(LAM_SUCCESS);
}
return(LAM_ERROR); /* if we get here, then we couldn't find token in dictionary */
}
}
return(LAM_ERROR); /* if we get here, then we couldn't find segment */
}
int ompi_registry_definesegment(char *segment)
{
if (0 == ompi_registry_definekey(segment, NULL)) {
return(LAM_ERROR);
}
return(LAM_SUCCESS);
}
int ompi_registry_put(bool overwrite, uint8_t *object, int size, char *segment, char *token, ...)
{
va_list ap, ap1;
int num_tokens=1, i;
char *tokenel, **tokenlist, **tok_ptr;
ompi_keytable_t *ptr_seg;
ompi_registry_segment_t *seg;
#if __STDC__
va_start(ap, token);
va_start(ap1, token);
#else
va_start(ap);
va_start(ap1);
#endif
/* protect ourselves against errors */
if (NULL == segment || NULL == object || 0 == size || NULL == token) {
return(LAM_ERROR);
}
/* get list of tokens */
while (NULL != (tokenel=va_arg(ap, char*))) {
num_tokens++;
}
tokenlist = (char **)malloc(num_tokens);
tok_ptr = tokenlist;
*tok_ptr = strdup(token);
tok_ptr++;
while (NULL != (tokenel=va_arg(ap1, char*))) {
*tok_ptr = strdup(tokenel);
tok_ptr++;
}
va_end(ap);
va_end(ap1);
for (i=0, tok_ptr=tokenlist; i<num_tokens; i++) {
fprintf(stderr, "put: token %s\n", *tok_ptr);
tok_ptr++;
}
return(1);
/* find the segment */
seg = ompi_registry_findseg(segment);
if (NULL != seg) {
}
return(LAM_SUCCESS);
}
ompi_registry_value_t *ompi_registry_get(char *segment, char *token, ...)
{
}
int ompi_registry_del(char *segment, char *token, ...)
{
}
ompi_keytable_t *ompi_registry_index(char *segment, ...)
{
}
ompi_keytable_t *ompi_registry_segment_index(void)
{
}
int ompi_registry_subscribe(int caller, uint8_t action, char *segment, char *token, ...)
{
}
int ompi_registry_unsubscribe(int caller, uint8_t action, char *segment, char *token, ...)
{
}

340
src/rte/universe/registry/registry.h Обычный файл
Просмотреть файл

@ -0,0 +1,340 @@
/*
* $HEADER$
*/
/** @file:
*
* The Open MPI general purpose registry.
*
* The Open MPI system contains a general purpose registry for use by both
* applications and internal systems to dynamically share information. For
* speed purposes, the registry is divided into "segments", each labelled
* with an appropriate "token" string that describes its contents. Segments
* are automatically provided for the "universe" and for each MPI CommWorld.
* At this time, all segments may be accessed by any application within the universe, thus
* providing a mechanism for cross-CommWorld communications (with the requirement
* that all participating CommWorlds must reside within the same universe). In the future,
* some form of security may be provided to limit access privileges between
* segments.
*
* Within each registry segment, there exists a list of objects that have
* been "put" onto the registry. Each object must be tagged with at least
* one token, but may be tagged with as many tokens as the creator desires.
* Retrieval requests must specify the segment and at least one token, but
* can specify an arbitrary number of tokens to describe the search. The registry
* will return a list of all objects that meet the search criteria.
*
* Tokens are defined as character strings, thus allowing for clarity in
* the program. However, for speed purposes, tokens are translated into
* integer keys prior to storing an object. A table of token-key pairs
* is independetly maintained for each registry segment. Users can obtain
* an index of token-key values by requesting it through the ompi_registry_index()
* function, and can define/delete token-key values using the ompi_registry_definekey()
* and ompi_registry_deletekey() functions, respectively.
*
* The registry also provides a subscription capability whereby a caller
* can subscribe to a stored object and receive notification when various actions
* are performed on that object. Currently supported actions include modification,
* the addition of another subscriber, and deletion. Notifications are sent via
* the OOB communication channel.
*
*
*/
/*
* includes
*/
#include "lam_config.h"
#include "include/constants.h"
#include "lfc/lam_list.h"
/** Define the notification actions for the subscription system
*/
/** Notifies subscriber when object is modified */
#define OMPI_REGISTRY_NOTIFY_MODIFICATION 0x01
/** Notifies subscriber when another subscriber is added */
#define OMPI_REGISTRY_NOTIFY_ADD_SUBSCRIBER 0x02
/** Notifies subscriber when object is removed from registry */
#define OMPI_REGISTRY_NOTIFY_DELETE 0x04
/** Notifies subscriber upon any action - effectively an OR of all other flags */
#define OMPI_REGISTRY_NOTIFY_ALL 0xff
/*
* structures
*/
/** Dictionary of token-key pairs.
* This structure is used to create a linked list of token-key pairs. All calls to
* registry functions pass character string tokens for programming clarity - the ompi_keytable
* structure is used to translate those strings into an integer key value, thus allowing
* for faster searches of the registry. This structure is also used to return token-key pairs
* from the dictionary in response to an ompi_registry_index() call.
*/
struct ompi_keytable_t {
lam_list_item_t item; /**< Allows this item to be placed on a list */
char *token; /**< Char string that defines the key */
unsigned long int key; /**< Numerical value assigned by registry to represent token string */
};
typedef struct ompi_keytable_t ompi_keytable_t;
/* constructor - used to initialize state of keytable instance */
static void ompi_keytable_construct(ompi_keytable_t* keytable)
{
keytable->token = NULL;
keytable->key = 0;
}
/* destructor - used to free any resources held by instance */
static void ompi_keytable_destructor(ompi_keytable_t* keytable)
{
if (NULL != keytable->token) {
free(keytable->token);
}
}
/* define instance of lam_class_t */
OBJ_CLASS_INSTANCE(
ompi_keytable_t, /* type name */
lam_list_item_t, /* parent "class" name */
ompi_keytable_construct, /* constructor */
ompi_keytable_destructor); /* destructor */
/** Return value structure for registry requests.
* A request for information stored within the registry returns a linked list of values that
* correspond to the provided tokens. The linked list is terminated by a "next" value of NULL.
* Each link in the list contains a pointer to a copy of the registry object, and the size
* of that object in bytes. Note that the pointer is to a \em copy of the object, and not
* to the registry object itself. This prevents inadvertent modification of the registry, but
* may require the recipient to release the structure's memory when done.
*/
struct ompi_registry_value_t {
lam_list_item_t item; /**< Allows this item to be placed on a list */
uint8_t *object; /**< Pointer to object being returned */
int object_size; /**< Size of returned object, in bytes */
};
typedef struct ompi_registry_value_t ompi_registry_value_t;
/* constructor - used to initialize state of keytable instance */
static void ompi_registry_value_construct(ompi_registry_value_t* reg_val)
{
reg_val->object = NULL;
reg_val->object_size = -1;
}
/* destructor - used to free any resources held by instance */
static void ompi_registry_value_destructor(ompi_registry_value_t* reg_val)
{
if (NULL != reg_val->object) {
free(reg_val->object);
}
}
/* define instance of lam_class_t */
OBJ_CLASS_INSTANCE(
ompi_registry_value_t, /* type name */
lam_list_item_t, /* parent "class" name */
ompi_registry_value_construct, /* constructor */
ompi_registry_value_destructor); /* destructor */
/*
* external function prototypes
*/
/** Define a new registry segment.
* The ompi_registry_definesegment() function allows the caller to create a new registry
* segment with the specified name. Each segment is given its own token-key dictionary and
* object storage list. There is no limit nor restrictions on the number of segments
* that can be created and who can create them, or for what they can be used. Attempts to
* define a segment with a name that already exists will return an error.
*
* @param segment A pointer to a character string containing the name of the segment
* to be created.
*
* @retval LAM_SUCCESS Indicates that the operation was successfully completed.
* @retval LAM_ERROR Indicates that the operation failed - most likely due to the
* prior existence of a segment with an identical name.
*/
int ompi_registry_definesegment(char *segment);
/** Place an object on the registry.
* The ompi_registry_put() function places an object on the registry within the specified
* registry segment. At least one token describing the object must be provided - an unlimited
* number of additional tokens may also be provided. Note that placing an object on the
* registry where another object with all tokens identical already exists will cause the
* prior object to be replaced with the new object.
*
* CAUTION: The ompi_registry_put() function call MUST end with a NULL parameter! The C variable
* argument system does not provide for a mechanism by which we can determine the number of
* arguments that were passed. Failure to terminate the argument list with a NULL will result
* in segmentation violations or bus errors, thus causing the program to catastrophically fail.
*
* @param overwrite A boolean value that indicates whether or not to overwrite an existing
* entry if all tokens match. A value of "true" indicates overwrite is permitted - a value
* of "false" indicates that overwrite is forbidden. In the latter case, attempting to
* overwrite an existing entry will result in an error condition being returned.
* @param object A pointer to the object to be stored on the registry. The registry will create
* a copy of the object. Since the registry has no knowledge of the object's internal structure,
* the object is stored as an object of uint8_t (unsigned 8-bit int) type. The pointer must be cast
* into the uint8_t type when passed.
* @param size Integer value of the size of the object being passed, in bytes.
* @param segment A pointer to a character string stating the registry segment to be used.
* @param token A pointer to a character string containing a token that defines the object
* being stored. This token can later be used to retrieve the object. The registry uses the
* ompi_registry_getkey() function to translate the token to an integer key prior to storing
* the object. If the token is not currently defined in the segment's dictionary, a new
* dictionary entry will automatically be created.
* @param tokens... Additional tokens (provided as pointers to character strings) can be
* provided to further identify the object being stored.
* @param NULL The last parameter in the function call MUST be a NULL to terminate the
* variable list of arguments.
*
* @retval LAM_SUCCESS Indicates that the operation was successful.
* @retval LAM_ERROR Indicates that the registry was unable to store the object - most
* likely due to specifying a non-existent segment or lack of available memory.
*/
int ompi_registry_put(bool overwrite, uint8_t *object, int size, char *segment, char *token, ...);
/** Retrieve an object from the registry.
* The ompi_registry_get() function retrieves a copy of an object previously stored on
* the registry. The caller must provide the registry segment containing the object, and at
* least one token that describes it. An unlimited number of additional tokens describing the
* object may be provided. The function will return a linked list of all objects that match
* the search criteria.
*
* CAUTION: The ompi_registry_get() function call MUST end with a NULL parameter! The C variable
* argument system does not provide for a mechanism by which we can determine the number of
* arguments that were passed. Failure to terminate the argument list with a NULL will result
* in segmentation violations or bus errors, thus causing the program to catastrophically fail.
*
* @param segment Pointer to a character string defining the segment of the registry.
* @param token Pointer to a character string containing the token to be retrieved.
* @param tokens... Additional tokens (provided as pointers to character strings) can be
* provided to further identify the object being retrieved.
* @param NULL The last parameter in the function call MUST be a NULL to terminate the
* variable list of arguments.
*
* @retval object Pointer to a linked list of ompi_registry_value structures, each containing
* a pointer to a copy of the object retrieved from the registry, the size of the object in bytes,
* and a pointer to the next link in the list (which is NULL for the last link). The object
* is returned as a *uint8_t since the object's internal structure is unknown to the registry.
* @retval NULL Indicates that the specified object could not be found.
*/
ompi_registry_value_t *ompi_registry_get(char *segment, char *token, ...);
/** Delete an object from the registry.
* The ompi_registry_del() function removes an object that was previously stored on the registry.
* The caller must provide the registry segment containing the object, and at
* least one token that describes it. An unlimited number of additional tokens describing the
* object may be provided.
*
* CAUTION: The function will delete ALL objects that match the search criteria.
*
* CAUTION: The ompi_registry_del() function call MUST end with a NULL parameter! The C variable
* argument system does not provide for a mechanism by which we can determine the number of
* arguments that were passed. Failure to terminate the argument list with a NULL will result
* in segmentation violations or bus errors, thus causing the program to catastrophically fail.
*
* @param segment Pointer to a character string defining the segment of the registry.
* @param token Pointer to a character string containing the token to be deleted.
* @param tokens... Additional tokens (provided as pointers to character strings) can be
* provided to further identify the object being deleted.
* @param NULL The last parameter in the function call MUST be a NULL to terminate the
* variable list of arguments.
* @retval LAM_SUCCESS Indicates that the operation was successful.
* @retval LAM_ERROR Indicates that the registry was unable to delete the object - most
* likely due to specifying a non-existent segment or object.
*/
int ompi_registry_del(char *segment, char *token, ...);
/** Obtain an index of the registry token-key dictionary.
* The ompi_registry_index() function provides a list of the token-key pairs within
* a specified dictionary. The caller must provide the name of the segment being
* queried - this will return a linked list of all token-key pairs within that segment's
* dictionary. Alternatively, the caller may also provide an unlimited number of tokens
* which the caller would like to have translated - the function will then return a
* linked list of token-key pairs. Any tokens not found will be ignored.
*
* CAUTION: The ompi_registry_index() function call MUST end with a NULL parameter! The C variable
* argument system does not provide for a mechanism by which we can determine the number of
* arguments that were passed. Failure to terminate the argument list with a NULL will result
* in segmentation violations or bus errors, thus causing the program to catastrophically fail.
*
* @param segment Pointer to a character string defining the segment of the registry.
* @param tokens... Additional tokens (provided as pointers to character strings) can be
* provided that the caller would like to have translated.
* @param NULL The last parameter in the function call MUST be a NULL to terminate the
* variable list of arguments.
*
* @retval keyvalues A pointer to a linked list of token-key pairs. Any tokens not found
* will be ignored and will, therefore, not be included in the returned list.
* @retval NULL Indicates that the operation failed - most likely caused by failing to specify
* any token that exists within the specified segment, or a non-existent segment.
*/
ompi_keytable_t *ompi_registry_index(char *segment, ...);
/** Obtain a list of the current registry segments.
* The ompi_registry_segment_index() function provides a list of the segments currently defined
* within this registry.
*
* @param - No parameters are passed to this function.
*
* @retval keyvalues A pointer to a linked list of segment token-key pairs.
* @retval NULL Indicates that no segments are currently defined within this registry - i.e., the
* registry is completely empty.
*
*/
ompi_keytable_t *ompi_registry_segment_index(void);
/** Subscribe to a registry object.
* The ompi_registry_subscribe() function allows the caller to be notified when specific actions
* are taken on the specified object. Notification will be sent via the OOB communication channel.
* The caller must provide an ID that allows the OOB to properly route the notification message.
*
* CAUTION: The ompi_registry_subscribe() function call MUST end with a NULL parameter! The C variable
* argument system does not provide for a mechanism by which we can determine the number of
* arguments that were passed. Failure to terminate the argument list with a NULL will result
* in segmentation violations or bus errors, thus causing the program to catastrophically fail.
*
* @param caller The ID of the caller - used to route any subsequent notifications.
* @param action A bit-mask value formed using the OMPI_REGISTRY_NOTIFY flags that indicates
* the action that shall trigger notification of the caller.
* @param segment Pointer to a character string defining the segment of the registry.
* @param token Pointer to a character string containing the token of the object to which
* the caller is subscribing.
* @param tokens... Additional tokens (provided as pointers to character strings) can be
* provided to further identify the object to which the caller is subscribing.
* @param NULL The last parameter in the function call MUST be a NULL to terminate the
* variable list of arguments.
*
* @retval LAM_SUCCESS Indicates that the operation was successful.
* @retval LAM_ERROR Indicates that the operation failed - most likely caused by specifying
* an object that did not exist within the specified segment, or a non-existent segment.
*/
int ompi_registry_subscribe(int caller, uint8_t action, char *segment, char *token, ...);
/** Unsubscribe from a registry object.
*
* CAUTION: The ompi_registry_put() function call MUST end with a NULL parameter! The C variable
* argument system does not provide for a mechanism by which we can determine the number of
* arguments that were passed. Failure to terminate the argument list with a NULL will result
* in segmentation violations or bus errors, thus causing the program to catastrophically fail.
*
* @param caller The ID of the caller wishing to remove its subscription to the object.
* @param segment Pointer to a character string defining the segment of the registry.
* @param token Pointer to a character string containing the token of the object to which
* the caller is subscribed.
* @param tokens... Additional tokens (provided as pointers to character strings) can be
* provided to further identify the object to which the caller is subscribed.
* @param NULL The last parameter in the function call MUST be a NULL to terminate the
* variable list of arguments.
*
* @retval LAM_SUCCESS Indicates that the operation was successful. Note that this value will
* also be returned if the caller was not previously subscribed to the specified object since an
* unsubscribe request would have resulted in the same end condition.
* @retval LAM_ERROR Indicates that the operation failed - most likely caused by specifying
* an object that did not exist within the specified segment, or a non-existent segment.
*/
int ompi_registry_unsubscribe(int caller, uint8_t action, char *segment, char *token, ...);