Skip to content

Commit 25e0db6

Browse files
authored
Merge pull request #9116 from rhc54/topic/exec
Get the correct directory when using installdirs
2 parents 137cd73 + 4bd4f9f commit 25e0db6

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)