Skip to content

Commit d9bc607

Browse files
authored
Merge pull request #12093 from jsquyres/pr/v4.1.x/allow-prefix-of-a-single-slash
v4.1.x: ORTE: a prefix of "/" is ok
2 parents 3a1cd5f + f961d45 commit d9bc607

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

orte/mca/plm/rsh/plm_rsh_module.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* Copyright (c) 2014-2020 Intel, Inc. All rights reserved.
1818
* Copyright (c) 2015-2018 Research Organization for Information Science
1919
* and Technology (RIST). All rights reserved.
20+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
2021
* $COPYRIGHT$
2122
*
2223
* Additional copyrights may follow
@@ -475,7 +476,12 @@ static int setup_launch(int *argcptr, char ***argvptr,
475476
*/
476477

477478
value = opal_basename(opal_install_dirs.bindir);
478-
asprintf(&bin_base, "%s/%s", prefix_dir, value);
479+
/* Ensure that we don't have a prefix that ends in "/" */
480+
if ('/' == prefix_dir[strlen(prefix_dir) - 1]) {
481+
asprintf(&bin_base, "%s%s", prefix_dir, value);
482+
} else {
483+
asprintf(&bin_base, "%s/%s", prefix_dir, value);
484+
}
479485
free(value);
480486

481487
if (NULL != orted_cmd) {

orte/orted/orted_submit.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* Copyright (c) 2015-2018 Research Organization for Information Science
1919
* and Technology (RIST). All rights reserved.
2020
* Copyright (c) 2017-2021 IBM Corporation. All rights reserved.
21+
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
2122
* $COPYRIGHT$
2223
*
2324
* Additional copyrights may follow
@@ -487,10 +488,13 @@ int orte_submit_init(int argc, char *argv[],
487488
param[param_len-1] = '\0';
488489
param_len--;
489490
if (0 == param_len) {
490-
orte_show_help("help-orterun.txt", "orterun:empty-prefix",
491-
true, orte_basename, orte_basename);
492-
free(param);
493-
return ORTE_ERR_FATAL;
491+
/* We get here if we removed all PATH_SEP's
492+
and end up with an empty string. In this
493+
case, the prefix is just a single
494+
PATH_SEP. */
495+
param[0] = '\\';
496+
param[1] = '\0';
497+
break;
494498
}
495499
}
496500

@@ -1583,10 +1587,13 @@ static int create_app(int argc, char* argv[],
15831587
param[param_len-1] = '\0';
15841588
param_len--;
15851589
if (0 == param_len) {
1586-
orte_show_help("help-orterun.txt", "orterun:empty-prefix",
1587-
true, orte_basename, orte_basename);
1588-
free(param);
1589-
return ORTE_ERR_FATAL;
1590+
/* We get here if we removed all PATH_SEP's
1591+
and end up with an empty string. In this
1592+
case, the prefix is just a single
1593+
PATH_SEP. */
1594+
param[0] = '\\';
1595+
param[1] = '\0';
1596+
break;
15901597
}
15911598
}
15921599
orte_set_attribute(&app->attributes, ORTE_APP_PREFIX_DIR, ORTE_ATTR_GLOBAL, param, OPAL_STRING);

orte/tools/orterun/help-orterun.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# Copyright (c) 2007-2016 Cisco Systems, Inc. All rights reserved.
1414
# Copyright (c) 2012 Oak Ridge National Labs. All rights reserved.
1515
# Copyright (c) 2017 Intel, Inc. All rights reserved.
16+
# Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
1617
# $COPYRIGHT$
1718
#
1819
# Additional copyrights may follow
@@ -174,11 +175,6 @@ Only one should be specified to avoid potential version
174175
confusion. Operation will continue, but the application's prefix
175176
option will be ignored.
176177
#
177-
[orterun:empty-prefix]
178-
A prefix was supplied to %s that only contained slashes.
179-
180-
This is a fatal error; %s will now abort. No processes were launched.
181-
#
182178
[debugger-mca-param-not-found]
183179
Internal error -- the orte_base_user_debugger MCA parameter was not able to
184180
be found. Please contact the Open RTE developers; this should not

0 commit comments

Comments
 (0)