Skip to content

Commit

Permalink
Regrid truncated data
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasia-popova committed Apr 11, 2024
1 parent 1a00ea9 commit dfa819d
Show file tree
Hide file tree
Showing 20 changed files with 802 additions and 476 deletions.
146 changes: 32 additions & 114 deletions .buildkite/longruns/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
agents:
queue: new-central
slurm_time: 24:00:00
modules: climacommon/2024_03_18
modules: climacommon/2024_04_05

env:
JULIA_LOAD_PATH: "${JULIA_LOAD_PATH}:${BUILDKITE_BUILD_CHECKOUT_PATH}/.buildkite"
Expand All @@ -13,7 +13,6 @@ env:
SLURM_KILL_BAD_EXIT: 1

CONFIG_PATH: "config/longrun_configs"
PERF_CONFIG_PATH: "config/perf_configs"

timeout_in_minutes: 1440

Expand All @@ -34,11 +33,6 @@ steps:
- "julia --project=artifacts -e 'using Pkg; Pkg.status()'"
- "julia --project=artifacts artifacts/download_artifacts.jl"

- echo "--- Instantiate perf env"
- "julia --project=perf/ -e 'using Pkg; Pkg.instantiate(;verbose=true)'"
- "julia --project=perf/ -e 'using Pkg; Pkg.precompile()'"
- "julia --project=perf/ -e 'using Pkg; Pkg.status()'"

agents:
slurm_cpus_per_task: 8
env:
Expand Down Expand Up @@ -75,6 +69,7 @@ steps:
slurm_mem: 20GB
slurm_gpus: 1
modules: common
soft_fail: true

- group: "Coupler integration and conservation tests"

Expand All @@ -91,6 +86,7 @@ steps:
slurm_ntasks_per_node: 1
slurm_nodes: 1
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "Slabplanet_aqua: couple"
key: "slabplanet_aqua_atmos_sf_couple" # SF at each Atmos stage, coupling, prescribed SST from coupler - identical results to the above confirm 1) initial conditions in Atmos are unchanged compared to the slab, 2) coupling not introducing variability when constant surface
Expand All @@ -102,6 +98,7 @@ steps:
slurm_ntasks_per_node: 1
slurm_nodes: 1
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "Slabplanet_aqua: coupler fluxes"
key: "slabplanet_aqua_coupler_sf" # SF at each coupler timestep, constant ocean - comparing to the above runs, this tests the sensitivity of less frequent flux calculation
Expand All @@ -113,6 +110,7 @@ steps:
slurm_ntasks_per_node: 1
slurm_nodes: 1
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "Slabplanet_aqua: coupler fluxes, evolving ocean"
key: "slabplanet_aqua_coupler_sf_evolve_ocn" # SF at each coupler timestep, evolving ocean - comparing to the above run, tests the sensitivity of evolving ocean
Expand All @@ -124,6 +122,7 @@ steps:
slurm_ntasks_per_node: 1
slurm_nodes: 1
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "Slabplanet_terra: coupler fluxes, evolving bucket"
key: "slabplanet_terra" # SF at each coupler timestep, evolving ocean - comparing to the above run, tests the sensitivity of evolving bucket
Expand All @@ -135,6 +134,7 @@ steps:
slurm_ntasks_per_node: 1
slurm_nodes: 1
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "Slabplanet: coupler fluxes, evolving ocean and land"
key: "slabplanet_coupler_sf_evolve_ocn"
Expand All @@ -146,8 +146,9 @@ steps:
slurm_ntasks_per_node: 1
slurm_nodes: 1
slurm_mem_per_cpu: 16G
soft_fail: true

- group: "Current target tests: idealized surface"
- group: "Current target tests: idealized surfaces"

steps:

Expand All @@ -162,6 +163,7 @@ steps:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "TARGET IDEALIZED: new target aqua - fixed ocean T, nocouple, atmos flux calc"
key: "slabplanet_aqua_target_nocouple"
Expand All @@ -174,6 +176,7 @@ steps:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "TARGET IDEALIZED: new target aqua - fixed ocean T, coupler flux calc"
key: "slabplanet_aqua_target"
Expand All @@ -186,6 +189,7 @@ steps:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "TARGET IDEALIZED: new target aqua - evolving slab ocean T"
key: "slabplanet_aqua_target_evolve_ocn"
Expand All @@ -198,6 +202,7 @@ steps:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "TARGET IDEALIZED: new target slab - fixed ocean T, bucket"
key: "slabplanet_target"
Expand All @@ -210,6 +215,7 @@ steps:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "TARGET IDEALIZED: new target slab - evolving slab ocean T, bucket"
key: "slabplanet_target_evolve_ocn"
Expand All @@ -222,9 +228,10 @@ steps:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 16G
soft_fail: true


