|
1 | 1 | using Test |
| 2 | +using Elemental_jll.MPICH_jll: mpiexec |
| 3 | + |
| 4 | +# Import all of our external dependencies to make sure they're compiled serially. |
| 5 | +using DistributedArrays |
| 6 | +using TSVD |
| 7 | +using Primes |
| 8 | +using MPIClusterManagers |
2 | 9 |
|
3 | 10 | function runtests_mpirun() |
4 | 11 | nprocs = min(4, Sys.CPU_THREADS) |
5 | | - testdir = dirname(@__FILE__) |
6 | 12 | testfiles = ["lav.jl", "lavdense.jl", "matrix.jl", "distmatrix.jl", "props.jl", "generic.jl", "spectral.jl", "tsvd.jl", "svd.jl"] |
7 | 13 | nfail = 0 |
8 | 14 | @info "Running Elemental.jl tests" |
9 | 15 | for f in testfiles |
10 | 16 | try |
11 | | - run(`mpirun -np $nprocs $(Base.julia_cmd()) $(joinpath(testdir, f))`) |
| 17 | + mpiexec() do exec |
| 18 | + run(`$exec -np $nprocs $(Base.julia_cmd()) $(joinpath(@__DIR__, f))`) |
| 19 | + end |
12 | 20 | Base.with_output_color(:green,stdout) do io |
13 | 21 | println(io,"\tSUCCESS: $f") |
14 | 22 | end |
|
26 | 34 | function runtests_repl() |
27 | 35 | nprocs = min(4, Sys.CPU_THREADS) |
28 | 36 | exename = joinpath(Sys.BINDIR, Base.julia_exename()) |
29 | | - testdir = dirname(@__FILE__) |
30 | 37 | testfiles = ["darray.jl"] |
31 | 38 | nfail = 0 |
32 | 39 | @info "Running Elemental.jl tests" |
33 | 40 | for f in testfiles |
34 | 41 | try |
35 | 42 | # FixMe! We temporarily run Finalize() explictly on the workers because the atexit hook |
36 | 43 | # doesn't seem to be correctly triggered on workers as of 31 October 2018. |
37 | | - cmdstr = "using Distributed, MPI, MPIClusterManagers; man = MPIManager(np = $nprocs); addprocs(man); include(\"$(joinpath(testdir, f))\"); asyncmap(p -> remotecall_fetch(() -> Elemental.Finalize(), p), workers())" |
| 44 | + cmdstr = "using Distributed, MPIClusterManagers; man = MPIManager(np = $nprocs); addprocs(man); include(\"$(joinpath(@__DIR__, f))\"); asyncmap(p -> remotecall_fetch(() -> Elemental.Finalize(), p), workers())" |
38 | 45 | run(`$exename -e $cmdstr`) |
39 | 46 | Base.with_output_color(:green,stdout) do io |
40 | 47 | println(io,"\tSUCCESS: $f") |
|
0 commit comments