* add shell of a wmi (Windows Management Interface?) pcm for Anju to hack
on. Does not work at all, so .ompi_ignored This commit was SVN r2681.
Этот коммит содержится в:
родитель
b3aca01d1a
Коммит
15d7c000c4
0
src/mca/pcm/wmi/.ompi_ignore
Обычный файл
0
src/mca/pcm/wmi/.ompi_ignore
Обычный файл
32
src/mca/pcm/wmi/Makefile.am
Обычный файл
32
src/mca/pcm/wmi/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_pcm_wmi_DSO
|
||||
component_noinst =
|
||||
component_install = mca_pcm_wmi.la
|
||||
else
|
||||
component_noinst = libmca_pcm_wmi.la
|
||||
component_install =
|
||||
endif
|
||||
|
||||
mcacomponentdir = $(libdir)/openmpi
|
||||
mcacomponent_LTLIBRARIES = $(component_install)
|
||||
mca_pcm_wmi_la_SOURCES =
|
||||
mca_pcm_wmi_la_LIBADD = src/libmca_pcm_wmi.la
|
||||
mca_pcm_wmi_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
noinst_LTLIBRARIES = $(component_noinst)
|
||||
libmca_pcm_wmi_la_SOURCES =
|
||||
libmca_pcm_wmi_la_LIBADD = src/libmca_pcm_wmi.la
|
||||
libmca_pcm_wmi_la_LDFLAGS = -module -avoid-version
|
10
src/mca/pcm/wmi/configure.params
Обычный файл
10
src/mca/pcm/wmi/configure.params
Обычный файл
@ -0,0 +1,10 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
# Specific to this module
|
||||
|
||||
PARAM_INIT_FILE=src/pcm_wmi.c
|
||||
PARAM_CONFIG_HEADER_FILE="src/wmi_config.h"
|
||||
PARAM_CONFIG_FILES="Makefile src/Makefile"
|
12
src/mca/pcm/wmi/configure.stub
Обычный файл
12
src/mca/pcm/wmi/configure.stub
Обычный файл
@ -0,0 +1,12 @@
|
||||
# -*- shell-script -*-
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
#
|
||||
# Main function. This will be invoked in the middle of the templated
|
||||
# configure script.
|
||||
#
|
||||
AC_DEFUN([MCA_CONFIGURE_STUB],[
|
||||
AC_MSG_ERROR([Anju needs to fill me in])
|
||||
])dnl
|
14
src/mca/pcm/wmi/src/Makefile.am
Обычный файл
14
src/mca/pcm/wmi/src/Makefile.am
Обычный файл
@ -0,0 +1,14 @@
|
||||
#
|
||||
# $HEADER$
|
||||
#
|
||||
|
||||
include $(top_ompi_srcdir)/config/Makefile.options
|
||||
|
||||
AM_CPPFLAGS = -I$(top_ompi_builddir)/src/include \
|
||||
-I$(top_ompi_srcdir)/src -I$(top_ompi_srcdir)/src/include
|
||||
|
||||
noinst_LTLIBRARIES = libmca_pcm_wmi.la
|
||||
libmca_pcm_wmi_la_SOURCES = \
|
||||
pcm_wmi.c \
|
||||
pcm_wmi.h \
|
||||
pcm_wmi_component.c
|
61
src/mca/pcm/wmi/src/pcm_wmi.c
Обычный файл
61
src/mca/pcm/wmi/src/pcm_wmi.c
Обычный файл
@ -0,0 +1,61 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "pcm_wmi.h"
|
||||
#include "mca/pcm/pcm.h"
|
||||
#include "mca/pcm/base/base.h"
|
||||
#include "class/ompi_list.h"
|
||||
|
||||
|
||||
ompi_list_t *
|
||||
mca_pcm_wmi_allocate_resources(struct mca_pcm_base_module_1_0_0_t* me,
|
||||
mca_ns_base_jobid_t jobid,
|
||||
int nodes, int procs)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
mca_pcm_wmi_can_spawn(struct mca_pcm_base_module_1_0_0_t* me)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_pcm_wmi_spawn_procs(struct mca_pcm_base_module_1_0_0_t* me,
|
||||
mca_ns_base_jobid_t jobid, ompi_list_t *schedlist)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_pcm_wmi_kill_proc(struct mca_pcm_base_module_1_0_0_t* me,
|
||||
ompi_process_name_t *name, int flags)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_pcm_wmi_kill_job(struct mca_pcm_base_module_1_0_0_t* me,
|
||||
mca_ns_base_jobid_t jobid, int flags)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_pcm_wmi_deallocate_resources(struct mca_pcm_base_module_1_0_0_t* me,
|
||||
mca_ns_base_jobid_t jobid,
|
||||
ompi_list_t *nodelist)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
100
src/mca/pcm/wmi/src/pcm_wmi.h
Обычный файл
100
src/mca/pcm/wmi/src/pcm_wmi.h
Обычный файл
@ -0,0 +1,100 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
* BWB: COMPONENT TODO
|
||||
*
|
||||
* - add process reaping code
|
||||
* - trigger status change events on process death
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "mca/pcm/pcm.h"
|
||||
#include "include/types.h"
|
||||
#include "class/ompi_list.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifndef MCA_PCM_BPROC_H_
|
||||
#define MCA_PCM_BPROC_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Module open / close
|
||||
*/
|
||||
int mca_pcm_bproc_component_open(void);
|
||||
int mca_pcm_bproc_component_close(void);
|
||||
|
||||
/*
|
||||
* Startup / Shutdown
|
||||
*/
|
||||
struct mca_pcm_base_module_1_0_0_t* mca_pcm_bproc_init(int *priority,
|
||||
bool *allow_multi_user_threads,
|
||||
bool *have_hidden_threads,
|
||||
int constraints);
|
||||
int mca_pcm_bproc_finalize(struct mca_pcm_base_module_1_0_0_t* me);
|
||||
|
||||
/*
|
||||
* Interface
|
||||
*/
|
||||
ompi_list_t* mca_pcm_bproc_allocate_resources(struct mca_pcm_base_module_1_0_0_t* me,
|
||||
mca_ns_base_jobid_t jobid,
|
||||
int nodes, int procs);
|
||||
bool mca_pcm_bproc_can_spawn(struct mca_pcm_base_module_1_0_0_t* me);
|
||||
int mca_pcm_bproc_spawn_procs(struct mca_pcm_base_module_1_0_0_t* me,
|
||||
mca_ns_base_jobid_t jobid, ompi_list_t *schedule_list);
|
||||
int mca_pcm_bproc_kill_proc(struct mca_pcm_base_module_1_0_0_t* me,
|
||||
ompi_process_name_t *name, int flags);
|
||||
int mca_pcm_bproc_kill_job(struct mca_pcm_base_module_1_0_0_t* me,
|
||||
mca_ns_base_jobid_t jobid, int flags);
|
||||
int mca_pcm_bproc_deallocate_resources(struct mca_pcm_base_module_1_0_0_t* me,
|
||||
mca_ns_base_jobid_t jobid,
|
||||
ompi_list_t *nodelist);
|
||||
|
||||
/*
|
||||
* Job management code
|
||||
*/
|
||||
void mca_pcm_bproc_job_list_init(void);
|
||||
void mca_pcm_bproc_job_list_fini(void);
|
||||
|
||||
int mca_pcm_bproc_add_started_pids(mca_ns_base_jobid_t jobid, pid_t child_pid,
|
||||
mca_ns_base_vpid_t lower, mca_ns_base_vpid_t upper);
|
||||
pid_t mca_pcm_bproc_get_started_pid(mca_ns_base_jobid_t jobid, mca_ns_base_vpid_t vpid,
|
||||
bool remove_started_pid);
|
||||
int mca_pcm_bproc_get_started_pid_list(mca_ns_base_jobid_t jobid, pid_t **pids, size_t *len,
|
||||
bool remove_started_pids);
|
||||
int mca_pcm_bproc_remove_job(mca_ns_base_jobid_t jobid);
|
||||
|
||||
struct mca_pcm_bproc_pids_t {
|
||||
ompi_list_item_t super;
|
||||
mca_ns_base_vpid_t lower;
|
||||
mca_ns_base_vpid_t upper;
|
||||
pid_t child;
|
||||
};
|
||||
typedef struct mca_pcm_bproc_pids_t mca_pcm_bproc_pids_t;
|
||||
OBJ_CLASS_DECLARATION(mca_pcm_bproc_pids_t);
|
||||
|
||||
struct mca_pcm_bproc_job_item_t {
|
||||
ompi_list_item_t super;
|
||||
mca_ns_base_jobid_t jobid;
|
||||
ompi_list_t *pids;
|
||||
};
|
||||
typedef struct mca_pcm_bproc_job_item_t mca_pcm_bproc_job_item_t;
|
||||
OBJ_CLASS_DECLARATION(mca_pcm_bproc_job_item_t);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Module variables
|
||||
*/
|
||||
extern int mca_pcm_bproc_output;
|
||||
extern int mca_pcm_bproc_use_ns;
|
||||
|
||||
#endif /* MCA_PCM_BPROC_H_ */
|
132
src/mca/pcm/wmi/src/pcm_wmi_component.c
Обычный файл
132
src/mca/pcm/wmi/src/pcm_wmi_component.c
Обычный файл
@ -0,0 +1,132 @@
|
||||
/* -*- C -*-
|
||||
*
|
||||
* $HEADER$
|
||||
*
|
||||
*/
|
||||
|
||||
#include "ompi_config.h"
|
||||
|
||||
#include "pcm_wmi.h"
|
||||
#include "include/constants.h"
|
||||
#include "include/types.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/llm/base/base.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_pcm_base_component_1_0_0_t mca_pcm_wmi_component = {
|
||||
{
|
||||
MCA_PCM_BASE_VERSION_1_0_0,
|
||||
|
||||
"wmi", /* MCA component name */
|
||||
1, /* MCA component major version */
|
||||
0, /* MCA component minor version */
|
||||
0, /* MCA component release version */
|
||||
mca_pcm_wmi_component_open, /* component open */
|
||||
mca_pcm_wmi_component_close /* component close */
|
||||
},
|
||||
{
|
||||
false /* checkpoint / restart */
|
||||
},
|
||||
mca_pcm_wmi_init, /* component init */
|
||||
NULL /* unique name */
|
||||
};
|
||||
|
||||
|
||||
struct mca_pcm_base_module_1_0_0_t mca_pcm_wmi_1_0_0 = {
|
||||
mca_pcm_wmi_allocate_resources,
|
||||
mca_pcm_wmi_can_spawn,
|
||||
mca_pcm_wmi_spawn_procs,
|
||||
mca_pcm_wmi_kill_proc,
|
||||
mca_pcm_wmi_kill_job,
|
||||
mca_pcm_wmi_deallocate_resources,
|
||||
mca_pcm_wmi_finalize
|
||||
};
|
||||
|
||||
|
||||
/* need to create output stream to dump in file */
|
||||
ompi_output_stream_t mca_pcm_wmi_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: wmi: ", /* lds_prefix */
|
||||
true, /* lds_want_stdout */
|
||||
false, /* lds_want_stderr */
|
||||
true, /* lds_want_file */
|
||||
true, /* lds_want_file_append */
|
||||
"pcm_wmi" /* lds_file_suffix */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Module variables handles
|
||||
*/
|
||||
static int mca_pcm_wmi_param_priority;
|
||||
static int mca_pcm_wmi_param_debug;
|
||||
|
||||
/*
|
||||
* Component variables. All of these are shared among the module
|
||||
* instances, so they don't need to go in a special structure or
|
||||
* anything.
|
||||
*/
|
||||
int mca_pcm_wmi_output = 0;
|
||||
|
||||
int
|
||||
mca_pcm_wmi_component_open(void)
|
||||
{
|
||||
mca_pcm_wmi_param_debug =
|
||||
mca_base_param_register_int("pcm", "wmi", "debug", NULL, 100);
|
||||
|
||||
mca_pcm_wmi_param_priority =
|
||||
mca_base_param_register_int("pcm", "wmi", "priority", NULL, 5);
|
||||
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_pcm_wmi_component_close(void)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
mca_pcm_base_module_t*
|
||||
mca_pcm_wmi_init(int *priority,
|
||||
bool *allow_multi_user_threads,
|
||||
bool *have_hidden_threads,
|
||||
int constraints)
|
||||
{
|
||||
int debug;
|
||||
|
||||
mca_base_param_lookup_int(mca_pcm_wmi_param_debug, &debug);
|
||||
mca_pcm_wmi_output = ompi_output_open(&mca_pcm_wmi_output_stream);
|
||||
ompi_output_set_verbosity(mca_pcm_wmi_output, debug);
|
||||
|
||||
mca_base_param_lookup_int(mca_pcm_wmi_param_priority, priority);
|
||||
|
||||
*allow_multi_user_threads = true;
|
||||
*have_hidden_threads = false;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
mca_pcm_wmi_finalize(struct mca_pcm_base_module_1_0_0_t* me)
|
||||
{
|
||||
return OMPI_SUCCESS;
|
||||
}
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user