- group: "Current target tests: AMIP surface"
- group: "Current target tests: AMIP surfaces"

steps:

Expand All @@ -239,6 +246,7 @@ steps:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "MPI AMIP FINE: new target amip: topo"
key: "amip_target_topo"
Expand All @@ -251,6 +259,7 @@ steps:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 16G
soft_fail: true

- label: "MPI AMIP FINE: new target amip: topo + diagedmf"
key: "amip_target_topo_diagedmf"
Expand All @@ -263,6 +272,7 @@ steps:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 20G
soft_fail: true

- group: "Current target tests on GPU: AMIP surface"

Expand All @@ -275,6 +285,7 @@ steps:
agents:
slurm_gpus: 1
slurm_mem: 16GB
soft_fail: true

- label: "GPU AMIP FINE: new target amip: topo + diagedmf"
key: "gpu_amip_target_topo_diagedmf"
Expand All @@ -283,105 +294,13 @@ steps:
agents:
slurm_gpus: 1
slurm_mem: 16GB
soft_fail: true

- group: "Other AMIP targets"

steps:

# DYAMOND AMIP: 1 day (convection resolving)
- label: "MPI AMIP SUPERFINE: dyamond_target"
key: "dyamond_target"
command: "srun julia --color=yes --project=experiments/AMIP/ experiments/AMIP/coupler_driver.jl --config_file $CONFIG_PATH/dyamond_target.yml"
artifact_paths: "experiments/AMIP/output/amip/dyamond_target_artifacts/*"
env:
CLIMACORE_DISTRIBUTED: "MPI"
BUILD_HISTORY_HANDLE: ""
agents:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 16G

# mid-resolution AMIP: MPI performance scaling (10 days)
- label: "MPI AMIP FINE: n64"
key: "mpi_amip_fine_n64"
command: "srun julia --color=yes --project=experiments/AMIP/ experiments/AMIP/coupler_driver.jl --config_file $CONFIG_PATH/amip_n64_shortrun.yml"
artifact_paths: "experiments/AMIP/output/amip/amip_n64_shortrun_artifacts/*"
env:
CLIMACORE_DISTRIBUTED: "MPI"
BUILD_HISTORY_HANDLE: ""
agents:
slurm_ntasks_per_node: 16
slurm_nodes: 4
slurm_mem_per_cpu: 16G

- label: "MPI AMIP FINE: n32"
key: "mpi_amip_fine_n32"
command: "srun julia --color=yes --project=experiments/AMIP/ experiments/AMIP/coupler_driver.jl --config_file $CONFIG_PATH/amip_n32_shortrun.yml"
artifact_paths: "experiments/AMIP/output/amip/amip_n32_shortrun_artifacts/*"
env:
CLIMACORE_DISTRIBUTED: "MPI"
BUILD_HISTORY_HANDLE: ""
agents:
slurm_ntasks_per_node: 8
slurm_nodes: 4
slurm_mem_per_cpu: 16G

- label: "MPI AMIP FINE: n8"
key: "mpi_amip_fine_n8"
command: "srun julia --color=yes --project=experiments/AMIP/ experiments/AMIP/coupler_driver.jl --config_file $CONFIG_PATH/amip_n8_shortrun.yml"
artifact_paths: "experiments/AMIP/output/amip/amip_n8_shortrun_artifacts/*"
env:
CLIMACORE_DISTRIBUTED: "MPI"
BUILD_HISTORY_HANDLE: ""
agents:
slurm_ntasks_per_node: 8
slurm_nodes: 1
slurm_mem_per_cpu: 16G

- label: "MPI AMIP FINE: n2" # 10d take 21h, so reducing to 1d
key: "mpi_amip_fine_n2"
command: "srun julia --color=yes --project=experiments/AMIP/ experiments/AMIP/coupler_driver.jl --config_file $CONFIG_PATH/amip_n2_shortrun.yml"
artifact_paths: "experiments/AMIP/output/amip/amip_n2_shortrun_artifacts/*"
env:
CLIMACORE_DISTRIBUTED: "MPI"
BUILD_HISTORY_HANDLE: ""
agents:
slurm_ntasks_per_node: 2
slurm_nodes: 1
slurm_mem_per_cpu: 16G

