1
1

Missing files.....sorry folks!

This commit was SVN r2488.
Этот коммит содержится в:
Ralph Castain 2004-09-03 18:32:59 +00:00
родитель 3c94af6021
Коммит aa4118e450
3 изменённых файлов: 252 добавлений и 0 удалений

44
src/runtime/ompi_rte_cmd_line_setup.c Обычный файл
Просмотреть файл

@ -0,0 +1,44 @@
/*
* $HEADER$
*/
/**
* @file
*
* Setup command line options for the Open MPI Run Time Environment
*/
#include "ompi_config.h"
#include "util/cmd_line.h"
void ompi_rte_cmd_line_setup(ompi_cmd_line_t *cmd_line)
{
/* setup the rte command line arguments */
ompi_cmd_line_make_opt(cmd_line,
's', "seed", 0,
"Set the daemon seed to true.");
ompi_cmd_line_make_opt(cmd_line,
'u', "universe", 1,
"Specify the Open MPI universe");
ompi_cmd_line_make_opt(cmd_line,
't', "tmpdir", 1,
"Specify the Open MPI prefix for the session directory");
ompi_cmd_line_make_opt(cmd_line, 'w', "webserver", 0,
"Web server available");
ompi_cmd_line_make_opt(cmd_line, 's', "silent", 0,
"No console prompt - operate silently");
ompi_cmd_line_make_opt(cmd_line, 'f', "script", 1,
"Read commands from script file");
ompi_cmd_line_make_opt(cmd_line, 'c', "scope", 1,
"Scope of this universe");
ompi_cmd_line_make_opt(cmd_line, 'h', "hostfile", 1,
"Hostfile for this universe");
}

107
src/runtime/ompi_rte_parse_seed_cmd_line.c Обычный файл
Просмотреть файл

@ -0,0 +1,107 @@
/*
* $HEADER$
*/
/**
* @file
*
* Parse command line options for the Open MPI Run Time Environment
*/
#include "ompi_config.h"
#include "util/cmd_line.h"
#include "util/sys_info.h"
#include "util/proc_info.h"
#include "runtime/runtime.h"
void ompi_rte_parse_seed_cmd_line(ompi_cmd_line_t *cmd_line)
{
char *universe, *tmp;
/* get universe name and store it, if user specified it */
/* otherwise, stick with default name */
universe = strdup(ompi_universe_info.name); /* save the default */
if (ompi_cmd_line_is_taken(cmd_line, "universe") ||
ompi_cmd_line_is_taken(cmd_line, "u")) {
if (NULL == ompi_cmd_line_get_param(cmd_line, "universe", 0, 0)) {
fprintf(stderr, "error retrieving universe name - please report error to bugs@open-mpi.org\n");
exit(1);
}
universe = strdup(ompi_cmd_line_get_param(cmd_line, "universe", 0, 0));
if (NULL != (tmp = strchr(universe, ':'))) { /* name contains remote host */
/* get the host name, and the universe name separated */
/* could be in form remote-uid@remote-host:universe */
*tmp = '\0';
tmp++;
ompi_universe_info.name = strdup(tmp);
if (NULL != (tmp = strchr(universe, '@'))) { /* remote name includes remote uid */
*tmp = '\0';
tmp++;
ompi_universe_info.host = strdup(tmp);
ompi_universe_info.uid = strdup(universe);
} else { /* no remote id - just remote host */
ompi_universe_info.host = strdup(universe);
}
} else { /* no remote host - just universe name provided */
ompi_universe_info.name = strdup(universe);
}
}
/* get desired universe scope, if specified */
if (ompi_cmd_line_is_taken(cmd_line, "scope")) {
if (NULL == ompi_cmd_line_get_param(cmd_line, "scope", 0, 0)) {
fprintf(stderr, "error retrieving universe scope - please report error to bugs@open-mpi.org\n");
exit(1);
}
ompi_universe_info.scope = strdup(ompi_cmd_line_get_param(cmd_line, "scope", 0, 0));
}
/* get the temporary directory name for the session directory, if provided on command line */
if (ompi_cmd_line_is_taken(cmd_line, "tmpdir")) {
if (NULL == ompi_cmd_line_get_param(cmd_line, "tmpdir", 0, 0)) {
fprintf(stderr, "error retrieving tmpdir name - please report error to bugs@open-mpi.org\n");
exit(1);
}
ompi_process_info.tmpdir_base = strdup(ompi_cmd_line_get_param(cmd_line, "tmpdir", 0, 0));
} else {
ompi_process_info.tmpdir_base = NULL;
}
/* find out if silent */
if (ompi_cmd_line_is_taken(cmd_line, "silent")) {
ompi_universe_info.silent_mode = true;
} else {
ompi_universe_info.silent_mode = false;
}
/* find out if web interface is desired */
if (ompi_cmd_line_is_taken(cmd_line, "webserver")) {
ompi_universe_info.web_server = true;
} else {
ompi_universe_info.web_server = false;
}
/* find out if script is to be executed */
if (ompi_cmd_line_is_taken(cmd_line, "script")) {
if (NULL == ompi_cmd_line_get_param(cmd_line, "script", 0, 0)) {
fprintf(stderr, "error retrieving script file name - please report error to bugs@open-mpi.org\n");
exit(1);
}
ompi_universe_info.scriptfile = strdup(ompi_cmd_line_get_param(cmd_line, "script", 0, 0));
} else {
ompi_universe_info.scriptfile = NULL;
}
/* Find out if hostfile specified */
if (ompi_cmd_line_is_taken(cmd_line, "hostfile")) {
if (NULL == ompi_cmd_line_get_param(cmd_line, "hostfile", 0, 0)) {
fprintf(stderr, "error retrieving host file name - please report error to bugs@open-mpi.org\n");
exit(1);
}
ompi_universe_info.hostfile = strdup(ompi_cmd_line_get_param(cmd_line, "hostfile", 0, 0));
} else {
ompi_universe_info.hostfile = NULL;
}
}

