Skip to content

Commit e7221ba

Browse files
Merge pull request #2892 from CliMA/ck/scaling_plot_utils
Rm code dup, rm some prints, tabulate scaling
2 parents a7b463a + a4529b0 commit e7221ba

File tree

4 files changed

+59
-46
lines changed

4 files changed

+59
-46
lines changed

.buildkite/gpu_pipeline/pipeline.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ steps:
161161
- mkdir -p gpu_aquaplanet_dyamond_ss
162162
- >
163163
julia --color=yes --project=examples post_processing/plot_gpu_strong_scaling.jl gpu_aquaplanet_dyamond_ss
164-
artifact_paths: "gpu_aquaplanet_dyamond_ss/output_active/*"
164+
artifact_paths: "gpu_aquaplanet_dyamond_ss/*"
165165
agents:
166166
slurm_cpus_per_task: 1
167167
slurm_ntasks: 1
@@ -225,7 +225,7 @@ steps:
225225
- mkdir -p gpu_aquaplanet_dyamond_ws
226226
- >
227227
julia --color=yes --project=examples post_processing/plot_gpu_weak_scaling.jl gpu_aquaplanet_dyamond_ws
228-
artifact_paths: "gpu_aquaplanet_dyamond_ws/output_active/*"
228+
artifact_paths: "gpu_aquaplanet_dyamond_ws/*"
229229
agents:
230230
slurm_cpus_per_task: 1
231231
slurm_ntasks: 1

post_processing/plot_gpu_scaling_utils.jl

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
using JLD2
2-
function get_jld2data(output_dir, job_id, s)
2+
import PrettyTables as PT
3+
4+
function get_jld2data(output_dir, job_id, t_int_days, s)
5+
secs_per_day = 60 * 60 * 24
6+
secs_per_hour = 60 * 60
7+
days_per_year = 8760 / 24
38
FT = Float64
49
nprocs_clima_atmos = Int[]
510
ncols_per_process = Int[]
@@ -22,16 +27,46 @@ function get_jld2data(output_dir, job_id, s)
2227
push!(nprocs_clima_atmos, Int(dict["nprocs"]))
2328
push!(ncols_per_process, Int(dict["ncols_per_process"]))
2429
push!(walltime_clima_atmos, FT(dict["walltime"]))
25-
else
26-
@show occursin(job_id, foldername)
27-
@show occursin(s, foldername)
30+
found = true
2831
end
2932
end
3033
if !found
3134
@show readdir(output_dir)
35+
for foldername in readdir(output_dir)
36+
@show occursin(job_id, foldername)
37+
@show occursin(s, foldername)
38+
end
3239
end
33-
@show nprocs_clima_atmos
34-
@show ncols_per_process
35-
@show walltime_clima_atmos
36-
return (; nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos)
40+
order = sortperm(nprocs_clima_atmos)
41+
nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos =
42+
nprocs_clima_atmos[order],
43+
ncols_per_process[order],
44+
walltime_clima_atmos[order]
45+
46+
# simulated years per day
47+
sypd_clima_atmos =
48+
(secs_per_day ./ walltime_clima_atmos) * t_int_days ./ days_per_year
49+
50+
# GPU hours
51+
gpu_hours_clima_atmos =
52+
nprocs_clima_atmos .* walltime_clima_atmos / secs_per_hour
53+
54+
data = hcat(
55+
nprocs_clima_atmos,
56+
ncols_per_process,
57+
walltime_clima_atmos,
58+
sypd_clima_atmos,
59+
)
60+
PT.pretty_table(
61+
data;
62+
header = ["N procs", "Ncols per process", "walltime (seconds)", "SYPD"],
63+
alignment = :l,
64+
)
65+
return (;
66+
nprocs_clima_atmos,
67+
ncols_per_process,
68+
walltime_clima_atmos,
69+
sypd_clima_atmos,
70+
gpu_hours_clima_atmos,
71+
)
3772
end

post_processing/plot_gpu_strong_scaling.jl

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ include("plot_gpu_scaling_utils.jl")
66
job_id = "gpu_aquaplanet_dyamond_ss"
77
output_dir = "./"
88

9-
secs_per_hour = 60 * 60
10-
secs_per_day = 60 * 60 * 24
11-
days_per_year = 8760 / 24
12-
139
t_int_days = 12 / 24 # simulation integration time in days
1410
h_elem = 30
1511
z_elem = 63
@@ -18,21 +14,14 @@ nlevels = z_elem + 1
1814
t_int = string(t_int_days) * " days"
1915

2016
# read ClimaAtmos scaling data
21-
(; nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos) =
22-
get_jld2data(output_dir, job_id, "_ss_")
23-
24-
order = sortperm(nprocs_clima_atmos)
25-
nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos =
26-
nprocs_clima_atmos[order],
27-
ncols_per_process[order],
28-
walltime_clima_atmos[order]
17+
(;
18+
nprocs_clima_atmos,
19+
ncols_per_process,
20+
walltime_clima_atmos,
21+
sypd_clima_atmos,
22+
gpu_hours_clima_atmos,
23+
) = get_jld2data(output_dir, job_id, t_int_days, "_ss_")
2924

30-
# simulated years per day
31-
sypd_clima_atmos =
32-
(secs_per_day ./ walltime_clima_atmos) * t_int_days ./ days_per_year
33-
# GPU hours
34-
gpu_hours_clima_atmos =
35-
nprocs_clima_atmos .* walltime_clima_atmos / secs_per_hour
3625
# scaling efficiency
3726
single_proc_time_clima_atmos = walltime_clima_atmos[1] * nprocs_clima_atmos[1]
3827
scaling_efficiency_clima_atmos =

post_processing/plot_gpu_weak_scaling.jl

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ include("plot_gpu_scaling_utils.jl")
66
job_id = "gpu_aquaplanet_dyamond_ws"
77
output_dir = "./"
88

9-
secs_per_hour = 60 * 60
10-
secs_per_day = 60 * 60 * 24
11-
days_per_year = 8760 / 24
12-
139
t_int_days = 12 / 24 # simulation integration time in days
1410
h_elem = [30, 42, 60]
1511
z_elem = 63
@@ -18,21 +14,14 @@ nlevels = z_elem + 1
1814
t_int = string(t_int_days) * " days"
1915

2016
# read ClimaAtmos scaling data
21-
(; nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos) =
22-
get_jld2data(output_dir, job_id, "_ws_")
23-
24-
order = sortperm(nprocs_clima_atmos)
25-
nprocs_clima_atmos, ncols_per_process, walltime_clima_atmos =
26-
nprocs_clima_atmos[order],
27-
ncols_per_process[order],
28-
walltime_clima_atmos[order]
17+
(;
18+
nprocs_clima_atmos,
19+
ncols_per_process,
20+
walltime_clima_atmos,
21+
sypd_clima_atmos,
22+
gpu_hours_clima_atmos,
23+
) = get_jld2data(output_dir, job_id, t_int_days, "_ws_")
2924

30-
# simulated years per day
31-
sypd_clima_atmos =
32-
(secs_per_day ./ walltime_clima_atmos) * t_int_days ./ days_per_year
33-
# GPU hours
34-
gpu_hours_clima_atmos =
35-
nprocs_clima_atmos .* walltime_clima_atmos / secs_per_hour
3625
# weak scaling efficiency
3726
single_proc_time_clima_atmos = walltime_clima_atmos[1] * nprocs_clima_atmos[1]
3827
weak_scaling_efficiency_clima_atmos =

0 commit comments

Comments
 (0)