Oops! Forgot the svn add the proxy component.
This commit was SVN r1624.
Этот коммит содержится в:
родитель
63b6e7017f
Коммит
4c842c29b2
32
src/mca/ns/proxy/Makefile.am
Обычный файл
32
src/mca/ns/proxy/Makefile.am
Обычный файл
@ -0,0 +1,32 @@
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# Use the top-level Makefile.options
|
||||
|
||||
include $(top_ompi_srcdir)/config/Makefile.options
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
# Make the output library in this directory, and name it either
|
||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||
# (for static builds).
|
||||
|
||||
if OMPI_BUILD_ns_proxy_DSO
|
||||
component_noinst =
|
||||
component_install = mca_ns_proxy.la
|
||||
else
|
||||
component_noinst = libmca_ns_proxy.la
|
||||
component_install =
|
||||
endif
|
||||
|
||||
mcacomponentdir = $(libdir)/openmpi
|
||||
mcacomponent_LTLIBRARIES = $(component_install)
|
||||
mca_ns_proxy_la_SOURCES =
|
||||
mca_ns_proxy_la_LIBADD = src/libmca_ns_proxy.la
|
||||
mca_ns_proxy_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
noinst_LTLIBRARIES = $(component_noinst)
|
||||
libmca_ns_proxy_la_SOURCES =
|
||||
libmca_ns_proxy_la_LIBADD = src/libmca_ns_proxy.la
|
||||
libmca_ns_proxy_la_LDFLAGS = -module -avoid-version
|
6
src/mca/ns/proxy/VERSION
Обычный файл
6
src/mca/ns/proxy/VERSION
Обычный файл
@ -0,0 +1,6 @@
|
||||
major=1
|
||||
minor=0
|
||||
release=0
|
||||
alpha=0
|
||||
beta=0
|
||||
svn=1
|
9
src/mca/ns/proxy/configure.params
Обычный файл
9
src/mca/ns/proxy/configure.params
Обычный файл
@ -0,0 +1,9 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# Specific to this module
|
||||
|
||||
PARAM_INIT_FILE=src/ns_proxy.c
|
||||
PARAM_CONFIG_FILES="Makefile src/Makefile"
|
12
src/mca/ns/proxy/src/Makefile.am
Обычный файл
12
src/mca/ns/proxy/src/Makefile.am
Обычный файл
@ -0,0 +1,12 @@
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
include $(top_ompi_srcdir)/config/Makefile.options
|
||||
|
||||
noinst_LTLIBRARIES = libmca_ns_proxy.la
|
||||
libmca_ns_proxy_la_SOURCES = \
|
||||
ns_proxy.h \
|
||||
ns_proxy.c \
|
||||
ns_proxy_module.c
|
||||
|
44
src/mca/ns/proxy/src/ns_proxy.c
Обычный файл
44
src/mca/ns/proxy/src/ns_proxy.c
Обычный файл
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* $HEADER$
|
||||
*/
|
||||
/** @file:
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include "mca/mca.h"
|
||||
#include "mca/ns/base/base.h"
|
||||
#include "ns_proxy.h"
|
||||
|
||||
/**
|
||||
* globals
|
||||
*/
|
||||
|
||||
/*
|
||||
* functions
|
||||
*/
|
||||
|
||||
ompi_process_id_t ns_proxy_create_cellid(void)
|
||||
{
|
||||
/* JMS fill in here */
|
||||
return 0;
|
||||
}
|
||||
|
||||
ompi_process_id_t ns_proxy_create_jobid(void)
|
||||
{
|
||||
/* JMS fill in here */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ompi_process_id_t ns_proxy_reserve_range(ompi_process_id_t job, ompi_process_id_t range)
|
||||
{
|
||||
/* JMS fill in here */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int ns_proxy_free_name(ompi_process_name_t* name)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
122
src/mca/ns/proxy/src/ns_proxy.h
Обычный файл
122
src/mca/ns/proxy/src/ns_proxy.h
Обычный файл
@ -0,0 +1,122 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
#ifndef NS_PROXY_H
|
||||
#define NS_PROXY_H
|
||||
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include "include/types.h"
|
||||
#include "include/constants.h"
|
||||
#include "class/ompi_list.h"
|
||||
#include "mca/ns/ns.h"
|
||||
|
||||
/*
|
||||
* list class for tracking vpids/jobid
|
||||
* This structure is used to create a linked list of jobid-max vpid pairs. Basically, we
|
||||
* are tracking the max used vpid for each jobid that has been created.
|
||||
*/
|
||||
struct ompi_name_tracker_t {
|
||||
ompi_list_item_t item; /**< Allows this item to be placed on a list */
|
||||
ompi_process_id_t job; /**< Job id */
|
||||
ompi_process_id_t last_used_vpid; /**< Tracks the vpid last given out */
|
||||
};
|
||||
typedef struct ompi_name_tracker_t ompi_name_tracker_t;
|
||||
|
||||
OBJ_CLASS_DECLARATION(ompi_name_tracker_t);
|
||||
|
||||
/*
|
||||
* globals needed within component
|
||||
*/
|
||||
extern ompi_process_id_t last_used_cellid;
|
||||
extern ompi_process_id_t last_used_jobid;
|
||||
extern ompi_list_t ompi_name_tracker;
|
||||
|
||||
/*
|
||||
* Module open / close
|
||||
*/
|
||||
int mca_ns_proxy_open(void);
|
||||
int mca_ns_proxy_close(void);
|
||||
|
||||
|
||||
/*
|
||||
* Startup / Shutdown
|
||||
*/
|
||||
mca_ns_t* mca_ns_proxy_init(bool *allow_multi_user_threads, bool *have_hidden_threads, int *priority);
|
||||
int mca_ns_proxy_finalize(void);
|
||||
|
||||
/*
|
||||
* Implementation of create_cellid().
|
||||
*/
|
||||
ompi_process_id_t ns_proxy_create_cellid(void);
|
||||
|
||||
/*
|
||||
* Implementation of create_jobid().
|
||||
*/
|
||||
ompi_process_id_t ns_proxy_create_jobid(void);
|
||||
|
||||
/*
|
||||
* Implementation of create_process_name()
|
||||
*/
|
||||
ompi_process_name_t* ns_proxy_create_process_name(
|
||||
ompi_process_id_t cell,
|
||||
ompi_process_id_t job,
|
||||
ompi_process_id_t vpid);
|
||||
|
||||
/*
|
||||
* Implementation of reserve_range()
|
||||
*/
|
||||
ompi_process_id_t ns_proxy_reserve_range(
|
||||
ompi_process_id_t job,
|
||||
ompi_process_id_t range);
|
||||
|
||||
/*
|
||||
* Implementation of free_name()
|
||||
*/
|
||||
int ns_proxy_free_name(ompi_process_name_t* name);
|
||||
|
||||
/*
|
||||
* Implementation of get_proc_name_string()
|
||||
*/
|
||||
char* ns_proxy_get_proc_name_string(const ompi_process_name_t* name);
|
||||
|
||||
/*
|
||||
* Implementation of get_vpid_string()
|
||||
*/
|
||||
char* ns_proxy_get_vpid_string(const ompi_process_name_t* name);
|
||||
|
||||
/*
|
||||
* Implementation of get_jobid_string()
|
||||
*/
|
||||
char* ns_proxy_get_jobid_string(const ompi_process_name_t* name);
|
||||
|
||||
/*
|
||||
* Implementation of get_cellid_string()
|
||||
*/
|
||||
char* ns_proxy_get_cellid_string(const ompi_process_name_t* name);
|
||||
|
||||
/*
|
||||
* Implementation of get_vpid()
|
||||
*/
|
||||
ompi_process_id_t ns_proxy_get_vpid(const ompi_process_name_t* name);
|
||||
|
||||
/*
|
||||
* Implementation of get_jobid()
|
||||
*/
|
||||
ompi_process_id_t ns_proxy_get_jobid(const ompi_process_name_t* name);
|
||||
|
||||
/*
|
||||
* Implementation of get_cellid()
|
||||
*/
|
||||
ompi_process_id_t ns_proxy_get_cellid(const ompi_process_name_t* name);
|
||||
|
||||
/*
|
||||
* Implementation of compare()
|
||||
*/
|
||||
int ns_proxy_compare(ompi_ns_cmp_bitmask_t fields,
|
||||
const ompi_process_name_t* name1,
|
||||
const ompi_process_name_t* name2);
|
||||
|
||||
#endif
|
167
src/mca/ns/proxy/src/ns_proxy_module.c
Обычный файл
167
src/mca/ns/proxy/src/ns_proxy_module.c
Обычный файл
@ -0,0 +1,167 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* $HEADER$
|
||||
*/
|
||||
/** @file:
|
||||
*
|
||||
* The Open MPI Name Server
|
||||
*
|
||||
* The Open MPI Name Server provides unique name ranges for processes
|
||||
* within the universe. Each universe will have one name server
|
||||
* running within the seed daemon. This is done to prevent the
|
||||
* inadvertent duplication of names.
|
||||
*/
|
||||
|
||||
/*
|
||||
* includes
|
||||
*/
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "include/constants.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "mca/mca.h"
|
||||
#include "mca/ns/base/base.h"
|
||||
#include "ns_proxy.h"
|
||||
|
||||
|
||||
/*
|
||||
* Struct of function pointers that need to be initialized
|
||||
*/
|
||||
mca_ns_base_component_t mca_ns_proxy_module = {
|
||||
{
|
||||
MCA_NS_BASE_VERSION_1_0_0,
|
||||
|
||||
"proxy", /* MCA module name */
|
||||
1, /* MCA module major version */
|
||||
0, /* MCA module minor version */
|
||||
0, /* MCA module release version */
|
||||
mca_ns_proxy_open, /* module open */
|
||||
mca_ns_proxy_close /* module close */
|
||||
},
|
||||
{
|
||||
false /* checkpoint / restart */
|
||||
},
|
||||
mca_ns_proxy_init, /* module init */
|
||||
mca_ns_proxy_finalize /* module shutdown */
|
||||
};
|
||||
|
||||
/*
|
||||
* setup the function pointers for the module
|
||||
*/
|
||||
static mca_ns_t mca_ns_proxy = {
|
||||
ns_proxy_create_cellid,
|
||||
ns_proxy_create_jobid,
|
||||
ns_base_create_process_name,
|
||||
ns_proxy_reserve_range,
|
||||
ns_proxy_free_name,
|
||||
ns_base_get_proc_name_string,
|
||||
ns_base_get_vpid_string,
|
||||
ns_base_get_jobid_string,
|
||||
ns_base_get_cellid_string,
|
||||
ns_base_get_vpid,
|
||||
ns_base_get_jobid,
|
||||
ns_base_get_cellid,
|
||||
ns_base_compare
|
||||
};
|
||||
|
||||
/*
|
||||
* Whether or not we allowed this component to be selected
|
||||
*/
|
||||
static bool initialized = false;
|
||||
|
||||
|
||||
/* constructor - used to initialize state of name_tracker instance */
|
||||
static void ompi_name_tracker_construct(ompi_name_tracker_t* name_tracker)
|
||||
{
|
||||
name_tracker->job = 0;
|
||||
name_tracker->last_used_vpid = 0;
|
||||
}
|
||||
|
||||
/* destructor - used to free any resources held by instance */
|
||||
static void ompi_name_tracker_destructor(ompi_name_tracker_t* name_tracker)
|
||||
{
|
||||
}
|
||||
|
||||
/* define instance of ompi_class_t */
|
||||
OBJ_CLASS_INSTANCE(
|
||||
ompi_name_tracker_t, /* type name */
|
||||
ompi_list_item_t, /* parent "class" name */
|
||||
ompi_name_tracker_construct, /* constructor */
|
||||
ompi_name_tracker_destructor); /* destructor */
|
||||
|
||||
/*
|
||||
* globals needed within proxy component
|
||||
*/
|
||||
ompi_process_id_t last_used_cellid;
|
||||
ompi_process_id_t last_used_jobid;
|
||||
ompi_list_t ompi_name_tracker;
|
||||
|
||||
/*
|
||||
* don't really need this function - could just put NULL in the above structure
|
||||
* Just holding the place in case we decide there is something we need to do
|
||||
*/
|
||||
int mca_ns_proxy_open(void)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* ditto for this one
|
||||
*/
|
||||
int mca_ns_proxy_close(void)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
mca_ns_t* mca_ns_proxy_init(bool *allow_multi_user_threads, bool *have_hidden_threads, int *priority)
|
||||
{
|
||||
/* If we're NOT the seed, then we want to be selected, so do all
|
||||
the setup and return the module */
|
||||
|
||||
if (!ompi_process_info.seed) {
|
||||
|
||||
last_used_cellid = 0;
|
||||
last_used_jobid = 0;
|
||||
|
||||
/* Return a module (choose an arbitrary, positive priority --
|
||||
it's only relevant compared to other ns components). If
|
||||
we're not the seed, then we don't want to be selected, so
|
||||
return NULL. */
|
||||
|
||||
*priority = 50;
|
||||
|
||||
/* We allow multi user threads but don't have any hidden threads */
|
||||
|
||||
*allow_multi_user_threads = true;
|
||||
*have_hidden_threads = false;
|
||||
|
||||
/* initialize the name tracker */
|
||||
|
||||
OBJ_CONSTRUCT(&ompi_name_tracker, ompi_list_t);
|
||||
|
||||
/* Return the module */
|
||||
|
||||
initialized = true;
|
||||
return &mca_ns_proxy;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* finalize routine
|
||||
*/
|
||||
int mca_ns_proxy_finalize(void)
|
||||
{
|
||||
/* free all tracking storage, but only if this component was initialized */
|
||||
|
||||
if (initialized) {
|
||||
OBJ_DESTRUCT(&ompi_name_tracker);
|
||||
|
||||
initialized = false;
|
||||
}
|
||||
|
||||
/* All done */
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
6
src/mca/ns/replica/VERSION
Обычный файл
6
src/mca/ns/replica/VERSION
Обычный файл
@ -0,0 +1,6 @@
|
||||
major=1
|
||||
minor=0
|
||||
release=0
|
||||
alpha=0
|
||||
beta=0
|
||||
svn=1
|
Загрузка…
Ссылка в новой задаче
Block a user