Skip to content

Commit

Permalink
Merge #110
Browse files Browse the repository at this point in the history
110: Add main comparison in CI r=charleskawczynski a=charleskawczynski



Co-authored-by: Charles Kawczynski <[email protected]>
  • Loading branch information
bors[bot] and charleskawczynski authored Aug 12, 2021
2 parents 53f14e1 + d6bb40a commit 5500e6f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ env:
CUDA_VERSION: "11.2"
OPENBLAS_NUM_THREADS: 1
CLIMATEMACHINE_SETTINGS_FIX_RNG_SEED: "true"
BUILDKITE_COMMIT: "${BUILDKITE_COMMIT}"
BUILDKITE_BRANCH: "${BUILDKITE_BRANCH}"

steps:
- label: "init :computer:"
Expand Down Expand Up @@ -161,3 +163,13 @@ steps:
queue: central
slurm_ntasks: 1

- wait

- label: ":robot_face: Move main results"
key: "cpu_mv_main_res"
command:
- "julia --color=yes --project utils/move_output.jl"
agents:
config: cpu
queue: central
slurm_ntasks: 1
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CLIMAParameters = "6eacf6c3-8458-43b9-ae03-caf5306d3d53"
Dierckx = "39dd38d3-220a-591b-8e3c-4c3a8c710a94"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
FastGaussQuadrature = "442a2c76-b920-505d-bb47-c5924d526838"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LambertW = "984bce1d-4616-540c-a9ee-88d1112d94c9"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
8 changes: 8 additions & 0 deletions integration_tests/utils/compute_mse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ function compute_mse_wrapper(
plot_dir = joinpath(dirname(ds_tc_filename), "comparison"),
kwargs...,
)
# Note: cluster_data_prefix is also defined in utils/move_output.jl
if haskey(ENV, "BUILDKITE_COMMIT")
cluster_data_prefix = "/central/scratch/climaci/turbulenceconvection-main"
commit_sha = ENV["BUILDKITE_COMMIT"][1:7]
path = joinpath(cluster_data_prefix, commit_sha)
folder_name = "Output.$case_name.01" # TODO: make this more robust in case 01 changes
ds_tc_main_filename = joinpath(path, folder_name, "$case_name.nc")
end
# Note that we're using a closure over
# - PyCLES_output_dataset_path
# - SCAMPy_output_dataset_path
Expand Down
26 changes: 26 additions & 0 deletions utils/move_output.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
if haskey(ENV, "BUILDKITE_COMMIT") && haskey(ENV, "BUILDKITE_BRANCH")
commit = ENV["BUILDKITE_COMMIT"]
branch = ENV["BUILDKITE_BRANCH"]
# Note: cluster_data_prefix is also defined in integration_tests/utils/compute_mse.jl
cluster_data_prefix = "/central/scratch/climaci/turbulenceconvection-main"

@info "pwd() = $(pwd())"
@info "branch = $(branch)"
@info "commit = $(commit)"

using Glob
if branch == "staging"
commit_sha = commit[1:7]
path = joinpath(cluster_data_prefix, commit_sha)
mkpath(path)
for folder_name in glob("Output.*")
src = folder_name
dst = joinpath(path, folder_name)
@info "Moving $src to $dst"
mv(src, dst; force = true)
end
@info "readdir(): $(readdir(path))"
end
else
@info "ENV keys: $(keys(ENV))"
end

0 comments on commit 5500e6f

Please sign in to comment.