Skip to content

Commit cd23e21

Browse files
Merge pull request #208 from CliMA/ne/fix
Fix `DerechoBackend`
2 parents 67040b2 + 7af1163 commit cd23e21

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

experiments/surface_fluxes_perfect_model/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ end
2020
function compare_g_ensemble(eki1, eki2)
2121
@testset "Compare g_ensemble between two EKP objects" begin
2222
for (g1, g2) in zip(eki1.g, eki2.g)
23-
@test g1.stored_data == g2.stored_data
23+
@test g1.stored_data g2.stored_data rtol = 1e-5
2424
end
2525
end
2626
end

src/pbs.jl

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ function generate_pbs_script(
2222
model_interface::AbstractString,
2323
module_load_str::AbstractString;
2424
hpc_kwargs = Dict(),
25+
exeflags = "",
2526
)
2627
member_log = path_to_model_log(output_dir, iter, member)
2728

@@ -46,23 +47,23 @@ function generate_pbs_script(
4647
member_path = path_to_ensemble_member(output_dir, iter, member)
4748
julia_filepath = joinpath(member_path, "model_run.jl")
4849

49-
pbs_script = """
50-
#!/bin/bash
51-
#PBS -N run_$(iter)_$member
52-
#PBS -j oe
53-
#PBS -A UCIT0011
54-
#PBS -q $queue
55-
#PBS -o $member_log
56-
#PBS -l walltime=$walltime
57-
#PBS -l select=$num_nodes:ncpus=$cpus_per_node:ngpus=$gpus_per_node:mpiprocs=$ranks_per_node
58-
59-
$module_load_str
60-
61-
export JULIA_MPI_HAS_CUDA=true
62-
export CLIMACOMMS_DEVICE="$climacomms_device"
63-
export CLIMACOMMS_CONTEXT="MPI"
64-
\$MPITRAMPOLINE_MPIEXEC -n $total_ranks -ppn $ranks_per_node $set_gpu_rank julia --project=$experiment_dir $julia_filepath
65-
"""
50+
pbs_script = """\
51+
#!/bin/bash
52+
#PBS -N run_$(iter)_$member
53+
#PBS -j oe
54+
#PBS -A UCIT0011
55+
#PBS -q $queue
56+
#PBS -o $member_log
57+
#PBS -l walltime=$walltime
58+
#PBS -l select=$num_nodes:ncpus=$cpus_per_node:ngpus=$gpus_per_node:mpiprocs=$ranks_per_node
59+
60+
$module_load_str
61+
62+
export JULIA_MPI_HAS_CUDA=true
63+
export CLIMACOMMS_DEVICE="$climacomms_device"
64+
export CLIMACOMMS_CONTEXT="MPI"
65+
\$MPITRAMPOLINE_MPIEXEC -n $total_ranks -ppn $ranks_per_node $set_gpu_rank julia $exeflags --project=$experiment_dir $julia_filepath
66+
"""
6667

6768
julia_script = """\
6869
import ClimaCalibrate as CAL
@@ -88,6 +89,7 @@ function pbs_model_run(
8889
module_load_str;
8990
hpc_kwargs,
9091
debug = false,
92+
exeflags = "",
9193
)
9294
# Type and existence checks
9395
@assert isdir(output_dir) "Output directory does not exist: $output_dir"
@@ -106,6 +108,7 @@ function pbs_model_run(
106108
model_interface,
107109
module_load_str;
108110
hpc_kwargs,
111+
exeflags,
109112
)
110113
# TODO: Improve and figure out how to clean up the model_run.jl file
111114
# julia_filepath does not get cleaned up. `mktemp() do` syntax is ideal

test/pbs_unit_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module list
5555
export JULIA_MPI_HAS_CUDA=true
5656
export CLIMACOMMS_DEVICE="CUDA"
5757
export CLIMACOMMS_CONTEXT="MPI"
58-
\$MPITRAMPOLINE_MPIEXEC -n 4 -ppn 2 set_gpu_rank julia --project=exp/dir test/iteration_001/member_001/model_run.jl
58+
\$MPITRAMPOLINE_MPIEXEC -n 4 -ppn 2 set_gpu_rank julia --project=exp/dir test/iteration_001/member_001/model_run.jl
5959
"""
6060

6161
for (generated_str, test_str) in

0 commit comments

Comments
 (0)