Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix NaNs check, add more debug info #338

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.6"
manifest_format = "2.0"
project_hash = "8c1158513d32dc08d4dad3376a95c8915662a919"
project_hash = "fc780a0dc833e209a503e8cdbd13bf068bf6b381"

[[deps.ADTypes]]
git-tree-sha1 = "eea5d80188827b35333801ef97a40c2ed653b081"
Expand Down
1 change: 1 addition & 0 deletions .buildkite/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Krylov = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LinearOperators = "5c8ed15e-5a4c-59e4-a42b-c7e8811fb125"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195"
ODEConvergenceTester = "42a5c2e1-f365-4540-8ca5-3684de3ecd95"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Expand Down
4 changes: 3 additions & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,9 @@ steps:

- label: "Summarize convergence"
command: "julia --color=yes --check-bounds=yes --project=.buildkite docs/src/dev/summarize_convergence.jl"
artifact_paths: "output/*"
artifact_paths:
- "output/*"
- "output/convergence_failure/*"
depends_on: alg_convergence

- label: "Summarize limiter analysis"
Expand Down
21 changes: 18 additions & 3 deletions docs/src/dev/compute_convergence.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function predicted_convergence_order(algorithm_name::AbstractAlgorithmName, ode_
return 0
end

import Logging
function export_convergence_results(alg_name, test_problem, num_steps; kwargs...)
out_dict = Dict()
(; test_name) = test_problem
Expand All @@ -118,7 +119,9 @@ function export_convergence_results(alg_name, test_problem, num_steps; kwargs...
out_dict[string(test_name)]["args"] = (alg_name, test_problem, num_steps)
out_dict[string(test_name)]["kwargs"] = kwargs
compute_convergence!(out_dict, alg_name, test_problem, num_steps; kwargs...)
JLD2.save_object("convergence_$(alg_name)_$(test_problem.test_name).jld2", out_dict)
Logging.with_logger(Logging.NullLogger()) do # suppress warnings about anonymous functions
JLD2.save_object("convergence_$(alg_name)_$(test_problem.test_name).jld2", out_dict)
end
end


Expand Down Expand Up @@ -169,7 +172,9 @@ function compute_convergence!(
float_str(x) = @sprintf "%.4f" x
pow_str(x) = "10^{$(@sprintf "%.1f" log10(x))}"
function si_str(x)
x in (0, Inf, -Inf, NaN) && return string(x)
if isnan(x) || x in (0, Inf, -Inf)
return string(x)
end
exponent = floor(Int, log10(x))
mantissa = x / 10.0^exponent
return "$(float_str(mantissa)) \\times 10^{$exponent}"
Expand Down Expand Up @@ -266,7 +271,17 @@ function compute_convergence!(
callback = scb_cur_avg_sol_and_err,
)
if any(isnan, plot2_values)
error("NaN found in plot2_values in problem $(test_name)")
@show default_dt
@show count(isnan, plot2_values.u[end])
@show length(plot2_values.u[end])
@show count(isnan, plot2_values.u[1])
@show length(plot2_values.u[1])
out_path = joinpath("output", "convergence_failure")
mkpath(out_path)
fname(i) = "$(key1)_$(key2)_step_$(i).png"
for (i, u) in enumerate(plot2_values.u)
Plots.png(Plots.plot(u.u), joinpath(out_path, fname(i)))
end
end
out_dict[key1][key2]["plot2_values"] = plot2_values

Expand Down
Loading