1
1

The Windows job scheduler PLS. Initial commit as I have to move to

another Windows cluster. Right now it's not in a usable state.

This commit was SVN r15113.
Этот коммит содержится в:
George Bosilca 2007-06-17 04:54:07 +00:00
родитель ceb8abe9c1
Коммит 99e701062a
8 изменённых файлов: 1612 добавлений и 0 удалений

0
orte/mca/pls/submit/.ompi_ignore Обычный файл
Просмотреть файл

48
orte/mca/pls/submit/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,48 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
dist_pkgdata_DATA = help-pls-rsh.txt
sources = \
pls_rsh.h \
pls_rsh_component.c \
pls_rsh_module.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_pls_rsh_DSO
component_noinst =
component_install = mca_pls_rsh.la
else
component_noinst = libmca_pls_rsh.la
component_install =
endif
mcacomponentdir = $(pkglibdir)
mcacomponent_LTLIBRARIES = $(component_install)
mca_pls_rsh_la_SOURCES = $(sources)
mca_pls_rsh_la_LDFLAGS = -module -avoid-version
mca_pls_rsh_la_LIBADD = \
$(top_ompi_builddir)/orte/libopen-rte.la \
$(top_ompi_builddir)/opal/libopen-pal.la
noinst_LTLIBRARIES = $(component_noinst)
libmca_pls_rsh_la_SOURCES =$(sources)
libmca_pls_rsh_la_LDFLAGS = -module -avoid-version

17
orte/mca/pls/submit/configure.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,17 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2006 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# MCA_pls_submit_CONFIG([action-if-found], [action-if-not-found])
# -----------------------------------------------------------
AC_DEFUN([MCA_pls_submit_CONFIG],[
AC_CHECK_FUNC([fork], [$1], [$2])
])dnl

22
orte/mca/pls/submit/configure.params Обычный файл
Просмотреть файл

@ -0,0 +1,22 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2007 Los Alamos National Security, LLC. All rights
# reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
PARAM_CONFIG_FILES="Makefile"

66
orte/mca/pls/submit/help-pls-submit.txt Обычный файл
Просмотреть файл

@ -0,0 +1,66 @@
# -*- text -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. All rights
# reserved.
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
#
# $HEADER$
#
# This is the US/English general help file for Open RTE's orterun.
#
[no-local-orted]
The rsh PLS component was not able to find the executable "orted" in
your PATH or in the directory where Open MPI/OpenRTE was initially installed,
and therefore cannot continue.
For reference, your current PATH is:
%s
We also looked for orted in the following directory:
%s
[multiple-prefixes]
Specified multiple application contexts using different
settings for --prefix. Care should be taken, that corresponding
processes are mapped to different nodes. Having multiple prefixes
per node is not allowed.
The previously set prefix was
%s
the prefix to be set overriding:
%s
[concurrency-less-than-zero]
The value of the MCA parameter "pls_rsh_num_concurrent" is less than
or equal to zero (%d). This parameter is used to determine how many
remote agents (typically rsh or ssh) to invoke concurrently while
launching parallel jobs.
This value has automatically be reset to 1; processing will continue.
[deadlock-params]
The rsh launcher has been given a number of %d concurrent daemons to
launch and is in a debug-daemons option. However, the total number of
daemons to launch (%d) is greater than this value. This is a scenario that
will cause the system to deadlock.
To avoid deadlock, either increase the number of concurrent daemons, or
remove the debug-daemons flag.
[unknown-user]
The user (%d) is unknown to the system (i.e. there is no corresponding
entry in the password file). Please contact your system administrator
for a fix.

76
orte/mca/pls/submit/pls_submit.h Обычный файл
Просмотреть файл

@ -0,0 +1,76 @@
/*
* Copyright (c) 2004-2007 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
/**
* @file:
* Part of the submit launcher. See pls_submit.h for an overview of how it works.
*/
#ifndef ORTE_PLS_SUBMIT_EXPORT_H
#define ORTE_PLS_SUBMIT_EXPORT_H
#include "orte_config.h"
#include "opal/mca/mca.h"
#include "orte/mca/pls/pls.h"
#include "opal/threads/condition.h"
BEGIN_C_DECLS
/*
* Module open / close
*/
int orte_pls_submit_component_open(void);
int orte_pls_submit_component_close(void);
orte_pls_base_module_t* orte_pls_submit_component_init(int *priority);
/*
* Startup / Shutdown
*/
int orte_pls_submit_finalize(void);
/*
* Interface
*/
int orte_pls_submit_launch(orte_jobid_t);
int orte_pls_submit_terminate_job(orte_jobid_t, struct timeval *timeout, opal_list_t*);
int orte_pls_submit_terminate_orteds(struct timeval *timeout, opal_list_t*);
int orte_pls_submit_terminate_proc(const orte_process_name_t* proc_name);
int orte_pls_submit_signal_job(orte_jobid_t, int32_t, opal_list_t*);
int orte_pls_submit_signal_proc(const orte_process_name_t* proc_name, int32_t);
/**
* PLS Component
*/
struct orte_pls_submit_component_t {
orte_pls_base_component_t super;
bool debug;
bool debug_daemons;
bool timing;
int delay;
int priority;
char *agent_param;
char** agent_argv;
int agent_argc;
char* agent_path;
char* orted;
orte_std_cntr_t num_children;
orte_std_cntr_t num_concurrent;
opal_mutex_t lock;
opal_condition_t cond;
};
typedef struct orte_pls_submit_component_t orte_pls_submit_component_t;
ORTE_MODULE_DECLSPEC extern orte_pls_submit_component_t mca_pls_submit_component;
extern orte_pls_base_module_t orte_pls_submit_module;
END_C_DECLS
#endif /* ORTE_PLS_SUBMIT_EXPORT_H */

