Skip to content

Commit

Permalink
Skip threads tests which are known to fail (#791)
Browse files Browse the repository at this point in the history
* Skip threads tests with legacy Intel MPI which are known to fail

* Skip threads tests also on Windows
  • Loading branch information
giordano authored Nov 3, 2023
1 parent 2f51fc4 commit b77ce20
Showing 1 changed file with 34 additions and 29 deletions.
63 changes: 34 additions & 29 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,39 +73,44 @@ istest(f) = endswith(f, ".jl") && startswith(f, "test_") && !in(f, excludefiles)
testfiles = sort(filter(istest, readdir(testdir)))

@testset "$f" for f in testfiles
mpiexec() do mpirun
cmd(n=nprocs) = `$mpirun -n $n $(Base.julia_cmd()) --startup-file=no $(joinpath(testdir, f))`
if f == "test_spawn.jl"
# Some command as the others, but always use a single process
run(cmd(1))
elseif f == "test_threads.jl"
cmd(n=nprocs) = `$(mpiexec()) -n $n $(Base.julia_cmd()) --startup-file=no $(joinpath(testdir, f))`
if f == "test_spawn.jl"
# Some command as the others, but always use a single process
run(cmd(1))
elseif f == "test_threads.jl"
# Legacy Intel MPI (before 2020) crashes threads tests:
# <https://github.com/JuliaParallel/MPI.jl/issues/725>. These tests fail also on
# 32-bit Windows: <https://github.com/JuliaParallel/MPI.jl/issues/711>.
if (MPI.MPI_LIBRARY == "IntelMPI" && MPI.MPI_LIBRARY_VERSION < v"2020") || (Sys.iswindows() && Sys.WORD_SIZE == 32)
@test_broken false
else
withenv("JULIA_NUM_THREADS" => "4") do
run(cmd())
end
elseif f == "test_error.jl"
r = run(ignorestatus(cmd()))
@test !success(r)
elseif f == "test_errorhandler.jl" && MPI.MPI_LIBRARY in ("unknown", "FujitsuMPI")
# Fujitsu MPI is known to not work with custom error handlers. Also
# unknown implementations may fail for the same reason.
try
run(cmd())
catch e
@error """
$(f) tests failed. This may due to the fact this implementation of MPI doesn't support custom error handlers.
See the full error message for more details. Some messages may have been written above.
""" exception=(e, catch_backtrace())
@test_broken false
end
else
# MPI_Reduce with MPICH 3.4.2 on macOS when root != 0 and
# when recvbuf == C_NULL segfaults
# <https://github.com/pmodels/mpich/issues/5700>
if get(ENV, "JULIA_MPI_TEST_DISABLE_REDUCE_ON_APPLE", "") != "" && Sys.isapple() && f == "test_reduce.jl"
return
end
end
elseif f == "test_error.jl"
r = run(ignorestatus(cmd()))
@test !success(r)
elseif f == "test_errorhandler.jl" && MPI.MPI_LIBRARY in ("unknown", "FujitsuMPI")
# Fujitsu MPI is known to not work with custom error handlers. Also
# unknown implementations may fail for the same reason.
try
run(cmd())
catch e
@error """
$(f) tests failed. This may due to the fact this implementation of MPI doesn't support custom error handlers.
See the full error message for more details. Some messages may have been written above.
""" exception=(e, catch_backtrace())
@test_broken false
end
else
# MPI_Reduce with MPICH 3.4.2 on macOS when root != 0 and
# when recvbuf == C_NULL segfaults
# <https://github.com/pmodels/mpich/issues/5700>
if get(ENV, "JULIA_MPI_TEST_DISABLE_REDUCE_ON_APPLE", "") != "" && Sys.isapple() && f == "test_reduce.jl"
return
end
@test true
run(cmd())
end
@test true
end

0 comments on commit b77ce20

Please sign in to comment.