diff --git a/src/callbacks/callbacks.jl b/src/callbacks/callbacks.jl index 56402f8f1b2..a7be0729f7c 100644 --- a/src/callbacks/callbacks.jl +++ b/src/callbacks/callbacks.jl @@ -10,6 +10,7 @@ import SciMLBase import .Parameters as CAP import DiffEqCallbacks as DECB import ClimaCore: InputOutput +import Base.Sys: maxrss using Dates using Insolation: instantaneous_zenith_angle import ClimaCore.Fields: ColumnField @@ -502,6 +503,14 @@ function print_walltime_estimate(integrator) wall_time_spent percent_complete = "$percent_complete%" sypd = sypd date_now = Dates.now() estimated_finish_date = estimated_finish_date + maxrss_bytes = maxrss() + maxrss_str = + maxrss_bytes > 2^30 ? + "$(round(maxrss_bytes / 2^30, digits = 2)) GiB" : + "$(round(maxrss_bytes / 2^20, digits = 2)) MiB" + + @info "Memory used by process (RSS): $maxrss_str" + # the first fixed increment is equivalent to # doubling (which puts us at 10%), so we check # if we're below 5%.