* add shell of a cofs registry module implementation. Doesn't actually
work yet, but compiles and links and all that joy This commit was SVN r283.
Этот коммит содержится в:
родитель
f093e2f386
Коммит
b93d3172f8
@ -1,2 +1,3 @@
|
||||
Makefile.in
|
||||
Makefile
|
||||
static-modules.h
|
||||
|
14
src/mca/lam/registry/cofs/.cvsignore
Обычный файл
14
src/mca/lam/registry/cofs/.cvsignore
Обычный файл
@ -0,0 +1,14 @@
|
||||
Makefile
|
||||
Makefile.in
|
||||
acinclude.m4
|
||||
aclocal.m4
|
||||
configure
|
||||
configure.ac
|
||||
config.log
|
||||
config.status
|
||||
libtool
|
||||
autom4te.cache
|
||||
.libs
|
||||
.deps
|
||||
*.la
|
||||
.lam*
|
38
src/mca/lam/registry/cofs/Makefile.am
Обычный файл
38
src/mca/lam/registry/cofs/Makefile.am
Обычный файл
@ -0,0 +1,38 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# Use the top-level LAM Makefile.options
|
||||
|
||||
include $(top_lam_srcdir)/config/Makefile.options
|
||||
|
||||
SUBDIRS = src
|
||||
DIST_SUBDIRS = config $(SUBDIRS)
|
||||
|
||||
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
|
||||
# liblam_ssi_coll_lam_basic.la
|
||||
|
||||
if LAM_BUILD_LOADABLE_MODULE
|
||||
module_noinst =
|
||||
module_install = mca_registry_cofs.la
|
||||
else
|
||||
module_noinst = libmca_lam_registry_cofs.la
|
||||
module_install =
|
||||
endif
|
||||
|
||||
lamssiexecdir = $(libdir)/lam
|
||||
lamssiexec_LTLIBRARIES = $(module_install)
|
||||
mca_registry_cofs_la_SOURCES =
|
||||
mca_registry_cofs_la_LIBADD = \
|
||||
src/libmca_registry_cofs.la \
|
||||
$(top_lam_builddir)/src/lam/liblam.la
|
||||
mca_registry_cofs_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
noinst_LTLIBRARIES = $(module_noinst)
|
||||
libmca_lam_registry_cofs_la_SOURCES =
|
||||
libmca_lam_registry_cofs_la_LIBADD = src/libmca_registry_cofs.la
|
||||
libmca_lam_registry_cofs_la_LDFLAGS = -module -avoid-version
|
6
src/mca/lam/registry/cofs/VERSION
Обычный файл
6
src/mca/lam/registry/cofs/VERSION
Обычный файл
@ -0,0 +1,6 @@
|
||||
major=1
|
||||
minor=0
|
||||
release=0
|
||||
alpha=0
|
||||
beta=0
|
||||
cvs=1
|
9
src/mca/lam/registry/cofs/config/.cvsignore
Обычный файл
9
src/mca/lam/registry/cofs/config/.cvsignore
Обычный файл
@ -0,0 +1,9 @@
|
||||
config.guess
|
||||
config.sub
|
||||
depcomp
|
||||
install-sh
|
||||
ltmain.sh
|
||||
Makefile
|
||||
Makefile.in
|
||||
missing
|
||||
mkinstalldirs
|
15
src/mca/lam/registry/cofs/config/Makefile.am
Обычный файл
15
src/mca/lam/registry/cofs/config/Makefile.am
Обычный файл
@ -0,0 +1,15 @@
|
||||
# -*- makefile -*-
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
include $(top_lam_srcdir)/config/Makefile.options
|
||||
|
||||
# This file is only here so that "make dist" grabs all the extra
|
||||
# config-level files that are necessary to build a LAM distribution
|
||||
# tarball. Nothing gets built in this directory.
|
||||
|
||||
# Seems to be an automake bug -- depcomp is not automatically included
|
||||
# in distribution tarballs.
|
||||
|
||||
EXTRA_DIST = depcomp
|
9
src/mca/lam/registry/cofs/configure.params
Обычный файл
9
src/mca/lam/registry/cofs/configure.params
Обычный файл
@ -0,0 +1,9 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# Specific to this module
|
||||
|
||||
PARAM_INIT_FILE=src/registry_cofs.c
|
||||
PARAM_CONFIG_FILES="Makefile config/Makefile src/Makefile"
|
9
src/mca/lam/registry/cofs/src/.cvsignore
Обычный файл
9
src/mca/lam/registry/cofs/src/.cvsignore
Обычный файл
@ -0,0 +1,9 @@
|
||||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.lo
|
||||
libmca_registry_cofs.la
|
||||
registry_cofs_config.h
|
||||
registry_cofs_config.h.in
|
||||
stamp-h1
|
17
src/mca/lam/registry/cofs/src/Makefile.am
Обычный файл
17
src/mca/lam/registry/cofs/src/Makefile.am
Обычный файл
@ -0,0 +1,17 @@
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
include $(top_lam_srcdir)/config/Makefile.options
|
||||
|
||||
AM_CPPFLAGS = \
|
||||
-I$(top_lam_builddir)/src/include \
|
||||
-I$(top_lam_srcdir)/src \
|
||||
-I$(top_lam_srcdir)/src/include
|
||||
|
||||
noinst_LTLIBRARIES = libmca_registry_cofs.la
|
||||
libmca_registry_cofs_la_SOURCES = \
|
||||
registry_cofs.h \
|
||||
registry_cofs_module.c \
|
||||
registry_cofs.c
|
||||
|
38
src/mca/lam/registry/cofs/src/registry_cofs.c
Обычный файл
38
src/mca/lam/registry/cofs/src/registry_cofs.c
Обычный файл
@ -0,0 +1,38 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "lam_config.h"
|
||||
|
||||
#include "mca/lam/registry/registry.h"
|
||||
#include "mca/lam/registry/cofs/src/registry_cofs.h"
|
||||
#include "lam/util/malloc.h"
|
||||
#include "lam/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 LAM_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_registry_cofs_lookup(char* key, void** data, size_t* data_len)
|
||||
{
|
||||
return LAM_ERR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_registry_cofs_unpublish(char* key)
|
||||
{
|
||||
return LAM_ERR_NOT_IMPLEMENTED;
|
||||
}
|
34
src/mca/lam/registry/cofs/src/registry_cofs.h
Обычный файл
34
src/mca/lam/registry/cofs/src/registry_cofs.h
Обычный файл
@ -0,0 +1,34 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
#include "lam_config.h"
|
||||
|
||||
#include "mca/lam/registry/registry.h"
|
||||
#include "lam/types.h"
|
||||
|
||||
/*
|
||||
* Module open / close
|
||||
*/
|
||||
int mca_registry_cofs_open(lam_cmd_line_t *cmd);
|
||||
int mca_registry_cofs_close(void);
|
||||
|
||||
|
||||
/*
|
||||
* Startup / Shutdown
|
||||
*/
|
||||
int mca_registry_cofs_query(int *priority);
|
||||
struct mca_registry_1_0_0_t* mca_registry_cofs_init(void);
|
||||
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[LAM_PATH_MAX]; /* location for file drop-off */
|
||||
extern int mca_registry_cofs_my_vpid;
|
130
src/mca/lam/registry/cofs/src/registry_cofs_module.c
Обычный файл
130
src/mca/lam/registry/cofs/src/registry_cofs_module.c
Обычный файл
@ -0,0 +1,130 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "lam_config.h"
|
||||
|
||||
#include "lam/constants.h"
|
||||
#include "mca/mca.h"
|
||||
#include "mca/lam/registry/registry.h"
|
||||
#include "mca/lam/registry/cofs/src/registry_cofs.h"
|
||||
#include "lam/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_query, /* module query */
|
||||
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[LAM_PATH_MAX];
|
||||
int mca_registry_cofs_my_vpid;
|
||||
|
||||
int
|
||||
mca_registry_cofs_open(lam_cmd_line_t *cmd)
|
||||
{
|
||||
return LAM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_registry_cofs_close(void)
|
||||
{
|
||||
return LAM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_registry_cofs_query(int *priority)
|
||||
{
|
||||
*priority = 0;
|
||||
return LAM_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
struct mca_registry_1_0_0_t*
|
||||
mca_registry_cofs_init(void)
|
||||
{
|
||||
char *tmp;
|
||||
FILE *fp;
|
||||
|
||||
/*
|
||||
* BWB - fix me, make register the "right" way...
|
||||
*/
|
||||
tmp = getenv("MCA_common_lam_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, LAM_PATH_MAX, "%s/cofs", tmp);
|
||||
} else {
|
||||
snprintf(mca_registry_cofs_comm_loc, LAM_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_REGISTRY_BASE_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 LAM_SUCCESS;
|
||||
}
|
@ -35,8 +35,8 @@
|
||||
/*
|
||||
* Functions every module instance will have to provide
|
||||
*/
|
||||
typedef int (*mca_registry_query_fn_t)(int *priority);
|
||||
typedef struct mca_registry_1_0_0* (*mca_registry_init_fn_t)(void);
|
||||
typedef int (*mca_registry_base_query_fn_t)(int *priority);
|
||||
typedef struct mca_registry_1_0_0_t* (*mca_registry_base_init_fn_t)(void);
|
||||
|
||||
/**
|
||||
* Publish a key=value piece of information
|
||||
@ -56,7 +56,7 @@ typedef struct mca_registry_1_0_0* (*mca_registry_init_fn_t)(void);
|
||||
* \warning May block if the registry entry for key is currently
|
||||
* locked by another process.
|
||||
*/
|
||||
typedef int (*mca_registry_publish_fn_t)(char* key, void* data, size_t data_len);
|
||||
typedef int (*mca_registry_base_publish_fn_t)(char* key, void* data, size_t data_len);
|
||||
|
||||
/**
|
||||
* Get the value for given key
|
||||
@ -81,31 +81,43 @@ typedef int (*mca_registry_publish_fn_t)(char* key, void* data, size_t data_len)
|
||||
* \warning May block if the registry entry for key is currently
|
||||
* locked by another process.
|
||||
*/
|
||||
typedef int (*mca_registry_lookup_fn_t)(char* key, void** data, size_t* data_len);
|
||||
typedef int (*mca_registry_base_lookup_fn_t)(char* key, void** data, size_t* data_len);
|
||||
|
||||
typedef int (*mca_registry_finalize_fn_t)(void);
|
||||
typedef int (*mca_registry_base_unpublish_fn_t)(char* key);
|
||||
|
||||
typedef int (*mca_registry_base_finalize_fn_t)(void);
|
||||
|
||||
|
||||
/*
|
||||
* Ver 1.0.0
|
||||
*/
|
||||
typedef struct mca_registry_module_1_0_0 {
|
||||
mca_module_1_0_0_t super;
|
||||
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_query_fn_t registry_m_query;
|
||||
mca_registry_init_fn_t registry_m_init;
|
||||
mca_registry_base_query_fn_t registrym_query;
|
||||
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;
|
||||
|
||||
mca_registry_finalize_fn_t registry_m_finalize;
|
||||
} mca_registry_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 struct mca_registry_1_0_0 {
|
||||
mca_1_0_0_t super;
|
||||
/*
|
||||
* 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
|
||||
|
||||
mca_registry_publish_fn_t registry_publish;
|
||||
mca_registry_lookup_fn_t registry_lookup;
|
||||
} mca_registry_module_1_0_0_t;
|
||||
|
||||
typedef mca_registry_module_1_0_0_t mca_registry_module_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;
|
||||
|
||||
|
||||
@ -118,7 +130,7 @@ extern "C" {
|
||||
int mca_registry_base_open(lam_cmd_line_t *cmd);
|
||||
int mca_registry_base_close(void);
|
||||
|
||||
bool mca_registry_base_is_checkpointable(void)
|
||||
bool mca_registry_base_is_checkpointable(void);
|
||||
|
||||
int mca_registry_base_checkpoint(void);
|
||||
int mca_registry_base_continue(void);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user