Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

update to Julia v1.7 #665

Merged
merged 10 commits into from
Jul 23, 2021
Merged
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LinearMaps = "2.7, 3.0"
LoopVectorization = "0.12.35"
MPI = "0.16, 0.17, 0.18"
OffsetArrays = "1.3"
P4est = "0.2.1"
P4est = "0.2.2"
Polyester = "0.3.4"
RecipesBase = "1.1"
Reexport = "1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

using Downloads: download
using OrdinaryDiffEq
using Trixi

Expand Down
2 changes: 1 addition & 1 deletion examples/tree_2d_dgsem/elixir_ape_monopole.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ callbacks = CallbackSet(summary_callback, analysis_callback, save_solution, step
# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks
sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false),
dt=1.0, # solve needs some value here but it will be overwritten by the stepsize_callback
save_everystep=false, callback=callbacks, maxiters=50)
save_everystep=false, callback=callbacks, maxiters=10^5)

# Print the timer summary
summary_callback()
17 changes: 9 additions & 8 deletions test/test_examples_2d_ape.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@ EXAMPLES_DIR = joinpath(pathof(Trixi) |> dirname |> dirname, "examples", "tree_2

@trixi_testset "elixir_ape_gauss_wall.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_ape_gauss_wall.jl"),
l2 = [0.019419398248465843, 0.019510701017551826, 0.04818246051887614,
7.382060834820337e-17, 0.0, 1.4764121669640674e-16, 1.4764121669640674e-16],
linf = [0.18193631937316496, 0.1877464607867628, 1.0355388011792845,
2.220446049250313e-16, 0.0, 4.440892098500626e-16, 4.440892098500626e-16])
l2 = [0.019419398248465843, 0.019510701017551826, 0.04818246051887614,
7.382060834820337e-17, 0.0, 1.4764121669640674e-16, 1.4764121669640674e-16],
linf = [0.18193631937316496, 0.1877464607867628, 1.0355388011792845,
2.220446049250313e-16, 0.0, 4.440892098500626e-16, 4.440892098500626e-16])
end

@trixi_testset "elixir_ape_monopole.jl" begin
@test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_ape_monopole.jl"),
l2 = [0.006816790293009947, 0.0065068948357351625, 0.008724512056168938,
0.0009894398191644543, 0.0, 7.144325530679576e-17, 7.144325530679576e-17],
linf = [1.000633375007386, 0.5599788929862504, 0.5738432957070382,
0.015590137026938428, 0.0, 2.220446049250313e-16, 2.220446049250313e-16])
l2 = [0.006816790293009947, 0.0065068948357351625, 0.008724512056168938,
0.0009894398191644543, 0.0, 7.144325530679576e-17, 7.144325530679576e-17],
linf = [1.000633375007386, 0.5599788929862504, 0.5738432957070382,
0.015590137026938428, 0.0, 2.220446049250313e-16, 2.220446049250313e-16],
maxiters=50)
end
end

Expand Down
35 changes: 28 additions & 7 deletions test/test_trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,18 @@ macro test_trixi_include(elixir, args...)
Trixi.mpi_isroot() && println("═"^100)
Trixi.mpi_isroot() && println($elixir)

# if `maxiters` is set in tests, it is usually set to a small numer to
# run only a few steps - ignore possible warnings coming from that
if any(==(:maxiters) ∘ first, $kwargs)
additional_ignore_content = [
r"┌ Warning: Interrupted\. Larger maxiters is needed\.\n└ @ SciMLBase .+\n",
r"┌ Warning: Interrupted\. Larger maxiters is needed\.\n└ @ Trixi .+\n"]
else
additional_ignore_content = []
end

# evaluate examples in the scope of the module they're called from
@test_nowarn_mod trixi_include(@__MODULE__, $elixir; $kwargs...)
@test_nowarn_mod trixi_include(@__MODULE__, $elixir; $kwargs...) additional_ignore_content

# if present, compare l2 and linf errors against reference values
if !isnothing($l2) || !isnothing($linf)
Expand Down Expand Up @@ -100,7 +110,7 @@ end

# Modified version of `@test_nowarn` that prints the content of `stderr` when
# it is not empty and ignnores module replacements.
macro test_nowarn_mod(expr)
macro test_nowarn_mod(expr, additional_ignore_content=String[])
quote
let fname = tempname()
try
Expand All @@ -113,14 +123,25 @@ macro test_nowarn_mod(expr)
if !isempty(stderr_content)
println("Content of `stderr`:\n", stderr_content)
end

# Patterns matching the following ones will be ignored. Additional patterns
# passed as arguments can also be regular expressions, so we just use the
# type `Any` for `ignore_content`.
ignore_content = Any[
# TODO: Upstream (PlotUtils). This should be removed again once the
# deprecated stuff is fixed upstream.
"WARNING: importing deprecated binding Colors.RGB1 into PlotUtils.\n",
"WARNING: importing deprecated binding Colors.RGB4 into PlotUtils.\n",
]
append!(ignore_content, additional_ignore_content)
for pattern in ignore_content
stderr_content = replace(stderr_content, pattern => "")
end

# We also ignore simple module redefinitions for convenience. Thus, we
# check whether every line of `stderr_content` is of the form of a
# module replacement warning.
# TODO: Upstream (PlotUtils). This should be removed again once the
# deprecated stuff is fixed upstream.
if stderr_content != "WARNING: importing deprecated binding Colors.RGB1 into PlotUtils.\nWARNING: importing deprecated binding Colors.RGB4 into PlotUtils.\n"
@test occursin(r"^(WARNING: replacing module .+\.\n)*$", stderr_content)
end
@test occursin(r"^(WARNING: replacing module .+\.\n)*$", stderr_content)
ret
finally
rm(fname, force=true)
Expand Down