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

Rm code dup, rm some prints, tabulate scaling #2892

Merged
merged 2 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
51 changes: 43 additions & 8 deletions post_processing/plot_gpu_scaling_utils.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
using JLD2
function get_jld2data(output_dir, job_id, s)
import PrettyTables as PT

function get_jld2data(output_dir, job_id, t_int_days, s)
secs_per_day = 60 * 60 * 24
secs_per_hour = 60 * 60
days_per_year = 8760 / 24
FT = Float64
nprocs_clima_atmos = Int[]
ncols_per_process = Int[]
Expand All @@ -22,16 +27,46 @@ function get_jld2data(output_dir, job_id, s)
push!(nprocs_clima_atmos, Int(dict["nprocs"]))
push!(ncols_per_process, Int(dict["ncols_per_process"]))
push!(walltime_clima_atmos, FT(dict["walltime"]))
else
@show occursin(job_id, foldername)
@show occursin(s, foldername)
found = true
end
end
if !found
@show readdir(output_dir)
for foldername in readdir(output_dir)
@show occursin(job_id, foldername)
@show occursin(s, foldername)
end
end
@show nprocs_clima_atmos
@show ncols_per_process
@show walltime_clima_atmos
return (; nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos)
order = sortperm(nprocs_clima_atmos)
nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos =
nprocs_clima_atmos[order],
ncols_per_process[order],
walltime_clima_atmos[order]

# simulated years per day
sypd_clima_atmos =
(secs_per_day ./ walltime_clima_atmos) * t_int_days ./ days_per_year

# GPU hours
gpu_hours_clima_atmos =
nprocs_clima_atmos .* walltime_clima_atmos / secs_per_hour

data = hcat(
nprocs_clima_atmos,
ncols_per_process,
walltime_clima_atmos,
sypd_clima_atmos,
)
PT.pretty_table(
data;
header = ["N procs", "Ncols per process", "walltime (seconds)", "SYPD"],
alignment = :l,
)
return (;
nprocs_clima_atmos,
ncols_per_process,
walltime_clima_atmos,
sypd_clima_atmos,
gpu_hours_clima_atmos,
)
end
25 changes: 7 additions & 18 deletions post_processing/plot_gpu_strong_scaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ include("plot_gpu_scaling_utils.jl")
job_id = "gpu_aquaplanet_dyamond_ss"
output_dir = "./"

secs_per_hour = 60 * 60
secs_per_day = 60 * 60 * 24
days_per_year = 8760 / 24

t_int_days = 12 / 24 # simulation integration time in days
h_elem = 30
z_elem = 63
Expand All @@ -18,21 +14,14 @@ nlevels = z_elem + 1
t_int = string(t_int_days) * " days"

# read ClimaAtmos scaling data
(; nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos) =
get_jld2data(output_dir, job_id, "_ss_")

order = sortperm(nprocs_clima_atmos)
nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos =
nprocs_clima_atmos[order],
ncols_per_process[order],
walltime_clima_atmos[order]
(;
nprocs_clima_atmos,
ncols_per_process,
walltime_clima_atmos,
sypd_clima_atmos,
gpu_hours_clima_atmos,
) = get_jld2data(output_dir, job_id, t_int_days, "_ss_")

# simulated years per day
sypd_clima_atmos =
(secs_per_day ./ walltime_clima_atmos) * t_int_days ./ days_per_year
# GPU hours
gpu_hours_clima_atmos =
nprocs_clima_atmos .* walltime_clima_atmos / secs_per_hour
# scaling efficiency
single_proc_time_clima_atmos = walltime_clima_atmos[1] * nprocs_clima_atmos[1]
scaling_efficiency_clima_atmos =
Expand Down
25 changes: 7 additions & 18 deletions post_processing/plot_gpu_weak_scaling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ include("plot_gpu_scaling_utils.jl")
job_id = "gpu_aquaplanet_dyamond_ws"
output_dir = "./"

secs_per_hour = 60 * 60
secs_per_day = 60 * 60 * 24
days_per_year = 8760 / 24

t_int_days = 12 / 24 # simulation integration time in days
h_elem = [30, 42, 60]
z_elem = 63
Expand All @@ -18,21 +14,14 @@ nlevels = z_elem + 1
t_int = string(t_int_days) * " days"

# read ClimaAtmos scaling data
(; nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos) =
get_jld2data(output_dir, job_id, "_ws_")

order = sortperm(nprocs_clima_atmos)
nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos =
nprocs_clima_atmos[order],
ncols_per_process[order],
walltime_clima_atmos[order]
(;
nprocs_clima_atmos,
ncols_per_process,
walltime_clima_atmos,
sypd_clima_atmos,
gpu_hours_clima_atmos,
) = get_jld2data(output_dir, job_id, t_int_days, "_ws_")

# simulated years per day
sypd_clima_atmos =
(secs_per_day ./ walltime_clima_atmos) * t_int_days ./ days_per_year
# GPU hours
gpu_hours_clima_atmos =
nprocs_clima_atmos .* walltime_clima_atmos / secs_per_hour
# weak scaling efficiency
single_proc_time_clima_atmos = walltime_clima_atmos[1] * nprocs_clima_atmos[1]
weak_scaling_efficiency_clima_atmos =
Expand Down
Loading