File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 61
61
SCRIPT='
62
62
using MPI
63
63
ENV["JULIA_PROJECT"] = dirname(Base.active_project())
64
- mpiexec(exe -> run(`$exe $ARGS`))
64
+ proc = run(pipeline(`$(mpiexec()) $(ARGS)`; stdout, stderr); wait=false)
65
+ wait(proc)
66
+ if !iszero(proc.exitcode)
67
+ @error "The MPI process failed" proc
68
+ end
69
+ exit(proc.exitcode)
65
70
'
66
71
67
72
if [ -n " ${PROJECT_ARG} " ]; then
Original file line number Diff line number Diff line change @@ -34,5 +34,10 @@ using MPI
34
34
# Without arguments, or only with the `--project` option, the wrapper will fail
35
35
@test ! withenv (() -> success (` $(mpiexecjl) --project=$(dir) ` ), env... )
36
36
@test ! withenv (() -> success (` $(mpiexecjl) ` ), env... )
37
+ # Test that the wrapper exits with the same exit code as the MPI process
38
+ exit_code = 10
39
+ p = run (` $(mpiexecjl) -n $(nprocs) --project=$(dir) $(julia) --startup-file=no -e "exit($(exit_code) )"` ; wait= false )
40
+ wait (p)
41
+ @test p. exitcode == exit_code
37
42
end
38
43
end
You can’t perform that action at this time.
0 commit comments