module TestExamplesMPI
using Test
using Trixi
include("test_trixi.jl")
outdir = "out"
Trixi.mpi_isroot() && isdir(outdir) && rm(outdir, recursive = true)
Trixi.MPI.Barrier(Trixi.mpi_comm())
CI_ON_WINDOWS = (get(ENV, "GITHUB_ACTIONS", false) == "true") && Sys.iswindows()
@testset "MPI" begin
include("test_mpi_tree.jl")
include("test_mpi_p4est_2d.jl")
include("test_mpi_t8code_2d.jl")
if !CI_ON_WINDOWS
include("test_mpi_p4est_3d.jl")
include("test_mpi_t8code_3d.jl")
end
end
@trixi_testset "MPI supporting functionality" begin
using Trixi: Trixi, ode_norm, SVector
t = 0.5
let u = 1.0
@test ode_norm(u, t) ≈ Trixi.DiffEqBase.ODE_DEFAULT_NORM(u, t)
end
let u = [1.0, -2.0]
@test ode_norm(u, t) ≈ Trixi.DiffEqBase.ODE_DEFAULT_NORM(u, t)
end
let u = [SVector(1.0, -2.0), SVector(0.5, -0.1)]
@test ode_norm(u, t) ≈ Trixi.DiffEqBase.ODE_DEFAULT_NORM(u, t)
end
end
Trixi.mpi_isroot() && @test_nowarn rm(outdir, recursive = true)
Trixi.MPI.Barrier(Trixi.mpi_comm())
end