Skip to content

Commit

Permalink
Merge pull request #3409 from CliMA/ck/repro_tests
Browse files Browse the repository at this point in the history
Delete unused code
  • Loading branch information
charleskawczynski authored Oct 29, 2024
2 parents 6ba2dce + 478d7b9 commit 7d36e14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 60 deletions.
6 changes: 3 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ steps:
julia --color=yes --project=examples examples/hybrid/driver.jl --config_file $CONFIG_PATH/sphere_baroclinic_wave_conservation_ft64.yml
--job_id sphere_baroclinic_wave_conservation_ft64
artifact_paths: "sphere_baroclinic_wave_conservation_ft64/output_active/*"

- label: ":computer: baroclinic wave check conservation with sources"
command: >
julia --color=yes --project=examples examples/hybrid/driver.jl --config_file $CONFIG_PATH/sphere_baroclinic_wave_conservation_source.yml
Expand Down Expand Up @@ -352,7 +352,7 @@ steps:
artifact_paths: "aquaplanet_rhoe_equil_clearsky_tvinsol_0M_slabocean/output_active/*"
agents:
slurm_mem: 20GB

- label: ":computer: aquaplanet (ρe_tot) slabocean equilmoist allsky radiation monin_obukhov varying insolation float64"
command: >
julia --color=yes --project=examples examples/hybrid/driver.jl
Expand All @@ -361,7 +361,7 @@ steps:
artifact_paths: "aquaplanet_rhoe_equil_clearsky_tvinsol_0M_slabocean_ft64/output_active/*"
agents:
slurm_mem: 20GB

- label: ":computer: aquaplanet (ρe_tot) rcemipii with diagnostic edmf"
command: >
julia --color=yes --project=examples examples/hybrid/driver.jl
Expand Down
57 changes: 0 additions & 57 deletions reproducibility_tests/self_reference_or_path.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,60 +81,3 @@ function self_reference_or_path()
end
return path
end

"""
get_main_branch_buildkite_path()
Return the folder of the most recent buildkite run that contains a `ref_counter.jl` file,
and therefore also contains hdf5 files with output data.
This is very similar to `self_reference_or_path`, except that it always returns a path, not
`:self_reference`. Functionality could be merged in a future PR.
"""
function get_main_branch_buildkite_path()
# TODO: Combine this method with `self_reference_or_path`, above.
cluster_data_prefix = "/central/scratch/esm/slurm-buildkite/climaatmos-main"
if !ispath(cluster_data_prefix)
if get(ENV, "BUILDKITE_PIPELINE_SLUG", nothing) == "climaatmos-ci"
error("No path found for comparison against main")
else
@warn "Buildkite reference data is not available locally; skipping \
comparison against main"
return ""
end
end

buildkite_paths = readdir(cluster_data_prefix; join = true)
filter!(buildkite_paths) do path
isdir(path)
end
if isempty(buildkite_paths)
@warn("no buildkite paths found")
return ""
end
sort!(
buildkite_paths;
by = f -> Dates.unix2datetime(stat(f).mtime),
rev = true,
) # most recent build first

# Find ref counters
ref_counters = -ones(Int, length(buildkite_paths))
for (i, path) in enumerate(buildkite_paths)
ref_counter_file_main = joinpath(path, "ref_counter.jl")
if isfile(ref_counter_file_main) # set ref_counter value if file exists.
ref_counters[i] =
parse(Int, first(readlines(ref_counter_file_main)))
end
end
if all(ref_counters .== -1)
@warn("No `ref_counter.jl` files found")
return ""
end

most_recent_max_counter_ind = argmax(ref_counters)
main_branch_data_path = buildkite_paths[most_recent_max_counter_ind]
@info "Comparing PR profiles against main with commit id: \
$(basename(main_branch_data_path))"
return main_branch_data_path
end

0 comments on commit 7d36e14

Please sign in to comment.