* quick hack at a client side to RMS support
This commit was SVN r2251.
Этот коммит содержится в:
родитель
b7aeaae3a3
Коммит
bf039d2b01
37
src/mca/pcmclient/rms/Makefile.am
Обычный файл
37
src/mca/pcmclient/rms/Makefile.am
Обычный файл
@ -0,0 +1,37 @@
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# Use the top-level Makefile.options
|
||||
|
||||
include $(top_ompi_srcdir)/config/Makefile.options
|
||||
|
||||
EXTRA_DIST = VERSION
|
||||
|
||||
sources = \
|
||||
pcmclient_rms.h \
|
||||
pcmclient_rms.c \
|
||||
pcmclient_rms_component.c
|
||||
|
||||
# Make the output library in this directory, and name it either
|
||||
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la
|
||||
# (for static builds).
|
||||
|
||||
if OMPI_BUILD_pcmclient_rms_DSO
|
||||
component_noinst =
|
||||
component_install = mca_pcmclient_rms.la
|
||||
else
|
||||
component_noinst = libmca_pcmclient_rms.la
|
||||
component_install =
|
||||
endif
|
||||
|
||||
mcacomponentdir = $(libdir)/openmpi
|
||||
mcacomponent_LTLIBRARIES = $(component_install)
|
||||
mca_pcmclient_rms_la_SOURCES = $(sources)
|
||||
mca_pcmclient_rms_la_LIBADD =
|
||||
mca_pcmclient_rms_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
noinst_LTLIBRARIES = $(component_noinst)
|
||||
libmca_pcmclient_rms_la_SOURCES = $(sources)
|
||||
libmca_pcmclient_rms_la_LIBADD =
|
||||
libmca_pcmclient_rms_la_LDFLAGS = -module -avoid-version
|
6
src/mca/pcmclient/rms/VERSION
Обычный файл
6
src/mca/pcmclient/rms/VERSION
Обычный файл
@ -0,0 +1,6 @@
|
||||
major=1
|
||||
minor=0
|
||||
release=0
|
||||
alpha=0
|
||||
beta=0
|
||||
svn=1
|
9
src/mca/pcmclient/rms/configure.params
Обычный файл
9
src/mca/pcmclient/rms/configure.params
Обычный файл
@ -0,0 +1,9 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# Specific to this module
|
||||
|
||||
PARAM_INIT_FILE=pcmclient_rms_component.c
|
||||
PARAM_CONFIG_FILES="Makefile"
|
39
src/mca/pcmclient/rms/pcmclient_rms.c
Обычный файл
39
src/mca/pcmclient/rms/pcmclient_rms.c
Обычный файл
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "mca/pcmclient/pcmclient.h"
|
||||
#include "mca/pcmclient/rms/pcmclient_rms.h"
|
||||
#include "include/types.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
extern int mca_pcmclient_rms_num_procs;
|
||||
extern int mca_pcmclient_rms_procid;
|
||||
extern ompi_process_name_t *mca_pcmclient_rms_procs;
|
||||
|
||||
|
||||
int
|
||||
mca_pcmclient_rms_get_peers(ompi_process_name_t **procs,
|
||||
size_t *num_procs)
|
||||
{
|
||||
if (NULL == mca_pcmclient_rms_procs) return OMPI_ERROR;
|
||||
|
||||
*num_procs = mca_pcmclient_rms_num_procs;
|
||||
*procs = mca_pcmclient_rms_procs;
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
ompi_process_name_t*
|
||||
mca_pcmclient_rms_get_self(void)
|
||||
{
|
||||
if (NULL == mca_pcmclient_rms_procs) return NULL;
|
||||
|
||||
return &mca_pcmclient_rms_procs[mca_pcmclient_rms_procid];
|
||||
}
|
29
src/mca/pcmclient/rms/pcmclient_rms.h
Обычный файл
29
src/mca/pcmclient/rms/pcmclient_rms.h
Обычный файл
@ -0,0 +1,29 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "mca/pcmclient/pcmclient.h"
|
||||
#include "include/types.h"
|
||||
|
||||
/*
|
||||
* Module open / close
|
||||
*/
|
||||
int mca_pcmclient_rms_open(void);
|
||||
int mca_pcmclient_rms_close(void);
|
||||
|
||||
/*
|
||||
* Startup / Shutdown
|
||||
*/
|
||||
struct mca_pcmclient_base_module_1_0_0_t* mca_pcmclient_rms_init(int *priority, bool *allow_multi_user_threads, bool *have_hidden_threads);
|
||||
int mca_pcmclient_rms_finalize(void);
|
||||
|
||||
|
||||
/*
|
||||
* "Action" functions
|
||||
*/
|
||||
int mca_pcmclient_rms_get_peers(ompi_process_name_t **peers, size_t *npeers);
|
||||
ompi_process_name_t* mca_pcmclient_rms_get_self(void);
|
||||
|
124
src/mca/pcmclient/rms/pcmclient_rms_component.c
Обычный файл
124
src/mca/pcmclient/rms/pcmclient_rms_component.c
Обычный файл
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* $HEADER$
|
||||
*/
|
||||
|
||||
|
||||
#include "ompi_config.h"
|
||||
#include "pcmclient-rms-version.h"
|
||||
|
||||
#include "include/constants.h"
|
||||
#include "include/types.h"
|
||||
#include "mca/mca.h"
|
||||
#include "mca/pcmclient/pcmclient.h"
|
||||
#include "mca/pcmclient/rms/pcmclient_rms.h"
|
||||
#include "util/proc_info.h"
|
||||
#include "mca/base/mca_base_param.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_pcmclient_base_component_1_0_0_t mca_pcmclient_rms_component = {
|
||||
{
|
||||
MCA_PCMCLIENT_BASE_VERSION_1_0_0,
|
||||
|
||||
"rms", /* MCA component name */
|
||||
MCA_pcmclient_rms_MAJOR_VERSION, /* MCA component major version */
|
||||
MCA_pcmclient_rms_MINOR_VERSION, /* MCA component minor version */
|
||||
MCA_pcmclient_rms_RELEASE_VERSION, /* MCA component release version */
|
||||
mca_pcmclient_rms_open, /* component open */
|
||||
mca_pcmclient_rms_close /* component close */
|
||||
},
|
||||
{
|
||||
false /* checkpoint / restart */
|
||||
},
|
||||
mca_pcmclient_rms_init, /* component init */
|
||||
mca_pcmclient_rms_finalize
|
||||
};
|
||||
|
||||
|
||||
struct mca_pcmclient_base_module_1_0_0_t mca_pcmclient_rms_1_0_0 = {
|
||||
mca_pcmclient_rms_get_self,
|
||||
mca_pcmclient_rms_get_peers,
|
||||
};
|
||||
|
||||
int mca_pcmclient_rms_cellid;
|
||||
int mca_pcmclient_rms_jobid;
|
||||
int mca_pcmclient_rms_num_procs;
|
||||
int mca_pcmclient_rms_procid;
|
||||
|
||||
ompi_process_name_t *mca_pcmclient_rms_procs = NULL;
|
||||
|
||||
int
|
||||
mca_pcmclient_rms_open(void)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_pcmclient_rms_close(void)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
struct mca_pcmclient_base_module_1_0_0_t *
|
||||
mca_pcmclient_rms_init(int *priority,
|
||||
bool *allow_multiple_user_threads,
|
||||
bool *have_hidden_threads)
|
||||
{
|
||||
int i;
|
||||
char *tmp;
|
||||
|
||||
*priority = 5; /* make sure we are above env / singleton */
|
||||
*allow_multiple_user_threads = true;
|
||||
*have_hidden_threads = false;
|
||||
|
||||
/* BWB: Fix me */
|
||||
mca_pcmclient_rms_cellid = 0;
|
||||
|
||||
tmp = getenv("RMS_JOBID");
|
||||
if (NULL == tmp) return NULL;
|
||||
mca_pcmclient_rms_jobid = atoi(tmp);
|
||||
|
||||
tmp = getenv("RMS_RANK");
|
||||
if (NULL == tmp) return NULL;
|
||||
mca_pcmclient_rms_procid = atoi(tmp);
|
||||
|
||||
tmp = getenv("RMS_NPROCS");
|
||||
if (NULL == tmp) return NULL;
|
||||
mca_pcmclient_rms_num_procs = atoi(tmp);
|
||||
|
||||
mca_pcmclient_rms_procs =
|
||||
(ompi_process_name_t*) malloc(sizeof(ompi_process_name_t) *
|
||||
mca_pcmclient_rms_num_procs);
|
||||
if (NULL == mca_pcmclient_rms_procs) return NULL;
|
||||
|
||||
for ( i = 0 ; i < mca_pcmclient_rms_num_procs ; ++i) {
|
||||
mca_pcmclient_rms_procs[i].cellid = mca_pcmclient_rms_cellid;
|
||||
mca_pcmclient_rms_procs[i].jobid = mca_pcmclient_rms_jobid;
|
||||
mca_pcmclient_rms_procs[i].vpid = i;
|
||||
}
|
||||
|
||||
return &mca_pcmclient_rms_1_0_0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_pcmclient_rms_finalize(void)
|
||||
{
|
||||
if (NULL != mca_pcmclient_rms_procs) {
|
||||
free(mca_pcmclient_rms_procs);
|
||||
mca_pcmclient_rms_procs = NULL;
|
||||
mca_pcmclient_rms_num_procs = 0;
|
||||
}
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user