1
1

* split the PCM into pcm and pcmclient to better match to the multi-pcm case

* add env pcmclient, which builds client data out of environment variables
* improved rsh infrastructure a little bit - almost able to get to calling
  fork()
* Removed instance information for llm - it should be burried in the pcm,
  not exposed


*** YOU MUST RUN AUTOGEN / CONFIGURE / etc AFTER UPDATING ***

This commit was SVN r2191.
Этот коммит содержится в:
Brian Barrett 2004-08-17 22:24:17 +00:00
родитель d5133eddec
Коммит 7f3f72f1c7
69 изменённых файлов: 1432 добавлений и 771 удалений

Просмотреть файл

@ -55,7 +55,7 @@ fi
# The list of MCA types (it's fixed)
AC_MSG_CHECKING([for MCA types])
found_types="common allocator coll gpr io llm mpool ns one oob op pcm pml ptl topo"
found_types="common allocator coll gpr io llm mpool ns one oob op pcm pcmclient pml ptl topo"
AC_MSG_RESULT([$found_types])
# Get the list of all the non-configure MCA components that were found by
@ -268,6 +268,11 @@ AC_SUBST(MCA_pcm_STATIC_SUBDIRS)
AC_SUBST(MCA_pcm_DSO_SUBDIRS)
AC_SUBST(MCA_pcm_STATIC_LTLIBS)
AC_SUBST(MCA_pcmclient_ALL_SUBDIRS)
AC_SUBST(MCA_pcmclient_STATIC_SUBDIRS)
AC_SUBST(MCA_pcmclient_DSO_SUBDIRS)
AC_SUBST(MCA_pcmclient_STATIC_LTLIBS)
AC_SUBST(MCA_gpr_ALL_SUBDIRS)
AC_SUBST(MCA_gpr_STATIC_SUBDIRS)
AC_SUBST(MCA_gpr_DSO_SUBDIRS)

Просмотреть файл

