File tree Expand file tree Collapse file tree 4 files changed +19
-19
lines changed Expand file tree Collapse file tree 4 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,12 @@ walltime_in_days(es::EfficiencyStats) = es.walltime * (1 / (24 * 3600)) #=second
21
21
22
22
function timed_solve! (integrator)
23
23
device = ClimaComms. device (integrator. u. c)
24
+ comms_ctx = ClimaComms. context (device)
24
25
local sol
25
- @time " solve!:" begin
26
- walltime = ClimaComms. elapsed (device) do
27
- sol = SciMLBase. solve! (integrator)
28
- end
26
+ walltime = ClimaComms. elapsed (device) do
27
+ sol = SciMLBase. solve! (integrator)
29
28
end
29
+ @info " solve! walltime = $(round (walltime, digits = 3 )) "
30
30
(; tspan) = integrator. sol. prob
31
31
es = EfficiencyStats (tspan, walltime)
32
32
_sypd = simulated_years_per_day (es)
Original file line number Diff line number Diff line change @@ -574,7 +574,6 @@ function get_sim_info(config::AtmosConfig)
574
574
start_date = epoch,
575
575
t_end = t_end,
576
576
)
577
- @show sim. t_end, sim. dt
578
577
n_steps = floor (Int, sim. t_end / sim. dt)
579
578
@info (
580
579
" Time info:" ,
@@ -639,15 +638,17 @@ end
639
638
640
639
import ClimaComms, Logging, NVTX
641
640
function get_comms_context (parsed_args)
642
- device = if parsed_args[" device" ] == " auto"
643
- ClimaComms. device ()
644
- elseif parsed_args[" device" ] == " CUDADevice"
645
- ClimaComms. CUDADevice ()
646
- elseif parsed_args[" device" ] == " CPUMultiThreaded" || Threads. nthreads () > 1
647
- ClimaComms. CPUMultiThreaded ()
648
- else
649
- ClimaComms. CPUSingleThreaded ()
650
- end
641
+ device =
642
+ if ! haskey (parsed_args, " device" ) || parsed_args[" device" ] === " auto"
643
+ ClimaComms. device ()
644
+ elseif parsed_args[" device" ] == " CUDADevice"
645
+ ClimaComms. CUDADevice ()
646
+ elseif parsed_args[" device" ] == " CPUMultiThreaded" ||
647
+ Threads. nthreads () > 1
648
+ ClimaComms. CPUMultiThreaded ()
649
+ else
650
+ ClimaComms. CPUSingleThreaded ()
651
+ end
651
652
comms_ctx = ClimaComms. context (device)
652
653
ClimaComms. init (comms_ctx)
653
654
Original file line number Diff line number Diff line change @@ -677,9 +677,7 @@ function AtmosConfig(
677
677
678
678
all_config_files =
679
679
normrelpath .(maybe_add_default (config_files, default_config_file))
680
-
681
680
configs = map (all_config_files) do config_file
682
- @info " Loading yaml file $config_file "
683
681
strip_help_messages (load_yaml_file (config_file))
684
682
end
685
683
return AtmosConfig (
@@ -714,13 +712,15 @@ function AtmosConfig(
714
712
# using config_files = [default_config_file] as a default
715
713
# relies on the fact that override_default_config uses
716
714
# default_config_file.
717
- config = override_default_config (configs)
715
+ config = merge (configs... )
716
+ comms_ctx = isnothing (comms_ctx) ? get_comms_context (config) : comms_ctx
717
+ config = override_default_config (config)
718
+
718
719
FT = config[" FLOAT_TYPE" ] == " Float64" ? Float64 : Float32
719
720
toml_dict = CP. create_toml_dict (
720
721
FT;
721
722
override_file = CP. merge_toml_files (config[" toml" ]),
722
723
)
723
- comms_ctx = isnothing (comms_ctx) ? get_comms_context (config) : comms_ctx
724
724
config = config_with_resolved_and_acquired_artifacts (config, comms_ctx)
725
725
726
726
isempty (job_id) &&
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ override_default_config(config_dicts::ContainerType(AbstractDict)) =
59
59
override_default_config (merge (config_dicts... ))
60
60
61
61
function override_default_config (:: Nothing )
62
- @info " Using default configuration"
63
62
return default_config_dict ()
64
63
end
65
64
You can’t perform that action at this time.
0 commit comments