- label: "MPI AMIP FINE: n1" # also reported by longruns with a flame graph; 10d take 21h, so reducing to 1d
key: "mpi_amip_fine_n1"
command: "julia --color=yes --project=experiments/AMIP/ experiments/AMIP/coupler_driver.jl --config_file $CONFIG_PATH/amip_n1_shortrun.yml"
artifact_paths: "experiments/AMIP/output/amip/amip_n1_shortrun_artifacts/*"
env:
BUILD_HISTORY_HANDLE: ""
agents:
slurm_ntasks_per_node: 1
slurm_nodes: 1
slurm_mem_per_cpu: 16G

- label: "MPI AMIP FINE: n1 no couple" # sim time = Δt_cpl (~ benchmarking with standalone models)
key: "mpi_amip_fine_n1_nocouple"
command: "julia --color=yes --project=experiments/AMIP/ experiments/AMIP/coupler_driver.jl --config_file $CONFIG_PATH/amip_n1_shortrun_nocouple.yml"
artifact_paths: "experiments/AMIP/output/amip/amip_n1_shortrun_nocouple_artifacts/*"
env:
BUILD_HISTORY_HANDLE: ""
agents:
slurm_ntasks_per_node: 1
slurm_nodes: 1
slurm_mem_per_cpu: 16G
- wait

# mpi_amip_fine_n1 flame graph report (NB: arguments passed from the ci pipeline.yml)
- label: ":rocket: performance: flame graph diff: perf_target_amip_n1_shortrun"
command: "julia --color=yes --project=perf perf/flame_diff.jl --config_file $PERF_CONFIG_PATH/perf_diff_target_amip_n1_shortrun.yml"
artifact_paths: "perf/output/perf_diff_target_amip_n1_shortrun/*"
agents:
slurm_ntasks_per_node: 1
slurm_nodes: 1
slurm_mem_per_cpu: 16G
- group: "Job analysis and reporting"

- wait
steps:

# plot job performance history
- label: ":chart_with_downwards_trend: build history"
Expand All @@ -394,21 +313,20 @@ steps:

- label: ":envelope: Slack report: build_history"
command:
- slack-upload -c "#coupler-report" -f build_history.html -m html -n build_history -x "Overall job performance"
- |
slack-upload -c "#coupler-report" -f build_history.html -m html -n build_history -x ":rocket: Interactive overall job performance history (download the attached file and view in browser) :rocket:"
- label: ":envelope: Slack report: Slabplanet"
command:
- slack-upload -c "#coupler-report" -f experiments/AMIP/output/slabplanet/slabplanet_coupler_sf_evolve_ocn_artifacts/total_energy_log_bucket.png -m png -n slab_coarse_log -x "Slabplanet energy conservation (log error)"
- slack-upload -c "#coupler-report" -f experiments/AMIP/output/slabplanet/slabplanet_coupler_sf_evolve_ocn_artifacts/total_energy_bucket.png -m png -n slab_coarse -x "Slabplanet energy conservation"
- slack-upload -c "#coupler-report" -f experiments/AMIP/output/slabplanet/slabplanet_coupler_sf_evolve_ocn_artifacts/total_water_log_bucket.png -m png -n slab_coarse_w_log -x "Slabplanet water conservation (log error)"
- slack-upload -c "#coupler-report" -f experiments/AMIP/output/slabplanet/slabplanet_coupler_sf_evolve_ocn_artifacts/total_water_bucket.png -m png -n slab_coarse_w -x "Slabplanet water conservation"

