Skip to content

Commit

Permalink
Fix slack-message
Browse files Browse the repository at this point in the history
"$()" does not seem to be allowed in yaml
  • Loading branch information
Sbozzolo committed Aug 19, 2024
1 parent fec0d6f commit 871187f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .buildkite/amip/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,7 @@ steps:
find experiments/ClimaEarth/output/amip/amip_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
- SYPD="$(cat experiments/ClimaEarth/output/amip/amip_artifacts/sypd.txt)"; WALL="$(cat experiments/ClimaEarth/output/amip/amip_artifacts/walltime_per_atmos_step.txt)"; slack-message -c "#coupler-report" -x "SYPD: $SYPD Walltime per Atmos step: $WALL"
- cat experiments/ClimaEarth/output/amip/amip_artifacts/sypd.txt experiments/ClimaEarth/output/amip/amip_artifacts/walltime_per_atmos_step.txt > report1.txt
- echo -e "SYPD: \nWalltime per atmos step:" > report2.txt
- paste report2.txt report1.txt > report.txt
- cat report.txt | xargs -I {} slack-message -c "#coupler-report" -x "{}"
17 changes: 10 additions & 7 deletions experiments/ClimaEarth/run_amip.jl
Original file line number Diff line number Diff line change
Expand Up @@ -843,15 +843,18 @@ walltime_per_atmos_step = es.walltime / n_atmos_steps

## Save the SYPD and allocation information
if ClimaComms.iamroot(comms_ctx)
sypd_filename = joinpath(dir_paths.artifacts, "sypd.txt")
write(sypd_filename, "$sypd")
open(joinpath(dir_paths.artifacts, "sypd.txt"), "w") do sypd_filename
println(sypd_filename, "$sypd")
end

walltime_per_atmos_step_filename = joinpath(dir_paths.artifacts, "walltime_per_atmos_step.txt")
write(walltime_per_atmos_step_filename, "$(walltime_per_atmos_step)")
open(joinpath(dir_paths.artifacts, "walltime_per_atmos_step.txt"), "w") do walltime_per_atmos_step_filename
println(walltime_per_atmos_step_filename, "$(walltime_per_atmos_step)")
end

cpu_max_rss_GB = Utilities.show_memory_usage(comms_ctx)
cpu_max_rss_filename = joinpath(dir_paths.artifacts, "max_rss_cpu.txt")
write(cpu_max_rss_filename, cpu_max_rss_GB)
open(joinpath(dir_paths.artifacts, "max_rss_cpu.txt"), "w") do cpu_max_rss_filename
cpu_max_rss_GB = Utilities.show_memory_usage(comms_ctx)
println(cpu_max_rss_filename, cpu_max_rss_GB)
end
end

#=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ sypd = CA.simulated_years_per_day(es)
comms_ctx = atmos_config.comms_ctx
if ClimaComms.iamroot(comms_ctx)
open(joinpath(output_dir, "sypd.txt"), "w") do sypd_filename
write(sypd_filename, "$sypd")
println(sypd_filename, "$sypd")
end

open(joinpath(output_dir, "max_rss_cpu.txt"), "w") do cpu_max_rss_filename
cpu_max_rss_GB = Utilities.show_memory_usage(comms_ctx)
write(cpu_max_rss_filename, cpu_max_rss_GB)
println(cpu_max_rss_filename, cpu_max_rss_GB)
end
end

0 comments on commit 871187f

Please sign in to comment.