1
1

* add shell of rms pcm, ignored for now.

This commit was SVN r2494.
Этот коммит содержится в:
Brian Barrett 2004-09-03 19:56:02 +00:00
родитель 6fa0e03a4d
Коммит 5ff158cdbe
6 изменённых файлов: 303 добавлений и 0 удалений

0
src/mca/pcm/rms/.ompi_ignore Обычный файл
Просмотреть файл

35
src/mca/pcm/rms/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,35 @@
#
# $HEADER$
#
# Use the top-level Makefile.options
include $(top_ompi_srcdir)/config/Makefile.options
sources = \
pcm_rms.h \
pcm_rms.c \
pcm_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_pcm_rms_DSO
component_noinst =
component_install = mca_pcm_rms.la
else
component_noinst = libmca_pcm_rms.la
component_install =
endif
mcacomponentdir = $(libdir)/openmpi
mcacomponent_LTLIBRARIES = $(component_install)
mca_pcm_rms_la_SOURCES = $(sources)
mca_pcm_rms_la_LIBADD =
mca_pcm_rms_la_LDFLAGS = -module -avoid-version
noinst_LTLIBRARIES = $(component_noinst)
libmca_pcm_rms_la_SOURCES = $(sources)
libmca_pcm_rms_la_LIBADD =
libmca_pcm_rms_la_LDFLAGS = -module -avoid-version

9
src/mca/pcm/rms/configure.params Обычный файл
Просмотреть файл

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

60
src/mca/pcm/rms/pcm_rms.c Обычный файл
Просмотреть файл

@ -0,0 +1,60 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "include/constants.h"
#include "mca/pcm/pcm.h"
#include "mca/pcm/base/base.h"
#include "mca/pcm/rms/pcm_rms.h"
#include "event/event.h"
ompi_list_t *
mca_pcm_rms_allocate_resources(int jobid,
int nodes, int procs)
{
return NULL;
}
bool
mca_pcm_rms_can_spawn(void)
{
/* it looks like a prun'd job can call prun again... let's see
what happens for now.. */
return true;
}
int
mca_pcm_rms_spawn_procs(int jobid, ompi_list_t *schedlist)
{
return OMPI_SUCCESS;
}
int
mca_pcm_rms_kill_proc(ompi_process_name_t *name, int flags)
{
return OMPI_SUCCESS;
}
int
mca_pcm_rms_kill_job(int jobid, int flags)
{
return OMPI_SUCCESS;
}
int
mca_pcm_rms_deallocate_resources(int jobid,
ompi_list_t *nodelist)
{
return OMPI_SUCCESS;
}

56
src/mca/pcm/rms/pcm_rms.h Обычный файл
Просмотреть файл

@ -0,0 +1,56 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "mca/pcm/pcm.h"
#include "include/types.h"
#include <sys/types.h>
#ifndef MCA_PCM_RMS_H_
#define MCA_PCM_RMS_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* Module open / close
*/
int mca_pcm_rms_component_open(void);
int mca_pcm_rms_component_close(void);
/*
* Startup / Shutdown
*/
struct mca_pcm_base_module_1_0_0_t* mca_pcm_rms_init(int *priority,
bool *allow_multi_user_threads,
bool *have_hidden_threads);
int mca_pcm_rms_finalize(void);
/*
* Interface
*/
ompi_list_t* mca_pcm_rms_allocate_resources(int jobid,
int nodes, int procs);
bool mca_pcm_rms_can_spawn(void);
int mca_pcm_rms_spawn_procs(int jobid, ompi_list_t *schedule_list);
int mca_pcm_rms_kill_proc(ompi_process_name_t *name, int flags);
int mca_pcm_rms_kill_job(int jobid, int flags);
int mca_pcm_rms_deallocate_resources(int jobid,
ompi_list_t *nodelist);
#ifdef __cplusplus
}
#endif
/*
* Module variables
*/
extern int mca_pcm_rms_output;
#endif /* MCA_PCM_RMS_H_ */

143
src/mca/pcm/rms/pcm_rms_component.c Обычный файл
Просмотреть файл

@ -0,0 +1,143 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "include/constants.h"
#include "include/types.h"
#include "util/malloc.h"
#include "util/output.h"
#include "class/ompi_list.h"
#include "mca/mca.h"
#include "mca/base/mca_base_param.h"
#include "mca/pcm/pcm.h"
#include "mca/pcm/base/base.h"
#include "mca/pcm/rms/pcm_rms.h"
#include "mca/llm/base/base.h"
#include "util/path.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
extern char **environ;
/*
* Struct of function pointers and all that to let us be initialized
*/
mca_pcm_base_component_1_0_0_t mca_pcm_rms_component = {
{
MCA_PCM_BASE_VERSION_1_0_0,
"rms", /* MCA component name */
1, /* MCA component major version */
0, /* MCA component minor version */
0, /* MCA component release version */
mca_pcm_rms_component_open, /* component open */
mca_pcm_rms_component_close /* component close */
},
{
false /* checkpoint / restart */
},
mca_pcm_rms_init, /* component init */
mca_pcm_rms_finalize
};
struct mca_pcm_base_module_1_0_0_t mca_pcm_rms_1_0_0 = {
mca_pcm_base_no_unique_name,
mca_pcm_rms_allocate_resources,
mca_pcm_rms_can_spawn,
mca_pcm_rms_spawn_procs,
mca_pcm_rms_kill_proc,
mca_pcm_rms_kill_job,
mca_pcm_rms_deallocate_resources
};
/* need to create output stream to dump in file */
ompi_output_stream_t mca_pcm_rms_output_stream = {
false, /* lds_is_debugging BWB - change me for release */
0, /* lds_verbose_level */
false, /* lds_want_syslog */
0, /* lds_syslog_priority */
NULL, /* lds_syslog_ident */
"pcm: rms: ", /* lds_prefix */
true, /* lds_want_stdout */
false, /* lds_want_stderr */
true, /* lds_want_file */
true, /* lds_want_file_append */
"pcm_rms" /* lds_file_suffix */
};
/*
* Module variables handles
*/
static int mca_pcm_rms_param_priority;
static int mca_pcm_rms_param_debug;
/*
* Module variables
*/
int mca_pcm_rms_output = 0;
int
mca_pcm_rms_component_open(void)
{
mca_pcm_rms_param_debug =
mca_base_param_register_int("pcm", "rms", "debug", NULL, 100);
mca_pcm_rms_param_priority =
mca_base_param_register_int("pcm", "rms", "priority", NULL, 0);
return OMPI_SUCCESS;
}
int
mca_pcm_rms_component_close(void)
{
return OMPI_SUCCESS;
}
mca_pcm_base_module_t*
mca_pcm_rms_init(int *priority,
bool *allow_multi_user_threads,
bool *have_hidden_threads)
{
int debug;
char *prun;
mca_base_param_lookup_int(mca_pcm_rms_param_debug, &debug);
mca_pcm_rms_output = ompi_output_open(&mca_pcm_rms_output_stream);
ompi_output_set_verbosity(mca_pcm_rms_output, debug);
mca_base_param_lookup_int(mca_pcm_rms_param_priority, priority);
*allow_multi_user_threads = true;
*have_hidden_threads = false;
/* poke around for prun */
prun = ompi_path_env_findv("prun", X_OK, environ, NULL);
if (NULL == prun) return NULL;
return &mca_pcm_rms_1_0_0;
}
int
mca_pcm_rms_finalize(void)
{
if (mca_pcm_rms_output > 0) {
ompi_output_close(mca_pcm_rms_output);
}
return OMPI_SUCCESS;
}