- label: ":envelope: Slack report: target AMIP"
command:
- slack-upload -c "#coupler-report" -f experiments/AMIP/output/amip/amip_target_artifacts/amip_paperplots.png -m png -n amip_fine -x "AMIP Target Longrun"
- slack-upload -c "#coupler-report" -f experiments/AMIP/output/amip/amip_target_artifacts/biases.png -m png -n amip_fine -x "AMIP Target Longrun"
- slack-upload -c "#coupler-report" -f experiments/AMIP/output/amip/amip_target_topo_diagedmf_artifacts/amip_ncep.png -m png -n amip_fine -x "Target AMIP v NCEP Last Month Mean"
- |
find experiments/AMIP/output/amip/amip_target_topo_diagedmf_artifacts/ -type f -name 'bias*.png' -print0 | while IFS= read -r -d '' file; do
slack-upload -c "#coupler-report" -f "$$file" -m png -n "$$(basename "$$file" .png)" -x "$$(basename "$$file" .png)"
done
- label: ":envelope: Slack report: Flame Diff"
command:
- slack-upload -c "#coupler-report" -f perf/output/perf_diff_target_amip_n1_shortrun/flame_diff.html -m png -n amip_fine_flamegraphdiff -x "AMIP Longrun FlameGraphDiff"
- slack-upload -c "#coupler-report" -f perf/output/perf_diff_target_amip_n1_shortrun/flame_diff_self_count.html -m png -n amip_fine_flamegraphdiffself -x "AMIP Longrun FlameGraphDiffSelf"
2 changes: 1 addition & 1 deletion .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
agents:
queue: new-central
slurm_time: 4:00:00
modules: climacommon/2024_03_18
modules: climacommon/2024_04_05

env:
JULIA_LOAD_PATH: "${JULIA_LOAD_PATH}:${BUILDKITE_BUILD_CHECKOUT_PATH}/.buildkite"
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ClimaCoupler"
uuid = "4ade58fe-a8da-486c-bd89-46df092ec0c7"
authors = ["CliMA Contributors <clima-software@caltech.edu>"]
version = "0.1.0"
version = "0.0.1"

[deps]
ClimaAtmos = "b2c96348-7fb7-4fe0-8da9-78d88439e717"
Expand Down Expand Up @@ -34,7 +34,7 @@ Dates = "1"
DocStringExtensions = "0.8, 0.9"
Insolation = "0.9.2"
JLD2 = "0.4"
NCDatasets = "0.11, 0.12, 0.13, =0.14.1"
NCDatasets = "0.11, 0.12, 0.13, 0.14.2"
Plots = "1.39.0"
SciMLBase = "1, 2"
StaticArrays = "1"
Expand Down
18 changes: 18 additions & 0 deletions artifacts/artifact_funcs.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import ArtifactWrappers as AW
#using NCDatasets

function sst_dataset_path()
sst_dataset = AW.ArtifactWrapper(
Expand Down Expand Up @@ -59,3 +60,20 @@ function pr_obs_data_path()
)
return AW.get_data_folder(pr_obs_data)
end

"""
artifact_data(datapath_full, name; datapath_trunc, date0, time_start, time_end, comms_ctx)
Truncates given data set, and constructs a new dataset containing only the dates that are used in the simulation
"""
function artifact_data(datapath_full, name)
datafile_truncated = joinpath(datapath_full, string(name, ".nc"))
return datafile_truncated
end

function artifact_data(datapath_full, name, datapath_trunc, date0, time_start, time_end, comms_ctx)
datafile = joinpath(datapath_full, string(name, ".nc"))
datafile_truncated =
Regridder.truncate_dataset(datafile, name, datapath_trunc, date0, time_start, time_end, comms_ctx)
return datafile_truncated
end
5 changes: 4 additions & 1 deletion config/model_configs/slabplanet_atmos_diags.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
anim: true
apply_limiter: false
ci_plots: true
dt: "200secs"
dt_cpl: 200
dt_save_to_sol: "9days"
Expand All @@ -9,11 +10,13 @@ job_id: "slabplanet_atmos_diags"
mode_name: "slabplanet"
moist: "equil"
mono_surface: true
output_default_diagnostics: false
precip_model: "0M"
rad: "gray"
run_name: "slabplanet_atmos_diags"
t_end: "10days"
vert_diff: "true"
diagnostics:
- short_name: [mse, lr, ediff]
- short_name: [mse, lr, ediff, ts]
reduction_time: average
period: 1days
5 changes: 5 additions & 0 deletions config/model_configs/slabplanet_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ rad: "gray"
run_name: "slabplanet_default"
t_end: "10days"
vert_diff: "true"
output_default_diagnostics: false
diagnostics:
- short_name: [mse, lr, ediff, hfes, evspsbl, ts]
period: 1days

Loading

0 comments on commit dfa819d

Please sign in to comment.