@ -869,6 +869,8 @@ AC_CONFIG_FILES([
src/mca/oob/base/Makefile
src/mca/pcm/Makefile
src/mca/pcm/base/Makefile
src/mca/pcmclient/Makefile
src/mca/pcmclient/base/Makefile
src/mca/llm/Makefile
src/mca/llm/base/Makefile
@ -898,6 +900,7 @@ AC_CONFIG_FILES([
src/dynamic-mca/oob/Makefile
src/dynamic-mca/pcm/Makefile
src/dynamic-mca/pcmclient/Makefile
src/dynamic-mca/llm/Makefile
src/dynamic-mca/Makefile
@ -922,6 +925,7 @@ AC_CONFIG_FILES([
src/mpi/runtime/Makefile
src/tools/Makefile
src/tools/bootproxy/Makefile
src/tools/ompid/Makefile
src/tools/ompi_info/Makefile
src/tools/mpirun/Makefile

Просмотреть файл

@ -103,6 +103,7 @@ libmpi_la_LIBADD = \
mca/ns/base/libmca_ns_base.la $(MCA_ns_STATIC_LTLIBS) \
mca/oob/base/libmca_oob_base.la $(MCA_oob_STATIC_LTLIBS) \
mca/pcm/base/libmca_pcm_base.la $(MCA_pcm_STATIC_LTLIBS) \
mca/pcmclient/base/libmca_pcmclient_base.la $(MCA_pcmclient_STATIC_LTLIBS) \
mca/pml/base/libmca_pml_base.la $(MCA_pml_STATIC_LTLIBS) \
mca/ptl/base/libmca_ptl_base.la $(MCA_ptl_STATIC_LTLIBS) \
mca/topo/base/libmca_topo_base.la $(MCA_topo_STATIC_LTLIBS) \

Просмотреть файл

@ -15,6 +15,7 @@ SUBDIRS = \
one \
oob \
pcm \
pcmclient \
pml \
ptl \
topo

14
src/dynamic-mca/pcmclient/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,14 @@
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
SUBDIRS = $(MCA_pcmclient_DSO_SUBDIRS)
DISTCLEANFILES = $(SUBDIRS)
# Every directory under here is a sym link to something in the main
# share/ssi tree. Hence, we don't want to distribute anything under
# here.
DIST_SUBDIRS =

Просмотреть файл

@ -17,6 +17,7 @@ SUBDIRS = \
one \
oob \
pcm \
pcmclient \
pml \
ptl \
topo

Просмотреть файл

@ -39,6 +39,5 @@ extern "C" {
extern int mca_llm_base_output;
extern ompi_list_t mca_llm_base_components_available;
extern mca_llm_base_component_t mca_llm_base_selected_component;
extern mca_llm_base_module_t mca_llm;
#endif /* MCA_LLM_BASE_H */

Просмотреть файл

@ -25,7 +25,6 @@
int mca_llm_base_output = -1;
ompi_list_t mca_llm_base_components_available;
mca_llm_base_component_t mca_llm_base_selected_component;
mca_llm_base_module_t mca_llm;
ompi_mutex_t mca_llm_base_parse_mutex;

Просмотреть файл

@ -142,7 +142,6 @@ mca_llm_base_select(const char *active_pcm,
/* Save the winner */
mca_llm_base_selected_component = *best_component;
mca_llm = *best_module;
*selected = *best_module;
*allow_multi_user_threads = best_user_threads;
*have_hidden_threads = best_hidden_threads;

Просмотреть файл

@ -18,6 +18,7 @@ ompi_list_t*
mca_llm_hostfile_allocate_resources(int jobid, int nodes, int procs)
{
ompi_list_t *nodelist = NULL;
ompi_list_item_t *nodeitem;
int ret;
/* start by getting the full list of available resources */

Просмотреть файл

@ -11,6 +11,8 @@
#include "util/proc_info.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/base/base.h"
#include "mca/ns/base/base.h"
#include "mca/pcm/pcm.h"
#include "mca/oob/oob.h"
@ -77,9 +79,9 @@ int mca_oob_base_init(bool *user_threads, bool *hidden_threads)
char** uri = NULL;
/* setup local name */
self = mca_pcm.pcm_self();
self = mca_pcmclient.pcmclient_get_self();
if(NULL == self) {
ompi_output(0, "mca_oob_base_init: could not get PCM self pointer");
ompi_output(0, "mca_oob_base_init: could not get pcmclient self pointer");
return OMPI_ERROR;
}
mca_oob_name_self = *self;

Просмотреть файл

@ -35,6 +35,8 @@ extern "C" {
ompi_rte_node_schedule_t *sched,
ompi_list_t *nodelist);
int mca_pcm_base_build_base_env(char ***envp);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif

Просмотреть файл

@ -6,12 +6,43 @@
#include "ompi_config.h"
#include "mca/pcm/base/base.h"
#include "mca/pcm/base/base.h"
#include <string.h>
extern char **environ;
char *
mca_pcm_base_no_unique_name(void)
{
return strdup("0");
}
int
mca_pcm_base_build_base_env(char ***envp)
{
char **env = NULL;
int envc = 0;
int i, j;
for (i = 0 ; environ[i] != NULL ; ++i) {
if (0 != strncmp("OMPI_", environ[i], strlen("OMPI_"))) {
++envc;
}
}
env = (char**) malloc(sizeof(char*) * (envc + 1));
if (NULL == env) return OMPI_ERR_OUT_OF_RESOURCE;
env[envc] = NULL;
for (i = 0, j = 0 ; environ[i] != NULL ; ++i) {
if (0 != strncmp("OMPI_", environ[i], strlen("OMPI_"))) {
env[j] = strdup(environ[i]);
++j;
}
}
}

Просмотреть файл

@ -11,6 +11,7 @@
#include "util/output.h"
#include "mca/mca.h"
#include "mca/pcm/pcm.h"
#include "mca/pcm/base/base.h"
#include "mca/pcm/cofs/src/pcm_cofs.h"
#include "mca/base/mca_base_param.h"
@ -42,13 +43,11 @@ mca_pcm_base_component_1_0_0_t mca_pcm_cofs_component = {
struct mca_pcm_base_module_1_0_0_t mca_pcm_cofs_1_0_0 = {
NULL, /* unique_string */
mca_pcm_base_no_unique_name, /* unique_string */
NULL, /* allocate_resources */
NULL, /* register_monitor */
NULL, /* can_spawn */
NULL, /* spawn_procs */
mca_pcm_cofs_get_peers,
mca_pcm_cofs_get_self,
NULL, /* kill_proc */
NULL, /* kill_job */
NULL /* deallocate_resources */

Просмотреть файл

@ -142,6 +142,7 @@ typedef char *
(*mca_pcm_base_get_unique_name_fn_t)(void);
/**
* Allocate requested resources
*
@ -210,24 +211,6 @@ typedef int
ompi_list_t *schedule_list);
/**
* Get my name
*
* @return my name
*/
typedef ompi_process_name_t* (*mca_pcm_base_module_get_self_fn_t)(void);
/**
* Get names of peer processes which have been launched
*
* @param Nothing
* @return An array of peer names, including me
*/
typedef int (*mca_pcm_base_module_get_peers_fn_t)
(ompi_process_name_t **peers, size_t *npeers);
/**
* Kill a specific process in this cell
*
@ -286,8 +269,6 @@ struct mca_pcm_base_module_1_0_0_t {
mca_pcm_base_register_monitor_fn_t pcm_register_monitor;
mca_pcm_base_can_spawn_fn_t pcm_can_spawn;
mca_pcm_base_spawn_procs_fn_t pcm_spawn_procs;
mca_pcm_base_module_get_peers_fn_t pcm_peers;
mca_pcm_base_module_get_self_fn_t pcm_self;
mca_pcm_base_kill_proc_fn_t pcm_kill_proc;
mca_pcm_base_kill_job_fn_t pcm_kill_job;
mca_pcm_base_deallocate_resources_fn_t pcm_deallocate_resources;
@ -295,8 +276,6 @@ struct mca_pcm_base_module_1_0_0_t {
typedef struct mca_pcm_base_module_1_0_0_t mca_pcm_base_module_1_0_0_t;
typedef struct mca_pcm_base_module_1_0_0_t mca_pcm_base_module_t;
extern mca_pcm_base_module_t mca_pcm;
/**
* Macro for use in modules that are of type pcm v1.0.0

Просмотреть файл

@ -6,4 +6,4 @@
# Specific to this module
PARAM_INIT_FILE=src/pcm_rsh.c
PARAM_CONFIG_FILES="Makefile src/Makefile src/bootproxy/Makefile"
PARAM_CONFIG_FILES="Makefile src/Makefile"

Просмотреть файл

@ -4,19 +4,12 @@
include $(top_ompi_srcdir)/config/Makefile.options
SUBDIRS = bootproxy
noinst_LTLIBRARIES = libmca_pcm_rsh.la
libmca_pcm_rsh_la_SOURCES = \
pcm_rsh.h \
pcm_rsh_internal.h \
pcm_rsh.c \
pcm_rsh_allocate_resources.c \
pcm_rsh_can_spawn.c \
pcm_rsh_component.c \
pcm_rsh_deallocate_resources.c \
pcm_rsh_get_peers.c \
pcm_rsh_get_self.c \
pcm_rsh_kill_job.c \
pcm_rsh_kill_proc.c \
pcm_rsh_register_monitor.c \

Просмотреть файл

@ -1,366 +0,0 @@
/*
* $HEADER
*/
#include "ompi_config.h"
#include "include/constants.h"
#include "util/cmd_line.h"
#include "mca/base/base.h"
#include "mca/pcm/rsh/src/pcm_rsh.h"
#if 0
#include "mca/pcm/base/pcm_base_pack_unpack.h"
#endif
/* Timeout for socket listens */
#define FE_TIMEOUT 600
/* Global debug file for debugging purposes */
FILE *debug;
#if 0
#define fprintf(a, b, ...)
#define fopen(a, b)
#endif
/* Global static variables */
#if 0
static int *vpid_success;
static int cmd_argc;
static char **cmd_argv;
static ompi_value_array_t *hostmap;
#endif
/**
* Bootproxy is a relay proxy for rsh PCM purposes. It will start on
* each remot e node where processes needs to be launched before any
* process can be launched.
*
* Bootproxy gets on its command line the parent host, port,
* start_vpid and the argv for the process to be launched (where the
* same binary needs to be launched on all nodes).
*
* Bootproxy will fork/exec the processes which it needs to start on
* the local node and for remote nodes, it will call rsh PCM
* launch_processes to do the job
*
*/
int main(int argc, char *argv[])
{
return 0;
#if 0
int ret;
int sockfd, peer_port;
char *peer_address;
ompi_cmd_line_t *cmd_handle;
struct sockaddr_in parent_addr;
int start_vpid;
fd_set readset;
struct timeval timeout;
int nfds, vpid_count;
int got_env, got_hostmap;
int got_size_env, got_size_host;
int size_env, size_host, no_env;
char ***launch_argv;
int *launch_argc;
char *inmap, *env, **outenv;
mca_pcm_base_module_t *module;
mca_pcm_t *actions;
int num_launched;
bool user_threads, hidden_threads;
/* Open a file to put debugging information */
#if 1
debug = fopen("/tmp/ompi-launch/debug.txt", "a");
if (NULL == debug) {
fprintf(stderr, "BOOT: Could not open debug file \n");
return -1;
}
{
int c = argc;
int i = 0;
while (c) {
fprintf(debug,"ARG: %s \n", argv[i]);
fflush(debug);
++i;
--c;
}
}
#endif
/* Create command line handle */
cmd_handle = NULL;
cmd_handle = ompi_cmd_line_create();
if (NULL == cmd_handle) {
return OMPI_ERROR;
}
/* Fill up valid options */
ret = ompi_cmd_line_make_opt(cmd_handle, 'H',
"host", 1, "caller IP address");
if (OMPI_SUCCESS != ret) {
fprintf(debug, "ERROR: BOOT: cmd line could not take option\n");
return ret;
}
ret = ompi_cmd_line_make_opt(cmd_handle, 'P',
"port", 1, "caller port");
if (OMPI_SUCCESS != ret) {
fprintf(debug, "ERROR: BOOT: cmd line could not take option\n");
return ret;
}
ret = ompi_cmd_line_make_opt(cmd_handle, 'V',
"start_vpid", 1, "starting vpid");
if (OMPI_SUCCESS != ret) {
fprintf(debug, "ERROR: BOOT: cmd line could not take option\n");
return ret;
}
/* Parse the cmdline */
fprintf(debug, "bootproxy: just before cmd_line_parse \n");
fflush(debug);
ompi_cmd_line_parse(cmd_handle, 1, argc, argv);
/* Create a socket for communication with the parent */
if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
return OMPI_ERROR;
}
peer_port = atoi(ompi_cmd_line_get_param(cmd_handle, "P", 0, 0));
peer_address = ompi_cmd_line_get_param(cmd_handle, "H", 0, 0);
start_vpid = atoi(ompi_cmd_line_get_param(cmd_handle, "V", 0, 0));
/* See if we got any argvs on command line */
ret = ompi_cmd_line_get_tail(cmd_handle, &cmd_argc, &cmd_argv);
if (OMPI_ERROR == ret) {
fprintf(stderr, "Invalid command handle \n");
return ret;
}
launch_argc = NULL;
if (NULL != cmd_argv) {
launch_argv = malloc (2 * sizeof(char **));
launch_argv[0] = cmd_argv;
launch_argv[1] = NULL;
} else {
launch_argv = NULL;
}
fprintf(debug, "BOOTPROXY: got host %s port %d vpid %d\n",
peer_address, peer_port, start_vpid);
fflush(debug);
/* connect to the parent */
parent_addr.sin_family = AF_INET;
parent_addr.sin_port = htons(peer_port);
parent_addr.sin_addr.s_addr = inet_addr(peer_address);
memset(&(parent_addr.sin_zero), '\0', 8);
fprintf(debug, "BOOTPROXY: now conencting to parent \n");
fflush(debug);
if (connect(sockfd, (struct sockaddr *)&parent_addr,
sizeof(struct sockaddr)) < 0) {
perror("BOOT: Connect failed");
return OMPI_ERROR;
}
/* Read the host map array and env from the parent - Do this with
a timeout, because if the parent crased before it could send
the data, this recv will block for ever */
timeout.tv_sec = FE_TIMEOUT;
timeout.tv_usec = 0;
FD_ZERO(&readset);
/* Add socket for recv with a timeout */
got_size_host = 0;
got_size_env = 0;
got_hostmap = 0;
got_env = 0;
no_env = 0;
while (1) {
FD_SET(sockfd, &readset);
nfds = sockfd + 1;
ret = select(nfds, &readset, NULL, NULL, &timeout);
if (FD_ISSET(sockfd, &readset) != 0) {
/* We have something on the sockfd - go read it - it can
either be a valid message to be read or if the parent has
been killed, a lost connection packet */
if (!got_size_host) {
ret = ompi_recv_message((char *)&size_host, sizeof(int),
sockfd);
if (OMPI_ERROR == ret) {
return ret;
}
if (0 == ret) { /* Connection closed by peer */
return OMPI_ERROR;
}
size_host = ntohl(size_host);
fprintf(debug, "BOOT: got size host %d \n", size_host);
fflush(debug);
inmap = (char *) malloc (size_host * sizeof(char));
got_size_host = 1;
continue;
}
if (!got_size_env) {
ret = ompi_recv_message((char *)&size_env, sizeof(int),
sockfd);
if (OMPI_ERROR == ret) {
return ret;
}
size_env = ntohl(size_env);
fprintf(debug, "BOOT: got size env %d \n", size_env);
fflush(debug);
if (0 == size_env) {
no_env = 1;
} else {
env = (char *) malloc (size_env * sizeof(char));
}
got_size_env = 1;
continue;
}
if (!got_hostmap) {
if (OMPI_ERROR == ompi_recv_message(inmap, size_host,
sockfd)) {
fprintf(debug, "BOOTPROXY: Recv failed for hostmap"
"from parent \n");;
return OMPI_ERROR;
}
got_hostmap = 1;
fprintf(debug, "BOOT: got inmap %s \n", inmap);
fflush(debug);
if (no_env) {
break;
} else {
continue;
}
}
if (!got_env) {
fprintf(debug, "BOOT: getting env \n");
fflush(debug);
if (OMPI_ERROR == ompi_recv_message(env, size_env, sockfd)) {
fprintf(debug, "BOOTPROXY: Recv failed for hostmap"
"from parent \n");;
return OMPI_ERROR;
}
fprintf(debug, "Got env :%s \n", env);
fflush(debug);
got_env = 1;
break;
}
} else {
/* We timed out, so parent is not alive, simply exit */
return OMPI_ERROR;
}
}
/* Unpack and put the env in the environment of this process, so that the
children can make use of it */
unpack_and_set_environment(env, &outenv);
/* Convert hostmap to an array format */
fprintf(debug, "The string from parent is : %s \n", inmap);
fflush(debug);
hostmap = unpack_info_from_parent(inmap, &vpid_count);
/* Create the success array for me and my subtree */
vpid_success = (int *) malloc (vpid_count * sizeof(int));
ompi_display(hostmap, debug);
fprintf(debug, "LAUNCH: now launching on nodes \n");
fflush(debug);
/* Open mca base */
if (OMPI_SUCCESS != (ret = mca_base_open())) {
return ret;
}
if (OMPI_SUCCESS != (ret = mca_pcm_base_open())) {
fprintf(debug, "mca open failed \n");
fflush(debug);
return ret;
}
if (OMPI_SUCCESS != (ret = mca_pcm_base_select(0, "rsh", &module,
&actions,
&user_threads,
&hidden_threads))) {
fprintf(debug, "mca select failed \n");
fflush(debug);
return ret;
}
if (OMPI_ERROR ==
(num_launched = actions->launch_processes(hostmap, 0,
launch_argv,
launch_argc,
outenv,
start_vpid,
actions))) {
return OMPI_ERROR;
}
/* Send the num_launched back to the parent */
if (OMPI_ERROR == ompi_send_message((char *)&num_launched,
sizeof(int), sockfd)) {
return OMPI_ERROR;
}
fprintf(debug, "bootproxy: got num launched as %d \n", num_launched);
fprintf(debug, "All done in bootproxy - over and out \n");
fflush(debug);
return 0;
#endif
}

Просмотреть файл

@ -42,9 +42,6 @@ extern "C" {
ompi_rte_monitor_fn_t func);
bool mca_pcm_rsh_can_spawn(void);
int mca_pcm_rsh_spawn_procs(int jobid, ompi_list_t *schedule_list);
ompi_process_name_t* mca_pcm_rsh_get_self(void);
int mca_pcm_rsh_get_peers(ompi_process_name_t **peers,
size_t *npeers);
int mca_pcm_rsh_kill_proc(ompi_process_name_t *name, int flags);
int mca_pcm_rsh_kill_job(int jobid, int flags);
int mca_pcm_rsh_deallocate_resources(int jobid, ompi_list_t *nodelist);

Просмотреть файл

@ -1,16 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "mca/pcm/pcm.h"
#include "mca/pcm/rsh/src/pcm_rsh.h"
ompi_list_t*
mca_pcm_rsh_allocate_resources(int jobid, int nodes, int procs)
{
return NULL;
}

Просмотреть файл

@ -12,5 +12,8 @@
bool
mca_pcm_rsh_can_spawn(void)
{
return false;
/* we can always try to rsh some more... Might not always work as
* the caller hopes
*/
return true;
}

Просмотреть файл

@ -9,12 +9,15 @@
#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/rsh/src/pcm_rsh.h"
#include "mca/llm/llm.h"
#include "mca/llm/base/base.h"
#include <stdio.h>
#include <stdlib.h>
@ -45,53 +48,65 @@ mca_pcm_base_component_1_0_0_t mca_pcm_rsh_component = {
struct mca_pcm_base_module_1_0_0_t mca_pcm_rsh_1_0_0 = {
mca_pcm_base_no_unique_name,
mca_pcm_rsh_allocate_resources,
NULL,
mca_pcm_rsh_register_monitor,
mca_pcm_rsh_can_spawn,
mca_pcm_rsh_spawn_procs,
mca_pcm_rsh_get_peers,
mca_pcm_rsh_get_self,
mca_pcm_rsh_kill_proc,
mca_pcm_rsh_kill_job,
mca_pcm_rsh_deallocate_resources
NULL
};
/* need to create output stream to dump in file */
ompi_output_stream_t mca_pcm_rsh_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_rsh", /* lds_prefix */
true, /* lds_want_stdout */
false, /* lds_want_stderr */
true, /* lds_want_file */
true, /* lds_want_file_append */
"pcm_rsh" /* lds_file_suffix */
};
/*
* Module variables handles
*/
static int mca_pcm_rsh_param_username;
static int mca_pcm_rsh_param_no_n;
static int mca_pcm_rsh_param_no_profile;
static int mca_pcm_rsh_param_fast;
static int mca_pcm_rsh_param_ignore_stderr;
static int mca_pcm_rsh_param_priority;
static int mca_pcm_rsh_param_agent;
static int mca_pcm_rsh_param_degree;
static int mca_pcm_rsh_param_is_client;
static int mca_pcm_rsh_param_debug;
/*
* Module variables
*/
char *mca_pcm_rsh_username;
int mca_pcm_rsh_no_n;
int mca_pcm_rsh_no_profile;
int mca_pcm_rsh_fast;
int mca_pcm_rsh_ignore_stderr;
int mca_pcm_rsh_priority;
char *mca_pcm_rsh_agent;
int mca_pcm_rsh_degree;
int mca_pcm_rsh_is_client;
int mca_pcm_rsh_output = 0;
mca_llm_base_module_t mca_pcm_rsh_llm;
int
mca_pcm_rsh_component_open(void)
{
mca_pcm_rsh_param_username =
mca_base_param_register_string("pcm", "rsh", "username", NULL, NULL);
mca_pcm_rsh_param_debug =
mca_base_param_register_int("pcm", "rsh", "debug", NULL, 100);
mca_pcm_rsh_param_agent =
mca_base_param_register_string("pcm", "rsh", "agent", NULL,
"ssh");
mca_pcm_rsh_param_no_n =
mca_base_param_register_int("pcm", "rsh", "no_n", NULL, 0);
mca_pcm_rsh_param_no_profile =
@ -103,11 +118,6 @@ mca_pcm_rsh_component_open(void)
mca_pcm_rsh_param_priority =
mca_base_param_register_int("pcm", "rsh", "priority", NULL, 1);
mca_pcm_rsh_param_degree =
mca_base_param_register_int("pcm", "rsh", "degree", NULL, 2);
mca_pcm_rsh_param_is_client =
mca_base_param_register_int("pcm", "rsh", "is_client", NULL, 0);
return OMPI_SUCCESS;
}
@ -125,12 +135,17 @@ mca_pcm_rsh_init(int *priority,
bool *allow_multi_user_threads,
bool *have_hidden_threads)
{
int debug;
int ret;
mca_base_param_lookup_int(mca_pcm_rsh_param_debug, &debug);
mca_pcm_rsh_output = ompi_output_open(&mca_pcm_rsh_output_stream);
ompi_output_set_verbosity(mca_pcm_rsh_output, debug);
mca_base_param_lookup_int(mca_pcm_rsh_param_priority, priority);
mca_base_param_lookup_int(mca_pcm_rsh_param_no_n,
&mca_pcm_rsh_no_n);
mca_base_param_lookup_string(mca_pcm_rsh_param_username,
&mca_pcm_rsh_username);
mca_base_param_lookup_int(mca_pcm_rsh_param_no_profile,
&mca_pcm_rsh_no_profile);
mca_base_param_lookup_int(mca_pcm_rsh_param_fast,
@ -139,16 +154,28 @@ mca_pcm_rsh_init(int *priority,
&mca_pcm_rsh_ignore_stderr);
mca_base_param_lookup_int(mca_pcm_rsh_param_ignore_stderr,
&mca_pcm_rsh_ignore_stderr);
mca_base_param_lookup_int(mca_pcm_rsh_param_degree,
&mca_pcm_rsh_degree);
mca_base_param_lookup_string(mca_pcm_rsh_param_agent,
&mca_pcm_rsh_agent);
mca_base_param_lookup_int(mca_pcm_rsh_param_is_client,
&mca_pcm_rsh_is_client);
*allow_multi_user_threads = true;
*have_hidden_threads = false;
ompi_output_verbose(10, mca_pcm_rsh_output, "start llm selection");
ret = mca_llm_base_select("pcm", &mca_pcm_rsh_llm,
allow_multi_user_threads,
have_hidden_threads);
if (OMPI_SUCCESS != ret) {
/* well, that can't be good. guess we can't run */
return NULL;
}
/* copy over the function pointers */
mca_pcm_rsh_1_0_0.pcm_allocate_resources =
mca_pcm_rsh_llm.llm_allocate_resources;
mca_pcm_rsh_1_0_0.pcm_deallocate_resources =
mca_pcm_rsh_llm.llm_deallocate_resources;
ompi_output_verbose(10, mca_pcm_rsh_output, "stop llm selection");
return &mca_pcm_rsh_1_0_0;
}
@ -156,6 +183,10 @@ mca_pcm_rsh_init(int *priority,
int
mca_pcm_rsh_finalize(void)
{
return OMPI_SUCCESS;
if (mca_pcm_rsh_output > 0) {
ompi_output_close(mca_pcm_rsh_output);
}
return OMPI_SUCCESS;
}

Просмотреть файл

@ -1,16 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "mca/pcm/pcm.h"
#include "mca/pcm/rsh/src/pcm_rsh.h"
int
mca_pcm_rsh_deallocate_resources(int jobid, ompi_list_t *nodelist)
{
return OMPI_SUCCESS;
}

Просмотреть файл

@ -1,16 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "mca/pcm/pcm.h"
#include "mca/pcm/rsh/src/pcm_rsh.h"
int
mca_pcm_rsh_get_peers(ompi_process_name_t **peers, size_t *npeers)
{
return OMPI_SUCCESS;
}

Просмотреть файл

@ -1,17 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "mca/pcm/pcm.h"
#include "mca/pcm/rsh/src/pcm_rsh.h"
ompi_process_name_t*
mca_pcm_rsh_get_self()
{
return NULL;
}

Просмотреть файл

@ -1,44 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "mca/pcm/pcm.h"
#include "include/types.h"
#include <sys/types.h>
#ifndef MCA_PCM_RSH_INTERNAL_H_
#define MCA_PCM_RSH_INTERNAL_H_
#ifdef __cplusplus
extern "C" {
#endif
static inline int get_first_child(int degree, int parent)
{
return degree * parent + 1;
}
static inline int get_last_child(int degree, int parent)
{
return degree * parent + degree;
}
int pcm_rsh_ioexecvp(char **cmdv, int showout, char *outbuff,
int outbuffsize, int stderr_is_err,
int sockfd, char *outmap, char *env,
int *num_launched);
#ifdef __cplusplus
}
#endif
#endif /* MCA_PCM_RSH_INTERNAL_H_ */

Просмотреть файл

@ -12,5 +12,5 @@
int
mca_pcm_rsh_kill_job(int jobid, int flags)
{
return OMPI_SUCCESS;
return OMPI_ERROR;
}

Просмотреть файл

@ -12,5 +12,5 @@
int
mca_pcm_rsh_kill_proc(ompi_process_name_t *name, int flags)
{
return OMPI_SUCCESS;
return OMPI_ERROR;
}

Просмотреть файл

@ -8,9 +8,36 @@
#include "mca/pcm/pcm.h"
#include "mca/pcm/rsh/src/pcm_rsh.h"
#include "runtime/runtime_types.h"
int
mca_pcm_rsh_spawn_procs(int jobid, ompi_list_t *schedule_list)
mca_pcm_rsh_spawn_procs(int jobid, ompi_list_t *schedlist)
{
ompi_list_item_t *sched_item, *node_item;
ompi_rte_node_schedule_t *sched;
ompi_rte_node_allocation_t *node;
ompi_list_t launch;
OBJ_CONSTRUCT(&launch, ompi_list_t);
for (sched_item = ompi_list_get_first(schedlist) ;
sched_item != ompi_list_get_end(schedlist) ;
sched_item = ompi_list_get_next(sched_item)) {
sched = (ompi_rte_node_schedule_t*) sched_item;
/* when we start doing tree based, more logic here... */
for (node_item = ompi_list_get_first(sched->nodelist) ;
node_item != ompi_list_get_end(sched->nodelist) ;
node_item = ompi_list_get_next(node_item)) {
node = (ompi_rte_node_allocation_t*) node_item;
/* we don't need to push nodes down to the compute places,
so don't do it... */
}
}
OBJ_DESTRUCT(&launch);
return OMPI_SUCCESS;
}

Просмотреть файл

@ -1,50 +0,0 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "mca/pcm/pcm.h"
#include "mca/pcm/seed/pcm_seed.h"
#include "include/types.h"
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
ompi_process_name_t peers[] = {
{0, 0, 0} /* 0,0,0 is the seed daemon's name */
};
extern char *mca_pcm_seed_unique_name;
int
mca_pcm_seed_get_peers(ompi_process_name_t **procs, size_t *num_procs)
{
*num_procs = 1;
*procs = peers;
return OMPI_SUCCESS;
}
ompi_process_name_t* mca_pcm_seed_get_self(void)
{
return peers;
}
bool
mca_pcm_seed_can_spawn(void)
{
return false;
}
char*
mca_pcm_seed_get_unique_name(void)
{
return mca_pcm_seed_unique_name;
}

Просмотреть файл

@ -1,31 +0,0 @@
/* -*- C -*-
*
* $HEADER$
*
*/
#include "ompi_config.h"
#include "mca/pcm/pcm.h"
#include "include/types.h"
/*
* Module open / close
*/
int mca_pcm_seed_open(void);
int mca_pcm_seed_close(void);
/*
* Startup / Shutdown
*/
struct mca_pcm_base_module_1_0_0_t* mca_pcm_seed_init(int *priority, bool *allow_multi_user_threads, bool *have_hidden_threads);
int mca_pcm_seed_finalize(void);
/*
* "Action" functions
*/
char *mca_pcm_seed_get_unique_name(void);
bool mca_pcm_seed_can_spawn(void);
int mca_pcm_seed_get_peers(ompi_process_name_t **peers, size_t *npeers);
ompi_process_name_t* mca_pcm_seed_get_self(void);

Просмотреть файл

@ -1,102 +0,0 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "pcm-seed-version.h"
#include "include/constants.h"
#include "include/types.h"
#include "mca/mca.h"
#include "mca/pcm/pcm.h"
#include "mca/pcm/seed/pcm_seed.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_pcm_base_component_1_0_0_t mca_pcm_seed_component = {
{
MCA_PCM_BASE_VERSION_1_0_0,
"seed", /* MCA component name */
MCA_pcm_seed_MAJOR_VERSION, /* MCA component major version */
MCA_pcm_seed_MINOR_VERSION, /* MCA component minor version */
MCA_pcm_seed_RELEASE_VERSION, /* MCA component release version */
mca_pcm_seed_open, /* component open */
mca_pcm_seed_close /* component close */
},
{
false /* checkpoint / restart */
},
mca_pcm_seed_init, /* component init */
mca_pcm_seed_finalize
};
struct mca_pcm_base_module_1_0_0_t mca_pcm_seed_1_0_0 = {
mca_pcm_seed_get_unique_name,
NULL, /* allocate_resources */
NULL, /* register_monitor */
mca_pcm_seed_can_spawn,
NULL, /* spawn_procs */
mca_pcm_seed_get_peers,
mca_pcm_seed_get_self,
NULL, /* kill_proc */
NULL, /* kill_job */
NULL /* deallocate_resources */
};
char *mca_pcm_seed_unique_name;
static int mca_pcm_seed_unique_name_param;
int
mca_pcm_seed_open(void)
{
mca_base_param_register_string("pcm", "seed", "unique", NULL, "0");
return OMPI_SUCCESS;
}
int
mca_pcm_seed_close(void)
{
return OMPI_SUCCESS;
}
struct mca_pcm_base_module_1_0_0_t *
mca_pcm_seed_init(int *priority, bool *allow_multiple_user_threads,
bool *have_hidden_threads)
{
if (!ompi_process_info.seed) {
*priority = 0;
return NULL;
}
mca_base_param_lookup_string(mca_pcm_seed_unique_name_param,
&mca_pcm_seed_unique_name);
*priority = 100;
*allow_multiple_user_threads = true;
*have_hidden_threads = false;
return &mca_pcm_seed_1_0_0;
}
int
mca_pcm_seed_finalize(void)
{
return OMPI_SUCCESS;
}

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

@ -0,0 +1,21 @@
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
SUBDIRS = base $(MCA_pcmclient_STATIC_SUBDIRS)
DIST_SUBDIRS = base $(MCA_pcmclient_ALL_SUBDIRS)
# Source code files
headers = pcmclient.h
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(includedir)/openmpi/mca/pcmclient
ompi_HEADERS = $(headers)
else
ompidir = $(includedir)
endif

33
src/mca/pcmclient/base/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,33 @@
#
# $HEADER$
#
include $(top_srcdir)/config/Makefile.options
noinst_LTLIBRARIES = libmca_pcmclient_base.la
# For VPATH builds, have to specify where static-modules.h will be found
AM_CPPFLAGS = -I$(top_builddir)/src
# Source code files
headers = \
base.h
# Library
libmca_pcmclient_base_la_SOURCES = \
$(headers) \
pcmclient_base_close.c \
pcmclient_base_open.c \
pcmclient_base_select.c
# Conditionally install the header files
if WANT_INSTALL_HEADERS
ompidir = $(includedir)/openmpi/mca/pcmclient/base
ompi_HEADERS = $(headers)
else
ompidir = $(includedir)
endif

39
src/mca/pcmclient/base/base.h Обычный файл
Просмотреть файл

@ -0,0 +1,39 @@
/* -*- C -*-
*
* $HEADER$
*/
#ifndef MCA_PCMCLIENT_BASE_H_
#define MCA_PCMCLIENT_BASE_H_
#include "ompi_config.h"
#include "include/types.h"
#include "mca/mca.h"
#include "mca/pcmclient/pcmclient.h"
/*
* Global functions for MCA overall collective open and close
*/
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
int mca_pcmclient_base_open(void);
int mca_pcmclient_base_select(bool *allow_multi_user_threads,
bool *have_hidden_threads);
int mca_pcmclient_base_close(void);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
/*
* Globals
*/
extern int mca_pcmclient_base_output;
extern ompi_list_t mca_pcmclient_base_components_available;
extern mca_pcmclient_base_component_t mca_pcmclient_base_selected_component;
extern mca_pcmclient_base_module_t mca_pcmclient;
#endif /* MCA_PCMCLIENT_BASE_H */

Просмотреть файл

@ -0,0 +1,27 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "include/constants.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/base/base.h"
int mca_pcmclient_base_close(void)
{
/* Close all remaining available modules (may be one if this is a
OMPI RTE program, or [possibly] multiple if this is ompi_info) */
mca_base_components_close(mca_pcmclient_base_output,
&mca_pcmclient_base_components_available, NULL);
/* All done */
return OMPI_SUCCESS;
}

Просмотреть файл

@ -0,0 +1,48 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/base/base.h"
/*
* The following file was created by configure. It contains extern
* statements and the definition of an array of pointers to each
* component's public mca_base_component_t struct.
*/
#include "mca/pcmclient/base/static-components.h"
/*
* Global variables
*/
int mca_pcmclient_base_output = 0;
mca_pcmclient_base_module_t mca_pcmclient;
ompi_list_t mca_pcmclient_base_components_available;
mca_pcmclient_base_component_t mca_pcmclient_base_selected_component;
mca_pcmclient_base_module_t mca_pcmclient;
/**
* Function for finding and opening either all MCA components, or the one
* that was specifically requested via a MCA parameter.
*/
int mca_pcmclient_base_open(void)
{
/* Open up all available components */
if (OMPI_SUCCESS !=
mca_base_components_open("pcmclient", 0,
mca_pcmclient_base_static_components,
&mca_pcmclient_base_components_available)) {
return OMPI_ERROR;
}
/* All done */
return OMPI_SUCCESS;
}

Просмотреть файл

@ -0,0 +1,129 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include <stdio.h>
#include "runtime/runtime.h"
#include "util/output.h"
#include "mca/mca.h"
#include "mca/base/base.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/base/base.h"
/**
* Function for selecting one module from all those that are
* available.
*
* Call the init function on all available modules and get their
* priorities. Select the module with the highest priority. All
* other modules will be closed and unloaded.
*/
int mca_pcmclient_base_select(bool *allow_multi_user_threads,
bool *have_hidden_threads)
{
int priority, best_priority;
bool user_threads, hidden_threads;
bool best_user_threads, best_hidden_threads;
ompi_list_item_t *item;
mca_base_component_list_item_t *cli;
mca_pcmclient_base_component_t *component, *best_component;
mca_pcmclient_base_module_t *module, *best_module;
extern ompi_list_t mca_pcmclient_base_components_available;
ompi_output_verbose(100, mca_pcmclient_base_output,
"mca_pcmclient_base_select started");
/* Traverse the list of available components; call their init
functions. */
best_priority = -1;
best_component = NULL;
for (item = ompi_list_get_first(&mca_pcmclient_base_components_available);
ompi_list_get_end(&mca_pcmclient_base_components_available) != item;
item = ompi_list_get_next(item)) {
cli = (mca_base_component_list_item_t *) item;
component = (mca_pcmclient_base_component_t *) cli->cli_component;
ompi_output_verbose(10, mca_pcmclient_base_output,
"select: initializing %s component %s",
component->pcmclient_version.mca_type_name,
component->pcmclient_version.mca_component_name);
if (NULL == component->pcmclient_init) {
ompi_output_verbose(10, mca_pcmclient_base_output,
"select: no init function; ignoring component");
} else {
module = component->pcmclient_init(&priority, &user_threads, &hidden_threads);
if (NULL == module) {
ompi_output_verbose(10, mca_pcmclient_base_output,
"select: init returned failure");
} else {
ompi_output_verbose(10, mca_pcmclient_base_output,
"select: init returned priority %d", priority);
if (priority > best_priority) {
best_priority = priority;
best_user_threads = user_threads;
best_hidden_threads = hidden_threads;
best_component = component;
best_module = module;
}
}
}
}
/* Finished querying all components. Check for the bozo case. */
if (NULL == best_component) {
/* JMS Replace with show_help */
ompi_abort(1, "No PCMCLIENT component available. This shouldn't happen.");
}
/* Finalize all non-selected components */
for (item = ompi_list_get_first(&mca_pcmclient_base_components_available);
ompi_list_get_end(&mca_pcmclient_base_components_available) != item;
item = ompi_list_get_next(item)) {
cli = (mca_base_component_list_item_t *) item;
component = (mca_pcmclient_base_component_t *) cli->cli_component;
if (component != best_component) {
/* Finalize */
if (NULL != component->pcmclient_finalize) {
/* Blatently ignore the return code (what would we do to
recover, anyway? This component is going away, so errors
don't matter anymore) */
component->pcmclient_finalize();
ompi_output_verbose(10, mca_pcmclient_base_output,
"select: component %s finalized",
component->pcmclient_version.mca_component_name);
}
}
}
/* This base function closes, unloads, and removes from the
available list all unselected components. The available list will
contain only the selected component. */
mca_base_components_close(mca_pcmclient_base_output, &mca_pcmclient_base_components_available,
(mca_base_component_t *) best_component);
/* Save the winner */
mca_pcmclient_base_selected_component = *best_component;
mca_pcmclient = *best_module;
*allow_multi_user_threads = best_user_threads;
*have_hidden_threads = best_hidden_threads;
ompi_output_verbose(10, mca_pcmclient_base_output,
"select: component %s initialized",
mca_pcmclient_base_selected_component.pcmclient_version.mca_component_name);
/* All done */
return OMPI_SUCCESS;
}

Просмотреть файл

@ -9,29 +9,29 @@ include $(top_ompi_srcdir)/config/Makefile.options
EXTRA_DIST = VERSION
sources = \
pcm_seed.h \
pcm_seed.c \
pcm_seed_component.c
pcmclient_env.h \
pcmclient_env.c \
pcmclient_env_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_seed_DSO
if OMPI_BUILD_pcmclient_env_DSO
component_noinst =
component_install = mca_pcm_seed.la
component_install = mca_pcmclient_env.la
else
component_noinst = libmca_pcm_seed.la
component_noinst = libmca_pcmclient_env.la
component_install =
endif
mcacomponentdir = $(libdir)/openmpi
mcacomponent_LTLIBRARIES = $(component_install)
mca_pcm_seed_la_SOURCES = $(sources)
mca_pcm_seed_la_LIBADD =
mca_pcm_seed_la_LDFLAGS = -module -avoid-version
mca_pcmclient_env_la_SOURCES = $(sources)
mca_pcmclient_env_la_LIBADD =
mca_pcmclient_env_la_LDFLAGS = -module -avoid-version
noinst_LTLIBRARIES = $(component_noinst)
libmca_pcm_seed_la_SOURCES = $(sources)
libmca_pcm_seed_la_LIBADD =
libmca_pcm_seed_la_LDFLAGS = -module -avoid-version
libmca_pcmclient_env_la_SOURCES = $(sources)
libmca_pcmclient_env_la_LIBADD =
libmca_pcmclient_env_la_LDFLAGS = -module -avoid-version

Просмотреть файл

Просмотреть файл

@ -5,5 +5,5 @@
# Specific to this module
PARAM_INIT_FILE=pcm_seed.c
PARAM_INIT_FILE=pcmclient_env_component.c
PARAM_CONFIG_FILES="Makefile"

39
src/mca/pcmclient/env/pcmclient_env.c поставляемый Обычный файл
Просмотреть файл

@ -0,0 +1,39 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/env/pcmclient_env.h"
#include "include/types.h"
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
extern int mca_pcmclient_env_num_procs;
extern int mca_pcmclient_env_procid;
extern ompi_process_name_t *mca_pcmclient_env_procs;
int
mca_pcmclient_env_get_peers(ompi_process_name_t **procs,
size_t *num_procs)
{
if (NULL == mca_pcmclient_env_procs) return OMPI_ERROR;
*num_procs = mca_pcmclient_env_num_procs;
*procs = mca_pcmclient_env_procs;
return OMPI_SUCCESS;
}
ompi_process_name_t*
mca_pcmclient_env_get_self(void)
{
if (NULL == mca_pcmclient_env_procs) return NULL;
return &mca_pcmclient_env_procs[mca_pcmclient_env_procid];
}

29
src/mca/pcmclient/env/pcmclient_env.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_env_open(void);
int mca_pcmclient_env_close(void);
/*
* Startup / Shutdown
*/
struct mca_pcmclient_base_module_1_0_0_t* mca_pcmclient_env_init(int *priority, bool *allow_multi_user_threads, bool *have_hidden_threads);
int mca_pcmclient_env_finalize(void);
/*
* "Action" functions
*/
int mca_pcmclient_env_get_peers(ompi_process_name_t **peers, size_t *npeers);
ompi_process_name_t* mca_pcmclient_env_get_self(void);

142
src/mca/pcmclient/env/pcmclient_env_component.c поставляемый Обычный файл
Просмотреть файл

@ -0,0 +1,142 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "pcmclient-env-version.h"
#include "include/constants.h"
#include "include/types.h"
#include "mca/mca.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/env/pcmclient_env.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_env_component = {
{
MCA_PCMCLIENT_BASE_VERSION_1_0_0,
"env", /* MCA component name */
MCA_pcmclient_env_MAJOR_VERSION, /* MCA component major version */
MCA_pcmclient_env_MINOR_VERSION, /* MCA component minor version */
MCA_pcmclient_env_RELEASE_VERSION, /* MCA component release version */
mca_pcmclient_env_open, /* component open */
mca_pcmclient_env_close /* component close */
},
{
false /* checkpoint / restart */
},
mca_pcmclient_env_init, /* component init */
mca_pcmclient_env_finalize
};
struct mca_pcmclient_base_module_1_0_0_t mca_pcmclient_env_1_0_0 = {
mca_pcmclient_env_get_self,
mca_pcmclient_env_get_peers,
};
static int param_cellid;
static int param_jobid;
static int param_vpid_start;
static int param_num_procs;
static int param_procid;
int mca_pcmclient_env_cellid;
int mca_pcmclient_env_jobid;
int mca_pcmclient_env_num_procs;
int mca_pcmclient_env_procid;
ompi_process_name_t *mca_pcmclient_env_procs = NULL;
int
mca_pcmclient_env_open(void)
{
param_cellid = mca_base_param_register_int("pcmclient", "env", "cellid",
NULL, -1);
param_jobid = mca_base_param_register_int("pcmclient", "env", "jobid",
NULL, -1);
param_procid = mca_base_param_register_int("pcmclient", "env", "procid",
NULL, -1);
param_vpid_start = mca_base_param_register_int("pcmclient", "env",
"vpid_start", NULL, -1);
param_num_procs = mca_base_param_register_int("pcmclient", "env",
"num_procs", NULL, -1);
return OMPI_SUCCESS;
}
int
mca_pcmclient_env_close(void)
{
return OMPI_SUCCESS;
}
struct mca_pcmclient_base_module_1_0_0_t *
mca_pcmclient_env_init(int *priority,
bool *allow_multiple_user_threads,
bool *have_hidden_threads)
{
int vpid_start;
int i;
*priority = 2; /* make sure we are above singleton */
*allow_multiple_user_threads = true;
*have_hidden_threads = false;
mca_base_param_lookup_int(param_cellid, &mca_pcmclient_env_cellid);
if (mca_pcmclient_env_cellid < 0) return NULL;
mca_base_param_lookup_int(param_jobid, &mca_pcmclient_env_jobid);
if (mca_pcmclient_env_jobid < 0) return NULL;
mca_base_param_lookup_int(param_procid, &mca_pcmclient_env_procid);
if (mca_pcmclient_env_procid < 0) return NULL;
mca_base_param_lookup_int(param_vpid_start, &vpid_start);
if (vpid_start < 0) return NULL;
mca_base_param_lookup_int(param_num_procs, &mca_pcmclient_env_num_procs);
if (mca_pcmclient_env_num_procs < 0) return NULL;
mca_pcmclient_env_procs =
(ompi_process_name_t*) malloc(sizeof(ompi_process_name_t) *
mca_pcmclient_env_num_procs);
if (NULL == mca_pcmclient_env_procs) return NULL;
for ( i = 0 ; i < mca_pcmclient_env_num_procs ; ++i) {
mca_pcmclient_env_procs[i].cellid = mca_pcmclient_env_cellid;
mca_pcmclient_env_procs[i].jobid = mca_pcmclient_env_jobid;
mca_pcmclient_env_procs[i].vpid = i + vpid_start;
}
return &mca_pcmclient_env_1_0_0;
}
int
mca_pcmclient_env_finalize(void)
{
if (NULL != mca_pcmclient_env_procs) {
free(mca_pcmclient_env_procs);
mca_pcmclient_env_procs = NULL;
mca_pcmclient_env_num_procs = 0;
}
return OMPI_SUCCESS;
}

130
src/mca/pcmclient/pcmclient.h Обычный файл
Просмотреть файл

@ -0,0 +1,130 @@
/* -*- C -*-
*
* $HEADER$
*/
/**
* Client side of the PCM interface
*
* The pcm interface is divided into two parts - a server side and
* client side. The server side is responsible for starting processes,
* monitoring them, and killing processes.
*
* Unlike the server side of the pcm, the client side is a
* single-instance framework - only one component can be loaded for
* the lifetime of the process. The reason for this is simple - only
* one pcm framework could have been used to start the current
* process.
*
*/
#ifndef MCA_PCMCLIENT_H_
#define MCA_PCMCLIENT_H_
#include "ompi_config.h"
#include "mca/mca.h"
#include "mca/ns/ns.h"
#include "include/types.h"
#include "runtime/runtime_types.h"
/*
* MCA component management functions
*/
/**
* PCM-client initialization function
*
* Called by the MCA framework to initialize the component. Will
* be called exactly once in the lifetime of the process.
*
* @param priority (OUT) Relative priority or ranking use by MCA to
* select a module.
* @param allow_multiple_user_threads (OUT) Whether this module can
* run with multiple threads making calls into
* the library (equivalent of MPI_THREAD_MULTIPLE
* from MPI-land).
* @param have_hidden_threads (OUT) Whether this module needs to start
* a background thread for operation.
*/
typedef struct mca_pcmclient_base_module_1_0_0_t*
(*mca_pcmclient_base_component_init_fn_t)(int *priority,
bool *allow_multiple_user_threads,
bool *have_hidden_threads);
/**
* PCM Client finalization function
*
* Called by the MCA framework to finalize the component. Will be
* called once per successful call to pcm_base_compoenent_init.
*/
typedef int
(*mca_pcmclient_base_component_finalize_fn_t)(void);
/**
* PCM Client module version and interface functions
*
* \note the first two entries have type names that are a bit
* misleading. The plan is to rename the mca_base_module_*
* types in the future.
*/
struct mca_pcmclient_base_component_1_0_0_t {
mca_base_component_t pcmclient_version;
mca_base_component_data_1_0_0_t pcmclient_data;
mca_pcmclient_base_component_init_fn_t pcmclient_init;
mca_pcmclient_base_component_finalize_fn_t pcmclient_finalize;
};
typedef struct mca_pcmclient_base_component_1_0_0_t mca_pcmclient_base_component_1_0_0_t;
typedef mca_pcmclient_base_component_1_0_0_t mca_pcmclient_base_component_t;
/*
* PCM interface functions
*/
/**
* Get my name
*
* @return my name
*/
typedef ompi_process_name_t*
(*mca_pcmclient_base_module_get_self_fn_t)(void);
/**
* Get names of peer processes which have been launched
*
* @param Nothing
* @return An array of peer names, including me
*/
typedef int
(*mca_pcmclient_base_module_get_peers_fn_t)(ompi_process_name_t **peers,
size_t *npeers);
/**
* Base module structure for the PCM-CLIENT
*
* Base module structure for the PCM-CLIENT - presents the required function
* pointers to the calling interface.
*/
struct mca_pcmclient_base_module_1_0_0_t {
mca_pcmclient_base_module_get_self_fn_t pcmclient_get_self;
mca_pcmclient_base_module_get_peers_fn_t pcmclient_get_peers;
};
typedef struct mca_pcmclient_base_module_1_0_0_t mca_pcmclient_base_module_1_0_0_t;
typedef struct mca_pcmclient_base_module_1_0_0_t mca_pcmclient_base_module_t;
/**
* Macro for use in modules that are of type pcm v1.0.0
*/
#define MCA_PCMCLIENT_BASE_VERSION_1_0_0 \
/* pcm v1.0 is chained to MCA v1.0 */ \
MCA_BASE_VERSION_1_0_0, \
/* pcm v1.0 */ \
"pcmclient", 1, 0, 0
#endif /* MCA_PCMCLIENT_H_ */

37
src/mca/pcmclient/seed/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_seed.h \
pcmclient_seed.c \
pcmclient_seed_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_seed_DSO
component_noinst =
component_install = mca_pcmclient_seed.la
else
component_noinst = libmca_pcmclient_seed.la
component_install =
endif
mcacomponentdir = $(libdir)/openmpi
mcacomponent_LTLIBRARIES = $(component_install)
mca_pcmclient_seed_la_SOURCES = $(sources)
mca_pcmclient_seed_la_LIBADD =
mca_pcmclient_seed_la_LDFLAGS = -module -avoid-version
noinst_LTLIBRARIES = $(component_noinst)
libmca_pcmclient_seed_la_SOURCES = $(sources)
libmca_pcmclient_seed_la_LIBADD =
libmca_pcmclient_seed_la_LDFLAGS = -module -avoid-version

6
src/mca/pcmclient/seed/VERSION Обычный файл
Просмотреть файл

@ -0,0 +1,6 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

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

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

36
src/mca/pcmclient/seed/pcmclient_seed.c Обычный файл
Просмотреть файл

@ -0,0 +1,36 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/seed/pcmclient_seed.h"
#include "include/types.h"
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
static ompi_process_name_t peers[] = {
{0, 1, 0}
};
int
mca_pcmclient_seed_get_peers(ompi_process_name_t **procs,
size_t *num_procs)
{
*num_procs = 1;
*procs = peers;
return OMPI_SUCCESS;
}
ompi_process_name_t*
mca_pcmclient_seed_get_self(void)
{
return peers;
}

29
src/mca/pcmclient/seed/pcmclient_seed.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_seed_open(void);
int mca_pcmclient_seed_close(void);
/*
* Startup / Shutdown
*/
struct mca_pcmclient_base_module_1_0_0_t* mca_pcmclient_seed_init(int *priority, bool *allow_multi_user_threads, bool *have_hidden_threads);
int mca_pcmclient_seed_finalize(void);
/*
* "Action" functions
*/
int mca_pcmclient_seed_get_peers(ompi_process_name_t **peers, size_t *npeers);
ompi_process_name_t* mca_pcmclient_seed_get_self(void);

Просмотреть файл

@ -0,0 +1,88 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "pcmclient-seed-version.h"
#include "include/constants.h"
#include "include/types.h"
#include "mca/mca.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/seed/pcmclient_seed.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_seed_component = {
{
MCA_PCMCLIENT_BASE_VERSION_1_0_0,
"seed", /* MCA component name */
MCA_pcmclient_seed_MAJOR_VERSION, /* MCA component major version */
MCA_pcmclient_seed_MINOR_VERSION, /* MCA component minor version */
MCA_pcmclient_seed_RELEASE_VERSION, /* MCA component release version */
mca_pcmclient_seed_open, /* component open */
mca_pcmclient_seed_close /* component close */
},
{
false /* checkpoint / restart */
},
mca_pcmclient_seed_init, /* component init */
mca_pcmclient_seed_finalize
};
struct mca_pcmclient_base_module_1_0_0_t mca_pcmclient_seed_1_0_0 = {
mca_pcmclient_seed_get_self,
mca_pcmclient_seed_get_peers,
};
int
mca_pcmclient_seed_open(void)
{
return OMPI_SUCCESS;
}
int
mca_pcmclient_seed_close(void)
{
return OMPI_SUCCESS;
}
struct mca_pcmclient_base_module_1_0_0_t *
mca_pcmclient_seed_init(int *priority,
bool *allow_multiple_user_threads,
bool *have_hidden_threads)
{
if (!ompi_process_info.seed) {
*priority = 0;
return NULL;
}
*priority = 0;
*allow_multiple_user_threads = true;
*have_hidden_threads = false;
return &mca_pcmclient_seed_1_0_0;
}
int
mca_pcmclient_seed_finalize(void)
{
return OMPI_SUCCESS;
}

37
src/mca/pcmclient/singleton/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_singleton.h \
pcmclient_singleton.c \
pcmclient_singleton_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_singleton_DSO
component_noinst =
component_install = mca_pcmclient_singleton.la
else
component_noinst = libmca_pcmclient_singleton.la
component_install =
endif
mcacomponentdir = $(libdir)/openmpi
mcacomponent_LTLIBRARIES = $(component_install)
mca_pcmclient_singleton_la_SOURCES = $(sources)
mca_pcmclient_singleton_la_LIBADD =
mca_pcmclient_singleton_la_LDFLAGS = -module -avoid-version
noinst_LTLIBRARIES = $(component_noinst)
libmca_pcmclient_singleton_la_SOURCES = $(sources)
libmca_pcmclient_singleton_la_LIBADD =
libmca_pcmclient_singleton_la_LDFLAGS = -module -avoid-version

6
src/mca/pcmclient/singleton/VERSION Обычный файл
Просмотреть файл

@ -0,0 +1,6 @@
major=1
minor=0
release=0
alpha=0
beta=0
svn=1

Просмотреть файл

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

Просмотреть файл

@ -0,0 +1,67 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/singleton/pcmclient_singleton.h"
#include "include/types.h"
#include <stdio.h>
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
extern ompi_process_name_t *mca_pcmclient_singleton_procs;
static
int
init_proclist()
{
if (NULL != mca_pcmclient_singleton_procs) return OMPI_SUCCESS;
/* need to create us an array of these things... */
mca_pcmclient_singleton_procs =
(ompi_process_name_t*) malloc(sizeof(ompi_process_name_t));
if (NULL == mca_pcmclient_singleton_procs) return OMPI_ERROR;
/* BWB - when name server is running, get value from it... */
mca_pcmclient_singleton_procs[0].cellid = 0;
mca_pcmclient_singleton_procs[0].jobid = 1;
mca_pcmclient_singleton_procs[0].vpid = 0;
return OMPI_SUCCESS;
}
int
mca_pcmclient_singleton_get_peers(ompi_process_name_t **procs,
size_t *num_procs)
{
int ret;
if (NULL == mca_pcmclient_singleton_procs) {
ret = init_proclist();
if (OMPI_SUCCESS != ret) return ret;
}
*num_procs = 1;
*procs = mca_pcmclient_singleton_procs;
return OMPI_SUCCESS;
}
ompi_process_name_t*
mca_pcmclient_singleton_get_self(void)
{
int ret;
if (NULL == mca_pcmclient_singleton_procs) {
ret = init_proclist();
if (OMPI_SUCCESS != ret) return ret;
}
return &mca_pcmclient_singleton_procs[0];
}

Просмотреть файл

@ -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_singleton_open(void);
int mca_pcmclient_singleton_close(void);
/*
* Startup / Shutdown
*/
struct mca_pcmclient_base_module_1_0_0_t* mca_pcmclient_singleton_init(int *priority, bool *allow_multi_user_threads, bool *have_hidden_threads);
int mca_pcmclient_singleton_finalize(void);
/*
* "Action" functions
*/
int mca_pcmclient_singleton_get_peers(ompi_process_name_t **peers, size_t *npeers);
ompi_process_name_t* mca_pcmclient_singleton_get_self(void);

Просмотреть файл

@ -0,0 +1,89 @@
/*
* $HEADER$
*/
#include "ompi_config.h"
#include "pcmclient-singleton-version.h"
#include "include/constants.h"
#include "include/types.h"
#include "mca/mca.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/singleton/pcmclient_singleton.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_singleton_component = {
{
MCA_PCMCLIENT_BASE_VERSION_1_0_0,
"singleton", /* MCA component name */
MCA_pcmclient_singleton_MAJOR_VERSION, /* MCA component major version */
MCA_pcmclient_singleton_MINOR_VERSION, /* MCA component minor version */
MCA_pcmclient_singleton_RELEASE_VERSION, /* MCA component release version */
mca_pcmclient_singleton_open, /* component open */
mca_pcmclient_singleton_close /* component close */
},
{
false /* checkpoint / restart */
},
mca_pcmclient_singleton_init, /* component init */
mca_pcmclient_singleton_finalize
};
struct mca_pcmclient_base_module_1_0_0_t mca_pcmclient_singleton_1_0_0 = {
mca_pcmclient_singleton_get_self,
mca_pcmclient_singleton_get_peers,
};
ompi_process_name_t *mca_pcmclient_singleton_procs = NULL;
int
mca_pcmclient_singleton_open(void)
{
return OMPI_SUCCESS;
}
int
mca_pcmclient_singleton_close(void)
{
return OMPI_SUCCESS;
}
struct mca_pcmclient_base_module_1_0_0_t *
mca_pcmclient_singleton_init(int *priority,
bool *allow_multiple_user_threads,
bool *have_hidden_threads)
{
*priority = 0;
*allow_multiple_user_threads = true;
*have_hidden_threads = false;
return &mca_pcmclient_singleton_1_0_0;
}
int
mca_pcmclient_singleton_finalize(void)
{
if (NULL == mca_pcmclient_singleton_procs) {
free(mca_pcmclient_singleton_procs);
}
return OMPI_SUCCESS;
}

Просмотреть файл

@ -7,7 +7,8 @@
#include "threads/mutex.h"
#include "util/output.h"
#include "proc/proc.h"
#include "mca/pcm/pcm.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/base/base.h"
#include "mca/oob/oob.h"
#include "mca/ns/base/base.h"
@ -65,11 +66,12 @@ int ompi_proc_init(void)
size_t i, npeers;
int rc;
if(OMPI_SUCCESS != (rc = mca_pcm.pcm_peers(&peers, &npeers))) {
if(OMPI_SUCCESS != (rc = mca_pcmclient.pcmclient_get_peers(&peers,
&npeers))) {
ompi_output(0, "ompi_proc_init: mca_pcm.pcm_peers failed with errno=%d", rc);
return rc;
}
if(NULL == (self = mca_pcm.pcm_self())) {
if(NULL == (self = mca_pcmclient.pcmclient_get_self())) {
ompi_output(0, "ompi_proc_init: mca_pcm.pcm_self failed with errno=%d", rc);
return rc;
}

Просмотреть файл

@ -10,7 +10,9 @@
#include "runtime/runtime.h"
#include "util/output.h"
#include "threads/mutex.h"
#include "mca/llm/base/base.h"
#include "mca/pcm/base/base.h"
#include "mca/pcmclient/base/base.h"
#include "mca/oob/oob.h"
#include "mca/ns/base/base.h"
#include "util/session_dir.h"
@ -27,6 +29,8 @@ int ompi_rte_finalize(void)
{
mca_oob_base_close();
mca_pcm_base_close();
mca_llm_base_close();
mca_pcmclient_base_close();
mca_ns_base_close();
ompi_session_dir_finalize();

Просмотреть файл

@ -11,6 +11,8 @@
#include "util/output.h"
#include "threads/mutex.h"
#include "mca/pcm/base/base.h"
#include "mca/pcmclient/base/base.h"
#include "mca/llm/base/base.h"
#include "mca/oob/oob.h"
#include "mca/ns/base/base.h"
#include "util/proc_info.h"
@ -104,6 +106,32 @@ int ompi_rte_init(bool *allow_multi_user_threads, bool *have_hidden_threads)
*allow_multi_user_threads &= user_threads;
*have_hidden_threads |= hidden_threads;
/*
* Process Control and Monitoring Client
*/
if (OMPI_SUCCESS != (ret = mca_pcmclient_base_open())) {
/* JMS show_help */
printf("show_help: ompi_rte_init failed in pcmclient_base_open\n");
return ret;
}
if (OMPI_SUCCESS != (ret = mca_pcmclient_base_select(&user_threads,
&hidden_threads))) {
printf("show_help: ompi_rte_init failed in pcmclient_base_select\n");
/* JMS show_help */
return ret;
}
*allow_multi_user_threads &= user_threads;
*have_hidden_threads |= hidden_threads;
/*
* Allocation code - open only. pcm will init if needed
*/
if (OMPI_SUCCESS != (ret = mca_llm_base_open())) {
/* JMS show_help */
printf("show_help: ompi_rte_init failed in llm_base_open\n");
return ret;
}
/*
* Process Control and Monitoring
*/

Просмотреть файл

@ -8,7 +8,7 @@
#include "runtime/runtime_types.h"
#include "mca/pcm/pcm.h"
extern mca_pcm_base_module_t mca_pcm;
ompi_list_t*
ompi_rte_allocate_resources(int jobid, int nodes, int procs)
{

Просмотреть файл

@ -7,7 +7,10 @@
#include "runtime/runtime.h"
#include "runtime/runtime_types.h"
#include "mca/pcm/pcm.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/base/base.h"
mca_pcm_base_module_t mca_pcm;
bool
ompi_rte_can_spawn(void)
@ -34,22 +37,22 @@ ompi_rte_spawn_procs(int jobid, ompi_list_t *schedule_list)
ompi_process_name_t*
ompi_rte_get_self(void)
{
if (NULL == mca_pcm.pcm_self) {
if (NULL == mca_pcmclient.pcmclient_get_self) {
return NULL;
}
return mca_pcm.pcm_self();
return mca_pcmclient.pcmclient_get_self();
}
int
ompi_rte_get_peers(ompi_process_name_t **peers, size_t *npeers)
{
if (NULL == mca_pcm.pcm_peers) {
if (NULL == mca_pcmclient.pcmclient_get_peers) {
return OMPI_ERROR;
}
return mca_pcm.pcm_peers(peers, npeers);
return mca_pcmclient.pcmclient_get_peers(peers, npeers);
}

Просмотреть файл

@ -5,7 +5,7 @@
include $(top_srcdir)/config/Makefile.options
SUBDIRS = ompi_info mpirun wrappers ompid
SUBDIRS = ompi_info mpirun wrappers ompid bootproxy
DIST_SUBDIRS = $(SUBDIRS) openmpi

Просмотреть файл

@ -5,8 +5,7 @@
include $(top_srcdir)/config/Makefile.options
#libs = $(top_builddir)/src/libmpi.la
libs =
libs = $(top_builddir)/src/libmpi.la
bin_PROGRAMS = mca_pcm_rsh_bootproxy

75
src/tools/bootproxy/bootproxy.c Обычный файл
Просмотреть файл

@ -0,0 +1,75 @@
/*
* $HEADER
*/
#include "ompi_config.h"
#include "runtime/runtime.h"
#include "mca/pcm/base/base.h"
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
int
main(int argc, char *argv[])
{
ompi_rte_node_schedule_t *sched;
ompi_rte_node_allocation_t *nodelist;
pid_t pid;
int i;
int ret;
ompi_init(argc, argv);
/* print our contact information */
fprintf(stdout, "@BOOTPROXY@\n");
sched = OBJ_NEW(ompi_rte_node_schedule_t);
/* recv_schedule wants an already initialized ompi_list_t */
ret = mca_pcm_base_recv_schedule(stdin, sched,
sched->nodelist);
if (ret != OMPI_SUCCESS) {
fprintf(stderr, "Failure in receiving schedule information\n");
exit(1);
}
/* sanity check */
if (ompi_list_get_size(sched->nodelist) > 1) {
fprintf(stderr, "Received more than one node - ignoring extra info\n");
}
/* fill our environment */
for (i = 0 ; sched->env[i] != NULL ; ++i) {
putenv(sched->env[i]);
}
/* get in the right place */
if (sched->cwd != NULL) {
ret = chdir(sched->cwd);
if (ret != 0) {
perror("chdir");
exit(1);
}
}
/* let's go! - if we are the parent, don't stick around... */
pid = fork();
if (pid < 0) {
/* error :( */
perror("fork");
} else if (pid == 0) {
/* child */
execvp(sched->argv[0], sched->argv);
perror("exec");
}
OBJ_RELEASE(sched);
ompi_finalize();
return 0;
}

Просмотреть файл

@ -93,10 +93,11 @@ fi
# Set the environment
#
######################################################################
export OMPI_MCA_pcm_cofs_cellid="${ompi_cellid}"
export OMPI_MCA_pcm_cofs_jobid="${ompi_jobid}"
export OMPI_MCA_pcm_cofs_procid="${ompi_procid}"
export OMPI_MCA_pcm_cofs_num_procs="${ompi_numprocs}"
export OMPI_MCA_pcmclient_env_cellid="${ompi_cellid}"
export OMPI_MCA_pcmclient_env_jobid="${ompi_jobid}"
export OMPI_MCA_pcmclient_env_procid="${ompi_procid}"
export OMPI_MCA_pcmclient_env_num_procs="${ompi_numprocs}"
export OMPI_MCA_pcmclient_env_vpid_start="0"
if test ! -z "${ompi_commdir}"; then
export OMPI_MCA_oob_cofs_dir="${ompi_commdir}"
fi

Просмотреть файл

@ -5,12 +5,15 @@
#include "ompi_config.h"
#include "mca/ns/ns.h"
#include "runtime/runtime.h"
#include "mca/base/base.h"
#include "util/cmd_line.h"
#include "include/constants.h"
#include <stdio.h>
#include <unistd.h>
#include <sys/param.h>
static long num_running_procs;
@ -31,6 +34,12 @@ main(int argc, char *argv[])
int ret;
ompi_cmd_line_t *cmd_line = NULL;
ompi_list_t *nodelist = NULL;
ompi_list_t schedlist;
mca_ns_base_jobid_t new_jobid;
int num_procs;
ompi_rte_node_schedule_t *sched;
ompi_list_item_t *nodeitem;
char cwd[MAXPATHLEN];
/*
* Intialize our Open MPI environment
@ -72,6 +81,11 @@ main(int argc, char *argv[])
return ret;
}
/* get our numprocs */
if (ompi_cmd_line_is_taken(cmd_line, "np")) {
num_procs = atoi(ompi_cmd_line_get_param(cmd_line, "np", 0, 0));
printf("num_procs: %d\n", num_procs);
}
/*
* Start the Open MPI Run Time Environment
@ -92,11 +106,9 @@ main(int argc, char *argv[])
/*
* Prep for starting a new job
*/
/*
* BWB: todo:
*
* - ompi_rte_get_new_jobid()
*/
/* BWB - ompi_rte_get_new_jobid() */
new_jobid = getpid();
/* BWB - fix jobid, procs, and nodes */
nodelist = ompi_rte_allocate_resources(0, 0, 2);
@ -107,24 +119,45 @@ main(int argc, char *argv[])
}
/*
* BWB: todo:
*
* MPI process mapping
* - ompi_rte_register_monitor()
* - ompi_rte_spawn()
* - ompi_rte_monitor()
* - ompi_rte_kill_job()
* Process mapping
*/
OBJ_CONSTRUCT(&schedlist, ompi_list_t);
sched = OBJ_NEW(ompi_rte_node_schedule_t);
OBJ_CONSTRUCT(&(sched->nodelist), ompi_list_t);
ompi_cmd_line_get_tail(cmd_line, &(sched->argc), &(sched->argv));
sched->env = NULL;
getcwd(cwd, MAXPATHLEN);
sched->cwd = strdup(cwd);
/*
* register the monitor
*/
/*
* spawn procs
*/
if (OMPI_SUCCESS != ompi_rte_spawn_procs(new_jobid, &schedlist)) {
printf("show_help: woops! we didn't spawn :( \n");
return -1;
}
/*
* - ompi_rte_monitor()
* - ompi_rte_kill_job()
*/
/*
* Clean up
*/
if (NULL != nodelist) ompi_rte_deallocate_resources(0, nodelist);
if (NULL != nodelist) ompi_rte_deallocate_resources(new_jobid, nodelist);
if (NULL != cmd_line) ompi_cmd_line_free(cmd_line);
ompi_rte_finalize();
mca_base_close();
ompi_finalize();
OBJ_DESTRUCT(&sched);
return 0;
}

Просмотреть файл

@ -20,6 +20,8 @@
#include "mca/llm/base/base.h"
#include "mca/pcm/pcm.h"
#include "mca/pcm/base/base.h"
#include "mca/pcmclient/pcmclient.h"
#include "mca/pcmclient/base/base.h"
#include "mca/oob/oob.h"
#include "mca/oob/base/base.h"
#include "mca/pml/pml.h"
@ -148,6 +150,9 @@ void ompi_info::open_components()
mca_pcm_base_open();
component_map["pcm"] = &mca_pcm_base_components_available;
mca_pcmclient_base_open();
component_map["pcmclient"] = &mca_pcmclient_base_components_available;
mca_pml_base_open();
component_map["pml"] = &mca_pml_base_components_available;

Просмотреть файл

@ -129,6 +129,7 @@ int main(int argc, char *argv[])
ompi_info::mca_types.push_back("oob");
ompi_info::mca_types.push_back("op");
ompi_info::mca_types.push_back("pcm");
ompi_info::mca_types.push_back("pcmclient");
ompi_info::mca_types.push_back("pml");
ompi_info::mca_types.push_back("ptl");
ompi_info::mca_types.push_back("topo");
@ -184,6 +185,7 @@ int main(int argc, char *argv[])
ompi_info::show_component_version("oob", component_all, ver_full, type_all);
ompi_info::show_component_version("op", component_all, ver_full, type_all);
ompi_info::show_component_version("pcm", component_all, ver_full, type_all);
ompi_info::show_component_version("pcmclient", component_all, ver_full, type_all);
ompi_info::show_component_version("pml", component_all, ver_full, type_all);
ompi_info::show_component_version("ptl", component_all, ver_full, type_all);
ompi_info::show_component_version("topo", component_all, ver_full, type_all);