Add a '!' option to the xterm iof option to invoke the -hold feature of xterm.
Correct the orte-show-help file when a rank is out of bounds, and do that test where a wildcard doesn't get incorrectly flagged as out-of-bounds. This commit was SVN r20398.
Этот коммит содержится в:
родитель
0597fdd778
Коммит
9d381a4ebf
@ -31,14 +31,6 @@ Fileset: %s
|
||||
|
||||
Will continue attempting to launch the process.
|
||||
|
||||
#
|
||||
[orte-odls-base:xterm-neg-rank]
|
||||
The xterm option was given a negative rank to display:
|
||||
|
||||
Rank: %d
|
||||
|
||||
Note that a value of -1 represents "all", but all other values
|
||||
must range from 0 to #procs-1.
|
||||
#
|
||||
[orte-odls-base:xterm-rank-out-of-bounds]
|
||||
The xterm option was asked to display a rank that is larger
|
||||
|
@ -1158,15 +1158,6 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
|
||||
nmitem != opal_list_get_end(&orte_odls_globals.xterm_ranks);
|
||||
nmitem = opal_list_get_next(nmitem)) {
|
||||
nm = (orte_namelist_t*)nmitem;
|
||||
/* check for bozo case */
|
||||
if (jobdat->num_procs <= nm->name.vpid) {
|
||||
/* can't be done! */
|
||||
orte_show_help("help-odls-base.txt",
|
||||
"orte-odls-base:xterm-rank-out-of-bounds",
|
||||
true, nm->name.vpid, jobdat->num_procs);
|
||||
rc = ORTE_ERR_VALUE_OUT_OF_BOUNDS;
|
||||
goto CLEANUP;
|
||||
}
|
||||
if (ORTE_VPID_WILDCARD == nm->name.vpid ||
|
||||
child->name->vpid == nm->name.vpid) {
|
||||
/* we want this one - modify the app's command to include
|
||||
@ -1195,7 +1186,15 @@ int orte_odls_base_default_launch_local(orte_jobid_t job,
|
||||
free(app->app);
|
||||
app->app = strdup(orte_odls_globals.xtermcmd[0]);
|
||||
break;
|
||||
} else if (jobdat->num_procs <= nm->name.vpid) { /* check for bozo case */
|
||||
/* can't be done! */
|
||||
orte_show_help("help-orte-odls-base.txt",
|
||||
"orte-odls-base:xterm-rank-out-of-bounds",
|
||||
true, nm->name.vpid, jobdat->num_procs);
|
||||
rc = ORTE_ERR_VALUE_OUT_OF_BOUNDS;
|
||||
goto CLEANUP;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -160,6 +160,7 @@ int orte_odls_base_open(void)
|
||||
char **ranks=NULL, *tmp;
|
||||
int i, rank;
|
||||
orte_namelist_t *nm;
|
||||
bool xterm_hold;
|
||||
|
||||
/* Debugging / verbose output. Always have stream open, with
|
||||
verbose set by the mca open system... */
|
||||
@ -181,8 +182,13 @@ int orte_odls_base_open(void)
|
||||
/* check if the user requested that we display output in xterms */
|
||||
if (NULL != orte_xterm) {
|
||||
/* construct a list of ranks to be displayed */
|
||||
xterm_hold = false;
|
||||
orte_util_parse_range_options(orte_xterm, &ranks);
|
||||
for (i=0; i < opal_argv_count(ranks); i++) {
|
||||
if (0 == strcmp(ranks[i], "BANG")) {
|
||||
xterm_hold = true;
|
||||
continue;
|
||||
}
|
||||
nm = OBJ_NEW(orte_namelist_t);
|
||||
rank = strtol(ranks[i], NULL, 10);
|
||||
if (-1 == rank) {
|
||||
@ -214,6 +220,9 @@ int orte_odls_base_open(void)
|
||||
free(tmp);
|
||||
opal_argv_append_nosize(&orte_odls_globals.xtermcmd, "-T");
|
||||
opal_argv_append_nosize(&orte_odls_globals.xtermcmd, "save");
|
||||
if (xterm_hold) {
|
||||
opal_argv_append_nosize(&orte_odls_globals.xtermcmd, "-hold");
|
||||
}
|
||||
opal_argv_append_nosize(&orte_odls_globals.xtermcmd, "-e");
|
||||
}
|
||||
|
||||
|
@ -35,12 +35,23 @@
|
||||
|
||||
#include "orte/util/parse_options.h"
|
||||
|
||||
void orte_util_parse_range_options(char *input, char ***output)
|
||||
void orte_util_parse_range_options(char *inp, char ***output)
|
||||
{
|
||||
char **r1=NULL, **r2=NULL;
|
||||
int i, vint;
|
||||
int start, end, n;
|
||||
char nstr[32];
|
||||
char *input, *bang;
|
||||
bool bang_option=false;
|
||||
|
||||
/* protect the provided input */
|
||||
input = strdup(inp);
|
||||
|
||||
/* check for the special '!' operator */
|
||||
if (NULL != (bang = strchr(input, '!'))) {
|
||||
bang_option = true;
|
||||
*bang = '\0';
|
||||
}
|
||||
|
||||
/* split on commas */
|
||||
r1 = opal_argv_split(input, ',');
|
||||
@ -58,6 +69,7 @@ void orte_util_parse_range_options(char *input, char ***output)
|
||||
vint = strtol(r1[i], NULL, 10);
|
||||
if (-1 == vint) {
|
||||
opal_argv_free(*output);
|
||||
*output = NULL;
|
||||
opal_argv_append_nosize(output, "-1");
|
||||
goto cleanup;
|
||||
}
|
||||
@ -71,6 +83,10 @@ void orte_util_parse_range_options(char *input, char ***output)
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (bang_option) {
|
||||
opal_argv_append_nosize(output, "BANG");
|
||||
}
|
||||
free(input);
|
||||
opal_argv_free(r1);
|
||||
opal_argv_free(r2);
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user