Skip to content

Commit

Permalink
Merge #1767
Browse files Browse the repository at this point in the history
1767: Remove allocs monitoring, fix docs, fix parameter tests r=charleskawczynski a=charleskawczynski

This PR:
 - Removes the allocation monitoring (a step towards #1766)
 - Fixes some doc strings for file includes
 - Fixes the parameter tests and includes them in the test suite.

Co-authored-by: Charles Kawczynski <[email protected]>
  • Loading branch information
bors[bot] and charleskawczynski committed Jun 13, 2023
2 parents 33e82d0 + 7379cbf commit 1b1e69f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 104 deletions.
8 changes: 0 additions & 8 deletions .buildkite/longruns/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,3 @@ steps:
artifact_paths: "longrun_compressible_edmf_trmm/*"
agents:
slurm_mem: 20GB

- group: "Performance"
steps:

- label: ":mag: Allocations: perf target"
command: "julia --color=yes --project=perf perf/allocs.jl"
agents:
slurm_mem: 20GB
71 changes: 0 additions & 71 deletions perf/allocs.jl

This file was deleted.

12 changes: 0 additions & 12 deletions perf/allocs_per_case.jl

This file was deleted.

6 changes: 3 additions & 3 deletions src/solver/cli_options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ Example:
function print_repl_script(str)
ib = """"""
ib *= """\n"""
ib *= """using Revise; include("src/utils/cli_options.jl");\n"""
ib *= """using Revise; include(joinpath("src", "solver", "cli_options.jl"));\n"""
ib *= """\n"""
ib *= """parsed_args = parse_commandline(argparse_settings());\n"""
parsed_args = parsed_args_from_command_line_flags(str)
Expand Down Expand Up @@ -510,8 +510,8 @@ To run the `sphere_aquaplanet_rhoe_equilmoist_allsky`
buildkite job from the standard buildkite pipeline, use:
```
using Revise;
include("src/utils/cli_options.jl");
include("src/utils/yaml_helper.jl");
include("src/solver/cli_options.jl");
include("src/solver/yaml_helper.jl");
dict = parsed_args_per_job_id();
parsed_args = dict["sphere_aquaplanet_rhoe_equilmoist_allsky"];
include("examples/hybrid/driver.jl")
Expand Down
23 changes: 13 additions & 10 deletions test/parameter_tests.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using Test
import CLIMAParameters as CP

include("../src/utils/cli_options.jl")
include("../parameters/create_parameters.jl")
import ClimaAtmos as CA

FT = Float64

s = argparse_settings()
default_args = cli_defaults(s)
default_args = CA.cli_defaults(CA.argparse_settings())

@testset "Test types" begin

Expand All @@ -20,7 +17,7 @@ default_args = cli_defaults(s)
"bubble" => true,
)
toml_dict = CP.create_toml_dict(FT)
toml_dict, _ = merge_parsed_args_with_toml(toml_dict, dict, default_args)
toml_dict, _ = CA.merge_parsed_args_with_toml(toml_dict, dict, default_args)
values = (; CP.get_parameter_values!(toml_dict, collect(keys(dict)))...)

@test values.krylov_rtol isa FT
Expand All @@ -43,11 +40,14 @@ default_args = cli_defaults(s)
end

@testset "Test override and alias" begin
toml_dict = CP.create_toml_dict(FT; override_file = "parameter_tests.toml")
toml_dict = CP.create_toml_dict(
FT;
override_file = joinpath(@__DIR__, "parameter_tests.toml"),
)
@test CP.get_parameter_values!(toml_dict, "y_elem").second == 0

dict = Dict("y_elem" => 1)
toml_dict, _ = merge_parsed_args_with_toml(toml_dict, dict, default_args)
toml_dict, _ = CA.merge_parsed_args_with_toml(toml_dict, dict, default_args)
println(CP.get_parameter_values!(toml_dict, "y_elem"))
println(typeof(CP.get_parameter_values!(toml_dict, "y_elem")))
@test CP.get_parameter_values!(toml_dict, "y_elem").second == 1
Expand All @@ -57,14 +57,17 @@ end
end

@testset "Test priorities" begin
toml_dict = CP.create_toml_dict(FT; override_file = "parameter_tests.toml")
toml_dict = CP.create_toml_dict(
FT;
override_file = joinpath(@__DIR__, "parameter_tests.toml"),
)
parsed_args = Dict(
"toml" => "test/parameter_tests.toml",
"dt" => "35secs",
"t_end" => "3hours",
)
toml_dict, _ =
merge_parsed_args_with_toml(toml_dict, parsed_args, default_args)
CA.merge_parsed_args_with_toml(toml_dict, parsed_args, default_args)
param_names = ["dt", "dt_save_to_disk", "z_elem"]
params = CP.get_parameter_values!(toml_dict, param_names)
params = (; params...)
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ using Test

@safetestset "Aqua" begin
@time include("utilities.jl")
@time include("parameter_tests.jl")
@time include("aqua.jl")
end

Expand Down

0 comments on commit 1b1e69f

Please sign in to comment.