Skip to content

Commit ce902a7

Browse files
fix exit code and print $args received by ps1
1 parent 6a627ea commit ce902a7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

bin/mpiexecjl_windows.ps1

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ function usage {
2424
$julia_args = @()
2525
$PROJECT_ARG = ""
2626

27+
echo $args
28+
2729
foreach ($arg in $args) {
2830
if ($arg -match "^--project(=.*)?$") {
2931
$PROJECT_ARG = $arg
@@ -55,7 +57,11 @@ if ($env:JULIA_BINDIR) {
5557
$SCRIPT = @'
5658
using MPI
5759
ENV[\"JULIA_PROJECT\"] = dirname(Base.active_project())
58-
mpiexec(exe -> run(`$exe $ARGS`))
60+
try
61+
mpiexec(exe -> run(`$exe $ARGS`))
62+
catch e
63+
rethrow(e)
64+
end
5965
'@
6066

6167
$PRECOMPILATION_SCRIPT = @'
@@ -74,4 +80,7 @@ if ($PROJECT_ARG) {
7480
& $JULIA_CMD $PROJECT_ARG --color=yes --startup-file=no --compile=min -O0 -e $SCRIPT -- $julia_args
7581
} else {
7682
& $JULIA_CMD --color=yes --startup-file=no --compile=min -O0 -e $SCRIPT -- $julia_args
77-
}
83+
}
84+
85+
# Guarantees that we will exit .ps1 with the same process status as the last command executed
86+
exit $lastExitCode

test/mpiexecjl.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ using MPI
3434
example = joinpath(@__DIR__, "..", "docs", "examples", "01-hello.jl")
3535
env = ["JULIA_BINDIR" => Sys.BINDIR]
3636
p = withenv(env...) do
37-
run(`$(additional_initial_parts_cmd) $(mpiexecjl) -n $(nprocs) --project=$(dir) $(julia) --startup-file=no -q $(example)`)
37+
run(`$(additional_initial_parts_cmd) $(mpiexecjl) -n $(nprocs) --project=$(dir) $(julia) $(example)`)
3838
end
3939
@test success(p)
4040
# Test help messages

0 commit comments

Comments
 (0)