Skip to content

Commit 539f71d

Browse files
author
Ralph Castain
authored
Merge pull request #3310 from marksantcroos/fix/alps_wdir
Bring ALPS ODLS up to par regarding wdir.
2 parents dadc924 + 27fa8aa commit 539f71d

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

orte/mca/odls/alps/odls_alps_module.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Copyright (c) 2011-2014 Los Alamos National Security, LLC. All rights
1717
* reserved.
1818
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
19+
* Copyright (c) 2017 Rutgers, The State University of New Jersey.
20+
* All rights reserved.
1921
*
2022
* $COPYRIGHT$
2123
*
@@ -423,6 +425,20 @@ static int do_child(orte_odls_spawn_caddy_t *cd, int write_fd)
423425
sigprocmask(0, 0, &sigs);
424426
sigprocmask(SIG_UNBLOCK, &sigs, 0);
425427

428+
/* take us to the correct wdir */
429+
if (NULL != cd->wdir) {
430+
if (0 != chdir(cd->wdir)) {
431+
send_error_show_help(write_fd, 1,
432+
"help-orterun.txt",
433+
"orterun:wdir-not-found",
434+
"orted",
435+
cd->wdir,
436+
orte_process_info.nodename,
437+
cd->child->app_rank);
438+
/* Does not return */
439+
}
440+
}
441+
426442
/* Exec the new executable */
427443

428444
if (10 < opal_output_get_verbosity(orte_odls_base_framework.framework_output)) {

orte/mca/odls/default/odls_default_module.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
* Copyright (c) 2011-2013 Los Alamos National Security, LLC. All rights
1717
* reserved.
1818
* Copyright (c) 2013-2017 Intel, Inc. All rights reserved.
19+
* Copyright (c) 2017 Rutgers, The State University of New Jersey.
20+
* All rights reserved.
1921
*
2022
* $COPYRIGHT$
2123
*
@@ -416,7 +418,16 @@ static int do_child(orte_odls_spawn_caddy_t *cd, int write_fd)
416418

417419
/* take us to the correct wdir */
418420
if (NULL != cd->wdir) {
419-
chdir(cd->wdir);
421+
if (0 != chdir(cd->wdir)) {
422+
send_error_show_help(write_fd, 1,
423+
"help-orterun.txt",
424+
"orterun:wdir-not-found",
425+
"orted",
426+
cd->wdir,
427+
orte_process_info.nodename,
428+
cd->child->app_rank);
429+
/* Does not return */
430+
}
420431
}
421432

422433
/* Exec the new executable */

0 commit comments

Comments
 (0)