Skip to content

Commit 3a0adf5

Browse files
authored
Merge pull request #9136 from awlauria/fix_prefix_master
Fix --prefix option in mpirun.
2 parents b676440 + d56a241 commit 3a0adf5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ompi/tools/mpirun/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int main(int argc, char *argv[])
5050
opal_argv_append_nosize(&pargs, argv[m]);
5151
/* Did the user specify a prefix, or want prefix by default? */
5252
if (0 == strcmp(argv[m], "--prefix")) {
53-
pfx = strdup(argv[m+1]);
53+
asprintf(&pfx, "%s%s", argv[m+1], "/bin");
5454
}
5555
}
5656

@@ -93,7 +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));
96+
fprintf(stderr, "The mpirun (\"%s\") cmd failed to exec its actual executable - your application will NOT execute. Error: %s\n",
97+
truepath ? truepath : "NULL", strerror(errno));
9798
exit(1);
9899
}
99100

0 commit comments

Comments
 (0)