Skip to content

Commit

Permalink
fix exit code and print $args received by ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermebodin committed Mar 21, 2024
1 parent 6a627ea commit ce902a7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions bin/mpiexecjl_windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ function usage {
$julia_args = @()
$PROJECT_ARG = ""

echo $args

foreach ($arg in $args) {
if ($arg -match "^--project(=.*)?$") {
$PROJECT_ARG = $arg
Expand Down Expand Up @@ -55,7 +57,11 @@ if ($env:JULIA_BINDIR) {
$SCRIPT = @'
using MPI
ENV[\"JULIA_PROJECT\"] = dirname(Base.active_project())
mpiexec(exe -> run(`$exe $ARGS`))
try
mpiexec(exe -> run(`$exe $ARGS`))
catch e
rethrow(e)
end
'@

$PRECOMPILATION_SCRIPT = @'
Expand All @@ -74,4 +80,7 @@ if ($PROJECT_ARG) {
& $JULIA_CMD $PROJECT_ARG --color=yes --startup-file=no --compile=min -O0 -e $SCRIPT -- $julia_args
} else {
& $JULIA_CMD --color=yes --startup-file=no --compile=min -O0 -e $SCRIPT -- $julia_args
}
}

# Guarantees that we will exit .ps1 with the same process status as the last command executed
exit $lastExitCode
2 changes: 1 addition & 1 deletion test/mpiexecjl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ using MPI
example = joinpath(@__DIR__, "..", "docs", "examples", "01-hello.jl")
env = ["JULIA_BINDIR" => Sys.BINDIR]
p = withenv(env...) do
run(`$(additional_initial_parts_cmd) $(mpiexecjl) -n $(nprocs) --project=$(dir) $(julia) --startup-file=no -q $(example)`)
run(`$(additional_initial_parts_cmd) $(mpiexecjl) -n $(nprocs) --project=$(dir) $(julia) $(example)`)
end
@test success(p)
# Test help messages
Expand Down

0 comments on commit ce902a7

Please sign in to comment.