diff --git a/src/mca/pcm/rsh/configure.params b/src/mca/pcm/rsh/configure.params index 7ae8e23d27..b58ec3c219 100644 --- a/src/mca/pcm/rsh/configure.params +++ b/src/mca/pcm/rsh/configure.params @@ -6,4 +6,4 @@ # Specific to this module PARAM_INIT_FILE=src/pcm_rsh.c -PARAM_CONFIG_FILES="Makefile src/Makefile" +PARAM_CONFIG_FILES="Makefile src/Makefile src/bootproxy/Makefile" diff --git a/src/mca/pcm/rsh/src/Makefile.am b/src/mca/pcm/rsh/src/Makefile.am index 9f4d95f337..2f9d4efee9 100644 --- a/src/mca/pcm/rsh/src/Makefile.am +++ b/src/mca/pcm/rsh/src/Makefile.am @@ -4,9 +4,23 @@ include $(top_ompi_srcdir)/config/Makefile.options +SUBDIRS = + noinst_LTLIBRARIES = libmca_pcm_rsh.la libmca_pcm_rsh_la_SOURCES = \ pcm_rsh.h \ - pcm_rsh_module.c \ - pcm_rsh.c + 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_get_unique_name.c \ + pcm_rsh_kill_job.c \ + pcm_rsh_kill_proc.c \ + pcm_rsh_register_monitor.c \ + pcm_rsh_spawn_procs.c + diff --git a/src/mca/pcm/rsh/src/bootproxy/Makefile.am b/src/mca/pcm/rsh/src/bootproxy/Makefile.am new file mode 100644 index 0000000000..325c63217e --- /dev/null +++ b/src/mca/pcm/rsh/src/bootproxy/Makefile.am @@ -0,0 +1,24 @@ +# -*- makefile -*- +# +# $HEADER$ +# + +include $(top_srcdir)/config/Makefile.options + +libs = $(top_builddir)/src/libmpi.la + +bin_PROGRAMS = mca_pcm_rsh_bootproxy + +mca_pcm_rsh_bootproxy_SOURCES = \ + bootproxy.c +mca_pcm_rsh_bootproxy_LDADD = \ + $(libs) \ + $(LIBMPI_EXTRA_LIBS) \ + $(LIBOMPI_EXTRA_LIBS) \ + -lm +mca_pcm_rsh_bootproxy_LDFLAGS = \ + $(LIBMPI_EXTRA_LDFLAGS) \ + $(LIBOMPI_EXTRA_LDFLAGS) +mca_pcm_rsh_bootproxy_DEPENDENCIES = \ + $(libs) + diff --git a/src/mca/pcm/rsh/src/bootproxy/bootproxy.c b/src/mca/pcm/rsh/src/bootproxy/bootproxy.c new file mode 100644 index 0000000000..60cacc66d5 --- /dev/null +++ b/src/mca/pcm/rsh/src/bootproxy/bootproxy.c @@ -0,0 +1,361 @@ +/* + * $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" +#include "mca/pcm/base/pcm_base_pack_unpack.h" + +/* 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 */ + +static int *vpid_success; +static int cmd_argc; +static char **cmd_argv; +static ompi_value_array_t *hostmap; + +/** + * 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[]) +{ + 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; +} diff --git a/src/mca/pcm/rsh/src/pcm_rsh.c b/src/mca/pcm/rsh/src/pcm_rsh.c index 5933a0d1e1..10e64c5e26 100644 --- a/src/mca/pcm/rsh/src/pcm_rsh.c +++ b/src/mca/pcm/rsh/src/pcm_rsh.c @@ -15,4 +15,3 @@ #include #include #include - diff --git a/src/mca/pcm/rsh/src/pcm_rsh.h b/src/mca/pcm/rsh/src/pcm_rsh.h index 756ae56e47..05e8507971 100644 --- a/src/mca/pcm/rsh/src/pcm_rsh.h +++ b/src/mca/pcm/rsh/src/pcm_rsh.h @@ -3,6 +3,7 @@ * $HEADER$ * */ + #include "ompi_config.h" #include "mca/pcm/pcm.h" @@ -10,17 +11,47 @@ #include -/* - * Module open / close - */ -int mca_pcm_rsh_open(void); -int mca_pcm_rsh_close(void); +#ifndef MCA_PCM_RSH_H_ +#define MCA_PCM_RSH_H_ -/* - * Startup / Shutdown - */ -struct mca_pcm_base_module_1_0_0_t* mca_pcm_rsh_init(int *priority, +#ifdef __cplusplus +extern "C" { +#endif + + /* + * Module open / close + */ + int mca_pcm_rsh_component_open(void); + int mca_pcm_rsh_component_close(void); + + /* + * Startup / Shutdown + */ + struct mca_pcm_base_module_1_0_0_t* mca_pcm_rsh_init(int *priority, bool *allow_multi_user_threads, bool *have_hidden_threads); -int mca_pcm_rsh_finalize(void); + int mca_pcm_rsh_finalize(void); + /* + * Interface + */ + char *mca_pcm_rsh_get_unique_name(void); + int mca_pcm_rsh_allocate_resources(int jobid, int nodes, int procs, + ompi_list_t **nodelist); + int mca_pcm_rsh_register_monitor(int jobid, + mca_pcm_base_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_vpid_t start_vpid); + 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); + +#ifdef __cplusplus +} +#endif + +#endif /* MCA_PCM_RSH_H_ */ diff --git a/src/mca/pcm/rsh/src/pcm_rsh_allocate_resources.c b/src/mca/pcm/rsh/src/pcm_rsh_allocate_resources.c new file mode 100644 index 0000000000..9892a34039 --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_allocate_resources.c @@ -0,0 +1,17 @@ +/* -*- C -*- + * + * $HEADER$ + * + */ + +#include "ompi_config.h" + +#include "mca/pcm/pcm.h" +#include "mca/pcm/rsh/src/pcm_rsh.h" + +int +mca_pcm_rsh_allocate_resources(int jobid, int nodes, int procs, + ompi_list_t **nodelist) +{ + return OMPI_SUCCESS; +} diff --git a/src/mca/pcm/rsh/src/pcm_rsh_can_spawn.c b/src/mca/pcm/rsh/src/pcm_rsh_can_spawn.c new file mode 100644 index 0000000000..643145e0a0 --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_can_spawn.c @@ -0,0 +1,16 @@ +/* -*- C -*- + * + * $HEADER$ + * + */ + +#include "ompi_config.h" + +#include "mca/pcm/pcm.h" +#include "mca/pcm/rsh/src/pcm_rsh.h" + +bool +mca_pcm_rsh_can_spawn(void) +{ + return false; +} diff --git a/src/mca/pcm/rsh/src/pcm_rsh_component.c b/src/mca/pcm/rsh/src/pcm_rsh_component.c new file mode 100644 index 0000000000..46bb358d19 --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_component.c @@ -0,0 +1,160 @@ +/* -*- C -*- + * + * $HEADER$ + * + */ + +#include "ompi_config.h" + +#include "include/constants.h" +#include "include/types.h" +#include "util/malloc.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/rsh/src/pcm_rsh.h" + +#include +#include +#include +#include + +/* + * Struct of function pointers and all that to let us be initialized + */ +mca_pcm_base_component_1_0_0_t mca_pcm_rsh_component = { + { + MCA_PCM_BASE_VERSION_1_0_0, + + "rsh", /* MCA component name */ + 1, /* MCA component major version */ + 0, /* MCA component minor version */ + 0, /* MCA component release version */ + mca_pcm_rsh_component_open, /* component open */ + mca_pcm_rsh_component_close /* component close */ + }, + { + false /* checkpoint / restart */ + }, + mca_pcm_rsh_init, /* component init */ + mca_pcm_rsh_finalize +}; + + +struct mca_pcm_base_module_1_0_0_t mca_pcm_rsh_1_0_0 = { + mca_pcm_rsh_get_unique_name, + mca_pcm_rsh_allocate_resources, + 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 +}; + + +/* + * 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; + +/* + * 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_component_open(void) +{ + mca_pcm_rsh_param_username = + mca_base_param_register_string("pcm", "rsh", "username", NULL, NULL); + + 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 = + mca_base_param_register_int("pcm", "rsh", "no_profile", NULL, 0); + mca_pcm_rsh_param_fast = + mca_base_param_register_int("pcm", "rsh", "fast", NULL, 0); + mca_pcm_rsh_param_ignore_stderr = + mca_base_param_register_int("pcm", "rsh", "ignore_stderr", NULL, 0); + + 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; +} + + +int +mca_pcm_rsh_component_close(void) +{ + return OMPI_SUCCESS; +} + + +mca_pcm_base_module_t* +mca_pcm_rsh_init(int *priority, + bool *allow_multi_user_threads, + bool *have_hidden_threads) +{ + 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, + &mca_pcm_rsh_fast); + 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_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; + + return &mca_pcm_rsh_1_0_0; +} + + +int +mca_pcm_rsh_finalize(void) +{ + return OMPI_SUCCESS; +} + diff --git a/src/mca/pcm/rsh/src/pcm_rsh_deallocate_resources.c b/src/mca/pcm/rsh/src/pcm_rsh_deallocate_resources.c new file mode 100644 index 0000000000..3733d14a3f --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_deallocate_resources.c @@ -0,0 +1,16 @@ +/* -*- 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; +} diff --git a/src/mca/pcm/rsh/src/pcm_rsh_get_peers.c b/src/mca/pcm/rsh/src/pcm_rsh_get_peers.c new file mode 100644 index 0000000000..bfb565f6f3 --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_get_peers.c @@ -0,0 +1,16 @@ +/* -*- 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; +} diff --git a/src/mca/pcm/rsh/src/pcm_rsh_get_self.c b/src/mca/pcm/rsh/src/pcm_rsh_get_self.c new file mode 100644 index 0000000000..67e31eea7c --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_get_self.c @@ -0,0 +1,17 @@ +/* -*- 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; +} + diff --git a/src/mca/pcm/rsh/src/pcm_rsh_get_unique_name.c b/src/mca/pcm/rsh/src/pcm_rsh_get_unique_name.c new file mode 100644 index 0000000000..4f8db1d810 --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_get_unique_name.c @@ -0,0 +1,18 @@ +/* -*- C -*- + * + * $HEADER$ + * + */ + +#include "ompi_config.h" + +#include "mca/pcm/pcm.h" +#include "mca/pcm/rsh/src/pcm_rsh.h" + +#include + +char * +mca_pcm_rsh_get_unique_name(void) +{ + return strdup("none"); +} diff --git a/src/mca/pcm/rsh/src/pcm_rsh_internal.h b/src/mca/pcm/rsh/src/pcm_rsh_internal.h new file mode 100644 index 0000000000..50c605f052 --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_internal.h @@ -0,0 +1,44 @@ +/* -*- C -*- + * + * $HEADER$ + * + */ + +#include "ompi_config.h" + +#include "mca/pcm/pcm.h" +#include "include/types.h" + +#include + +#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_ */ diff --git a/src/mca/pcm/rsh/src/pcm_rsh_kill_job.c b/src/mca/pcm/rsh/src/pcm_rsh_kill_job.c new file mode 100644 index 0000000000..e509929209 --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_kill_job.c @@ -0,0 +1,16 @@ +/* -*- C -*- + * + * $HEADER$ + * + */ + +#include "ompi_config.h" + +#include "mca/pcm/pcm.h" +#include "mca/pcm/rsh/src/pcm_rsh.h" + +int +mca_pcm_rsh_kill_job(int jobid, int flags) +{ + return OMPI_SUCCESS; +} diff --git a/src/mca/pcm/rsh/src/pcm_rsh_kill_proc.c b/src/mca/pcm/rsh/src/pcm_rsh_kill_proc.c new file mode 100644 index 0000000000..7c064e400a --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_kill_proc.c @@ -0,0 +1,16 @@ +/* -*- C -*- + * + * $HEADER$ + * + */ + +#include "ompi_config.h" + +#include "mca/pcm/pcm.h" +#include "mca/pcm/rsh/src/pcm_rsh.h" + +int +mca_pcm_rsh_kill_proc(ompi_process_name_t *name, int flags) +{ + return OMPI_SUCCESS; +} diff --git a/src/mca/pcm/rsh/src/pcm_rsh_module.c b/src/mca/pcm/rsh/src/pcm_rsh_module.c deleted file mode 100644 index d6df06b008..0000000000 --- a/src/mca/pcm/rsh/src/pcm_rsh_module.c +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- C -*- - * - * $HEADER$ - * - */ - -#include "ompi_config.h" - -#include "include/constants.h" -#include "include/types.h" -#include "util/malloc.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/rsh/src/pcm_rsh.h" - -#include -#include -#include -#include - -/* - * Struct of function pointers and all that to let us be initialized - */ -mca_pcm_base_component_1_0_0_t mca_pcm_rsh_component = { - { - MCA_PCM_BASE_VERSION_1_0_0, - - "rsh", /* MCA component name */ - 1, /* MCA component major version */ - 0, /* MCA component minor version */ - 0, /* MCA component release version */ - mca_pcm_rsh_open, /* component open */ - mca_pcm_rsh_close /* component close */ - }, - { - false /* checkpoint / restart */ - }, - mca_pcm_rsh_init, /* component init */ - mca_pcm_rsh_finalize -}; - - -int -mca_pcm_rsh_open(void) -{ - return OMPI_SUCCESS; -} - - -int -mca_pcm_rsh_close(void) -{ - return OMPI_SUCCESS; -} - - -struct mca_pcm_base_module_1_0_0_t* -mca_pcm_rsh_init(int *priority, bool *allow_multi_user_threads, - bool *have_hidden_threads) -{ - return NULL; -} - - -int -mca_pcm_rsh_finalize(void) -{ - return OMPI_SUCCESS; -} - diff --git a/src/mca/pcm/rsh/src/pcm_rsh_register_monitor.c b/src/mca/pcm/rsh/src/pcm_rsh_register_monitor.c new file mode 100644 index 0000000000..1ab80d9cb4 --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_register_monitor.c @@ -0,0 +1,18 @@ +/* -*- C -*- + * + * $HEADER$ + * + */ + +#include "ompi_config.h" + +#include "mca/pcm/pcm.h" +#include "mca/pcm/rsh/src/pcm_rsh.h" + +#include + +int +mca_pcm_rsh_register_monitor(int jobid, mca_pcm_base_monitor_fn_t func) +{ + return OMPI_SUCCESS; +} diff --git a/src/mca/pcm/rsh/src/pcm_rsh_spawn_procs.c b/src/mca/pcm/rsh/src/pcm_rsh_spawn_procs.c new file mode 100644 index 0000000000..4e78c1ae0a --- /dev/null +++ b/src/mca/pcm/rsh/src/pcm_rsh_spawn_procs.c @@ -0,0 +1,17 @@ +/* -*- C -*- + * + * $HEADER$ + * + */ + +#include "ompi_config.h" + +#include "mca/pcm/pcm.h" +#include "mca/pcm/rsh/src/pcm_rsh.h" + +int +mca_pcm_rsh_spawn_procs(int jobid, ompi_list_t schedule_list, + ompi_vpid_t start_vpid) +{ + return OMPI_SUCCESS; +}