Skip to content

Commit

Permalink
Use larger process groups to speed up sim
Browse files Browse the repository at this point in the history
  • Loading branch information
keskitalo committed Oct 7, 2024
1 parent 1edbcc0 commit ea70433
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
9 changes: 5 additions & 4 deletions chile_optimization_sims/phase1/sims/run.sat.mfhf.slurm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#SBATCH --qos=regular
#SBATCH --time=01:00:00
#SBATCH --nodes=4
#SBATCH --nodes=8
#SBATCH --job-name=CMBS4_phase1
#SBATCH --licenses=SCRATCH
#SBATCH --constraint=cpu
Expand All @@ -18,15 +18,15 @@ export HDF5_USE_FILE_LOCKING=FALSE
export TOAST_FUNCTIME=1

# Parallelization
export OMP_NUM_THREADS=8
export OMP_NUM_THREADS=2
export OMP_PLACES=threads
export OMP_PROC_BIND=spread
let nnode=$SLURM_JOB_NUM_NODES
# 128 cores, 258 hardware threads
let ntask_node=256/$OMP_NUM_THREADS
let ntask=$nnode*$ntask_node
let ncore=$OMP_NUM_THREADS
let groupsize=1
let groupsize=8

echo "Start: " `date`
echo "Running with"
Expand Down Expand Up @@ -62,7 +62,7 @@ for band in f085 f095 f145 f155 f220 f280; do
# args+=" --thinfp 16"
;;
f220|f280)
fpfile=../focalplanes/focalplane_SAT1_SAT_${band}_ST1.h5
fpfile=../focalplanes/focalplane_SAT1_SAT_${band}_ST2.h5
pwv_limit=2.0
# args+=" --thinfp 16"
;;
Expand Down Expand Up @@ -93,6 +93,7 @@ for band in f085 f095 f145 f155 f220 f280; do
echo "${args[@]}"
srun -N $nnode -n $ntask -c $ncore --cpu_bind=cores \
toast_sim_ground.py ${args[@]} \
--binner.sync_type "allreduce" \
>& $logfile

exit
Expand Down
39 changes: 20 additions & 19 deletions chile_optimization_sims/phase1/sims/scale_maps.sat.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# f_weather from the simulation logs on 10/07/2024

cut_3mm = 1 - 903 / 5157
cut_2mm = None
cut_2mm = 1 - 1525 / 5157
f_weather_sim["sat"] = {
"f030" : cut_3mm,
"f040" : cut_3mm,
Expand All @@ -84,19 +84,20 @@

# Number of telescope years is a parameter

ntube_lf = 3
ntube_mf = 9
ntube_hf = 6
nsat = 9
ntube_lf = nsat // 3
ntube_mf = nsat
ntube_hf = nsat // 3 * 2
nyear = 10
n_years = {
"f030" : [nyear * ntube_lf],
"f040" : [nyear * ntube_lf],
"f085" : [nyear * ntube_mf],
"f095" : [nyear * ntube_mf],
"f145" : [nyear * ntube_mf],
"f155" : [nyear * ntube_mf],
"f220" : [nyear * ntube_hf],
"f280" : [nyear * ntube_hf],
"f030" : nyear * ntube_lf,
"f040" : nyear * ntube_lf,
"f085" : nyear * ntube_mf,
"f095" : nyear * ntube_mf,
"f145" : nyear * ntube_mf,
"f155" : nyear * ntube_mf,
"f220" : nyear * ntube_hf,
"f280" : nyear * ntube_hf,
}


Expand All @@ -105,7 +106,7 @@
for flavor in "sat",:
nrow, ncol = 2, 4
fig = plt.figure(figsize=[4 * ncol, 4 * nrow])
fig.suptitle(f"{flavor} {n_year} years")
fig.suptitle(f"{flavor}, {nsat * 3} tubes")
iplot = 0
for band in f_total[flavor].keys():
fname_in = f"outputs/{flavor}/{band}/mapmaker_cov.fits"
Expand Down Expand Up @@ -169,17 +170,17 @@
depth,
min=vmin,
max=vmax,
title=band,
title=f"{band}, {n_year} tube years",
sub=[nrow, ncol, iplot],
cmap="inferno",
unit="$\mu$K.arcmin",
xsize=1600,
format="%.3f"
)

# Save plot
# Save plot

os.makedirs("plots", exist_ok=True)
fname_plot = f"plots/{flavor}_{n_year}years.png"
fig.savefig(fname_plot)
print(f"Plot saved in {fname_plot}")
os.makedirs("plots", exist_ok=True)
fname_plot = f"plots/{flavor}.png"
fig.savefig(fname_plot)
print(f"Plot saved in {fname_plot}")

0 comments on commit ea70433

Please sign in to comment.