297
orte/mca/pls/submit/pls_submit_component.c Обычный файл
Просмотреть файл

@ -0,0 +1,297 @@
/*
* Copyright (c) 2004-2007 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
* reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*
* These symbols are in a file by themselves to provide nice linker
* semantics. Since linkers generally pull in symbols by object
* files, keeping these symbols as the only symbols in this file
* prevents utility programs such as "ompi_info" from having to import
* entire components just to query their version and parameters.
*/
#include "orte_config.h"
#include "orte/orte_constants.h"
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <ctype.h>
#include "opal/util/opal_environ.h"
#include "opal/util/argv.h"
#include "opal/util/path.h"
#include "opal/util/basename.h"
#include "opal/util/show_help.h"
#include "opal/mca/base/mca_base_param.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/mca/rml/rml.h"
#include "orte/mca/pls/pls.h"
#include "orte/mca/pls/base/pls_private.h"
#include "orte/mca/pls/submit/pls_submit.h"
/*
* Local function
*/
static char **search(const char* agent_list);
/*
* Public string showing the pls ompi_submit component version number
*/
const char *mca_pls_submit_component_version_string =
"Open MPI submit pls MCA component version " ORTE_VERSION;
/*
* Instantiate the public struct with all of our public information
* and pointers to our public functions in it
*/
orte_pls_submit_component_t mca_pls_submit_component = {
{
/* First, the mca_component_t struct containing meta information
about the component itself */
{
/* Indicate that we are a pls v1.3.0 component (which also
implies a specific MCA version) */
ORTE_PLS_BASE_VERSION_1_3_0,
/* Component name and version */
"submit",
ORTE_MAJOR_VERSION,
ORTE_MINOR_VERSION,
ORTE_RELEASE_VERSION,
/* Component open and close functions */
orte_pls_submit_component_open,
orte_pls_submit_component_close
},
/* Next the MCA v1.0.0 component meta data */
{
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
/* Initialization / querying functions */
orte_pls_submit_component_init
}
};
int orte_pls_submit_component_open(void)
{
int tmp, value;
mca_base_component_t *c = &mca_pls_submit_component.super.pls_version;
/* initialize globals */
OBJ_CONSTRUCT(&mca_pls_submit_component.lock, opal_mutex_t);
OBJ_CONSTRUCT(&mca_pls_submit_component.cond, opal_condition_t);
mca_pls_submit_component.num_children = 0;
mca_pls_submit_component.agent_argv = NULL;
mca_pls_submit_component.agent_argc = 0;
mca_pls_submit_component.agent_path = NULL;
/* lookup parameters */
mca_base_param_reg_int(c, "debug",
"Whether or not to enable debugging output for the submit pls component (0 or 1)",
false, false, false, &tmp);
mca_pls_submit_component.debug = OPAL_INT_TO_BOOL(tmp);
mca_base_param_reg_int(c, "num_concurrent",
"How many pls_submit_agent instances to invoke concurrently (must be > 0)",
false, false, 128, &tmp);
if (tmp <= 0) {
opal_show_help("help-pls-submit.txt", "concurrency-less-than-zero",
true, tmp);
tmp = 1;
}
mca_pls_submit_component.num_concurrent = tmp;
if (mca_pls_submit_component.debug == 0) {
mca_base_param_reg_int_name("orte", "debug",
"Whether or not to enable debugging output for all ORTE components (0 or 1)",
false, false, false, &tmp);
mca_pls_submit_component.debug = OPAL_INT_TO_BOOL(tmp);
}
mca_base_param_reg_int_name("orte", "debug_daemons",
"Whether or not to enable debugging of daemons (0 or 1)",
false, false, false, &tmp);
mca_pls_submit_component.debug_daemons = OPAL_INT_TO_BOOL(tmp);
tmp = mca_base_param_reg_int_name("orte", "timing",
"Request that critical timing loops be measured",
false, false, 0, &value);
if (value != 0) {
mca_pls_submit_component.timing = true;
} else {
mca_pls_submit_component.timing = false;
}
mca_base_param_reg_string(c, "orted",
"The command name that the submit pls component will invoke for the ORTE daemon",
false, false, "orted",
&mca_pls_submit_component.orted);
mca_base_param_reg_int(c, "priority",
"Priority of the submit pls component",
false, false, 10,
&mca_pls_submit_component.priority);
mca_base_param_reg_int(c, "delay",
"Delay (in seconds) between invocations of the remote agent, but only used when the \"debug\" MCA parameter is true, or the top-level MCA debugging is enabled (otherwise this value is ignored)",
false, false, 1,
&mca_pls_submit_component.delay);
mca_base_param_reg_int(c, "assume_same_shell",
"If set to 1, assume that the shell on the remote node is the same as the shell on the local node. Otherwise, probe for what the remote shell.",
false, false, 1, &tmp);
mca_pls_submit_component.assume_same_shell = OPAL_INT_TO_BOOL(tmp);
mca_base_param_reg_string(c, "agent",
"The command used to launch executables on remote nodes (typically either \"ssh\" or \"submit\")",
false, false, "ssh : submit",
&mca_pls_submit_component.agent_param);
return ORTE_SUCCESS;
}
orte_pls_base_module_t *orte_pls_submit_component_init(int *priority)
{
char *bname;
size_t i;
/* if we are not an HNP, then don't select us */
if (!orte_process_info.seed) {
return NULL;
}
/* Take the string that was given to us by the pla_submit_agent MCA
param and search for it */
mca_pls_submit_component.agent_argv =
search(mca_pls_submit_component.agent_param);
mca_pls_submit_component.agent_argc =
opal_argv_count(mca_pls_submit_component.agent_argv);
mca_pls_submit_component.agent_path = NULL;
if (mca_pls_submit_component.agent_argc > 0) {
/* If the agent is ssh, and debug was not selected, then
automatically add "-x" */
bname = opal_basename(mca_pls_submit_component.agent_argv[0]);
if (NULL != bname && 0 == strcmp(bname, "ssh") &&
mca_pls_submit_component.debug == 0) {
for (i = 1; NULL != mca_pls_submit_component.agent_argv[i]; ++i) {
if (0 == strcasecmp("-x",
mca_pls_submit_component.agent_argv[i])) {
break;
}
}
if (NULL == mca_pls_submit_component.agent_argv[i]) {
opal_argv_append(&mca_pls_submit_component.agent_argc,
&mca_pls_submit_component.agent_argv, "-x");
}
}
if (NULL != bname) {
free(bname);
}
}
/* If we didn't find the agent in the path, then don't use this
component */
if (NULL == mca_pls_submit_component.agent_argv ||
NULL == mca_pls_submit_component.agent_argv[0]) {
return NULL;
}
mca_pls_submit_component.agent_path =
opal_path_findv(mca_pls_submit_component.agent_argv[0], X_OK,
environ, NULL);
if (NULL == mca_pls_submit_component.agent_path) {
return NULL;
}
*priority = mca_pls_submit_component.priority;
return &orte_pls_submit_module;
}
int orte_pls_submit_component_close(void)
{
/* cleanup state */
OBJ_DESTRUCT(&mca_pls_submit_component.lock);
OBJ_DESTRUCT(&mca_pls_submit_component.cond);
if (NULL != mca_pls_submit_component.orted) {
free(mca_pls_submit_component.orted);
}
if (NULL != mca_pls_submit_component.agent_param) {
free(mca_pls_submit_component.agent_param);
}
if (NULL != mca_pls_submit_component.agent_argv) {
opal_argv_free(mca_pls_submit_component.agent_argv);
}
if (NULL != mca_pls_submit_component.agent_path) {
free(mca_pls_submit_component.agent_path);
}
return ORTE_SUCCESS;
}
/*
* Take a colon-delimited list of agents and locate the first one that
* we are able to find in the PATH. Split that one into argv and
* return it. If nothing found, then return NULL.
*/
static char **search(const char* agent_list)
{
int i, j;
char *line, **lines = opal_argv_split(agent_list, ':');
char **tokens, *tmp;
char cwd[PATH_MAX];
getcwd(cwd, PATH_MAX);
for (i = 0; NULL != lines[i]; ++i) {
line = lines[i];
/* Trim whitespace at the beginning and end of the line */
for (j = 0; '\0' != line[j] && isspace(line[j]); ++line) {
continue;
}
for (j = strlen(line) - 2; j > 0 && isspace(line[j]); ++j) {
line[j] = '\0';
}
if (strlen(line) <= 0) {
continue;
}
/* Split it */
tokens = opal_argv_split(line, ' ');
/* Look for the first token in the PATH */
tmp = opal_path_findv(tokens[0], X_OK, environ, cwd);
if (NULL != tmp) {
free(tokens[0]);
tokens[0] = tmp;
opal_argv_free(lines);
return tokens;
}
/* Didn't find it */
opal_argv_free(tokens);
}
/* Doh -- didn't find anything */
opal_argv_free(lines);
return NULL;
}

1086
orte/mca/pls/submit/pls_submit_module.c Обычный файл

Разница между файлами не показана из-за своего большого размера Загрузить разницу