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 6161SCRIPT='
6262using MPI
6363ENV["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)
6570'
6671
6772if [ -n " ${PROJECT_ARG} " ]; then
Original file line number Diff line number Diff line change @@ -34,5 +34,10 @@ using MPI
3434 # Without arguments, or only with the `--project` option, the wrapper will fail
3535 @test ! withenv (() -> success (` $(mpiexecjl) --project=$(dir) ` ), env... )
3636 @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
3742 end
3843end
You can’t perform that action at this time.
0 commit comments