@@ -36,24 +36,38 @@ istest(f) = endswith(f, ".jl") && startswith(f, "test_")
36
36
testfiles = sort (filter (istest, readdir (testdir)))
37
37
38
38
@testset " $f " for f in testfiles
39
- mpiexec () do cmd
39
+ mpiexec () do mpirun
40
+ cmd (n= nprocs) = ` $mpirun -n $n $(Base. julia_cmd ()) $(joinpath (testdir, f)) `
40
41
if f == " test_spawn.jl"
41
- run (` $cmd -n 1 $(Base. julia_cmd ()) $(joinpath (testdir, f)) ` )
42
+ # Some command as the others, but always use a single process
43
+ run (cmd (1 ))
42
44
elseif f == " test_threads.jl"
43
45
withenv (" JULIA_NUM_THREADS" => " 4" ) do
44
- run (` $ cmd -n $nprocs $(Base . julia_cmd ()) $( joinpath (testdir, f)) ` )
46
+ run (cmd () )
45
47
end
46
48
elseif f == " test_error.jl"
47
- r = run (ignorestatus (` $ cmd -n $nprocs $(Base . julia_cmd ()) $( joinpath (testdir, f)) ` ))
49
+ r = run (ignorestatus (cmd () ))
48
50
@test ! success (r)
51
+ elseif f == " test_errorhandler.jl" && (MPI. identify_implementation ()[1 ] == MPI. UnknownMPI ||
52
+ # Fujitsu MPI is known to not work with custom error handlers
53
+ startswith (MPI. MPI_LIBRARY_VERSION_STRING, " FUJITSU MPI" ))
54
+ try
55
+ run (cmd ())
56
+ catch e
57
+ @error """
58
+ $(f) tests failed. This may due to the fact this implementation of MPI doesn't support custom error handlers.
59
+ See the full error message for more details. Some messages may have been written above.
60
+ """ exception= (e, catch_backtrace ())
61
+ @test_broken false
62
+ end
49
63
else
50
64
# MPI_Reduce with MPICH 3.4.2 on macOS when root != 0 and
51
65
# when recvbuf == C_NULL segfaults
52
66
# <https://github.com/pmodels/mpich/issues/5700>
53
67
if get (ENV , " JULIA_MPI_TEST_DISABLE_REDUCE_ON_APPLE" , " " ) != " " && Sys. isapple () && f == " test_reduce.jl"
54
68
return
55
69
end
56
- run (` $ cmd -n $nprocs $(Base . julia_cmd ()) $( joinpath (testdir, f)) ` )
70
+ run (cmd () )
57
71
end
58
72
@test true
59
73
end
0 commit comments