Skip to content

Commit f7f25ca

Browse files
authored
Merge pull request #7 from fverdugo/refactor_mpi_tests
Refactor mpi tests
2 parents b553a03 + 74bfa19 commit f7f25ca

File tree

3 files changed

+23
-30
lines changed

3 files changed

+23
-30
lines changed

test/mpi_array/ksp_test.jl

+23-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
using MPI
2-
include("ksp_test_driver.jl")
3-
include("run_mpi_driver.jl")
4-
file = joinpath(@__DIR__,"ksp_test_driver.jl")
5-
run_mpi_driver(file;procs=3)
2+
using Test
3+
4+
if MPI.MPI_LIBRARY == "OpenMPI" || (isdefined(MPI, :OpenMPI) && MPI.MPI_LIBRARY == MPI.OpenMPI)
5+
mpiexec_cmd = `$(mpiexec()) --oversubscribe`
6+
else
7+
mpiexec_cmd = mpiexec()
8+
end
9+
10+
repodir = normpath(joinpath(@__DIR__,"..",".."))
11+
12+
code = quote
13+
using MPI; MPI.Init()
14+
using PartitionedArrays
15+
include(joinpath($repodir,"test","ksp_test_parallel.jl"))
16+
np = MPI.Comm_size(MPI.COMM_WORLD)
17+
with_mpi(x->ksp_tests(x,np))
18+
end
19+
20+
run(`$mpiexec_cmd -np 3 $(Base.julia_cmd()) --project=$repodir -e $code`)
21+
22+
nothing
23+
24+

test/mpi_array/ksp_test_driver.jl

-11
This file was deleted.

test/mpi_array/run_mpi_driver.jl

-15
This file was deleted.

0 commit comments

Comments
 (0)