101
src/runtime/ompi_rte_universe_exists.c Обычный файл
Просмотреть файл

@ -0,0 +1,101 @@
/*
* $HEADER$
*/
/**
* @file
*
* Setup command line options for the Open MPI Run Time Environment
*/
#include "ompi_config.h"
#include "include/constants.h"
#include "util/sys_info.h"
#include "util/proc_info.h"
#include "util/os_path.h"
#include "util/pack.h"
#include "util/session_dir.h"
#include "util/universe_setup_file_io.h"
#include "mca/oob/base/base.h"
#include "mca/ns/base/base.h"
#include "runtime/runtime.h"
#define OMPI_DAEMON_OOB_PACK_CMD OMPI_INT16
#define OMPI_DAEMON_INITIAL_CONTACT_CMD 0x01
#define OMPI_DAEMON_CONTACT_ACK_CMD 0x02
int ompi_rte_universe_exists(char *host, char *name, char *tmpdir, char *oob_contact_info)
{
char *contact_file;
int32_t command, recv_tag;
int ret;
ompi_buffer_t msg, response;
ompi_process_name_t seed={0,0,0};
/* does universe already exist on specified host? Check session directory to see */
/* don't know how to handle remote host yet - only cover localhost */
if (0 != strncmp(host, ompi_system_info.nodename, strlen(ompi_system_info.nodename))) { /* remote host specified */
fprintf(stderr, "remote hosts not currently supported\n");
return OMPI_ERR_NOT_IMPLEMENTED;
}
/* check to see if local universe already exists */
if (OMPI_SUCCESS == ompi_session_dir(false, tmpdir, ompi_system_info.user, ompi_system_info.nodename, NULL,
name, NULL, NULL)) { /* found */
/* check for "contact-info" file. if present, read it in. */
contact_file = ompi_os_path(false, ompi_process_info.universe_session_dir,
"universe-setup.txt", NULL);
if (OMPI_SUCCESS != (ret = ompi_read_universe_setup_file(contact_file))) {
return ret;
}
if (!ompi_universe_info.persistence || /* not persistent... */
(0 == strncmp(ompi_universe_info.scope, "local", strlen("local")))) { /* ...or no connection allowed */
return OMPI_ERR_NO_CONNECTION_ALLOWED;
}
/* if persistent, use contact info to connect */
if (OMPI_SUCCESS != mca_oob_set_contact_info(ompi_universe_info.oob_contact_info)) { /* set contact info */
fprintf(stderr, "error setting oob contact info - please report error to bugs@open-mpi.org\n");
return OMPI_ERR_FATAL;
}
command = OMPI_DAEMON_INITIAL_CONTACT_CMD;
recv_tag = MCA_OOB_TAG_DAEMON;
if (OMPI_SUCCESS != ompi_buffer_init(&msg, 0) ||
OMPI_SUCCESS != ompi_buffer_init(&response, 0)) { /* can't get a message buffer */
fprintf(stderr, "can't get message buffer - please report error to bugs@open-mpi.org\n");
return OMPI_ERR_FATAL;
}
ompi_pack(msg, &command, 1, OMPI_DAEMON_OOB_PACK_CMD);
if (0 > mca_oob_send_packed(&seed, msg, MCA_OOB_TAG_DAEMON, 0)) {
/* failure means contact couldn't be made - probably universe has failed,
* but could be that it just isn't available for some reason like swapping,
* timeout for other reasons, etc. regardless, must start new universe */
/* for safety, will restart with "unique"-ified name */
return OMPI_ERR_CONNECTION_FAILED;
}
if (0 > mca_oob_recv_packed(&seed, &response, &recv_tag)) {
fprintf(stderr, "garbled response\n");
}
ompi_unpack(response, &command, 1, OMPI_DAEMON_OOB_PACK_CMD);
if (OMPI_DAEMON_CONTACT_ACK_CMD != command) {
/* universe refuses to acknowledge contact - probably local scope
* so need to start our own universe instead */
return OMPI_ERR_CONNECTION_REFUSED;
}
}
}