Skip to content

Commit f3b2c21

Browse files
authored
writing MPI tests (#620)
1 parent a851bfd commit f3b2c21

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/src/usage.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,23 @@ should confirm your MPI implementation to have the ROCm support (AMDGPU) enabled
8888
your ROCm-aware MPI implementation to use multiple AMD GPUs (one GPU per rank).
8989

9090
The status of ROCm (AMDGPU) support cannot currently be queried.
91+
92+
## Writing MPI tests
93+
94+
It is recommended to use the `mpiexec()` wrapper when writing your package tests in `runtests.jl`:
95+
96+
```julia
97+
# test/runtests.jl
98+
using MPI
99+
using Test
100+
101+
@testset "hello" begin
102+
n = 2 # number of processes
103+
mpiexec() do exe # MPI wrapper
104+
run(`$exe -n $n $(Base.julia_cmd()) [...]/01-hello.jl`)
105+
# alternatively:
106+
# p = run(ignorestatus(`...`))
107+
# @test success(p)
108+
end
109+
end
110+
```

0 commit comments

Comments
 (0)