Skip to content

Commit 4bd4f9f

Browse files
committed
Get the correct directory when using installdirs
Need to use the bindir entry to find the "prterun" executable. Add an output line indicating that execve failed and why. Return non-zero status on exit. Signed-off-by: Ralph Castain <rhc@pmix.org>
1 parent 137cd73 commit 4bd4f9f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ompi/tools/mpirun/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ int main(int argc, char *argv[])
7474
} else {
7575
/* in case --enable-prefix-by-default was given */
7676
mca_base_framework_open(&opal_installdirs_base_framework, 0); // fill in the installdirs
77-
if (NULL != opal_install_dirs.prefix) {
78-
pfx = strdup(opal_install_dirs.prefix);
77+
if (NULL != opal_install_dirs.bindir) {
78+
pfx = strdup(opal_install_dirs.bindir);
7979
}
8080
#endif
8181
}
@@ -93,6 +93,8 @@ int main(int argc, char *argv[])
9393
}
9494

9595
execve(truepath, pargs, environ);
96+
fprintf(stderr, "The mpirun cmd failed to exec its actual executable - your application will NOT execute. Error: %s\n", strerror(errno));
97+
exit(1);
9698
}
9799

98100
/*

0 commit comments

Comments
 (0)