From 6e60fef5b4ffe77d4358c11d4d67661c46d904d5 Mon Sep 17 00:00:00 2001 From: Gabriele Bozzola Date: Mon, 18 Dec 2023 13:22:32 -0800 Subject: [PATCH] Save final state when simulation crashes --- src/solver/solve.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/solver/solve.jl b/src/solver/solve.jl index 829660629ab..0fe1fcea18a 100644 --- a/src/solver/solve.jl +++ b/src/solver/solve.jl @@ -67,6 +67,8 @@ function solve_atmos!(simulation) return AtmosSolveResults(sol, :success, walltime) end catch ret_code + CA.save_restart_func(integrator, simulation.output_dir) + CA.save_to_disk_func(integrator, simulation.output_dir) @error "ClimaAtmos simulation crashed. Stacktrace for failed simulation" exception = (ret_code, catch_backtrace()) return AtmosSolveResults(nothing, :simulation_crashed, nothing)