From bd058f881d5f11ff17a8bc4d945dd274ab1e23c8 Mon Sep 17 00:00:00 2001 From: Tanush Date: Wed, 19 Nov 2025 11:54:16 -0500 Subject: [PATCH 1/6] Updated template to not request GPU resources on CPU builds --- toolchain/templates/bridges2.mako | 3 ++- toolchain/templates/carpenter-cray.mako | 2 ++ toolchain/templates/carpenter.mako | 2 ++ toolchain/templates/default.mako | 2 ++ toolchain/templates/delta.mako | 3 ++- toolchain/templates/deltaai.mako | 3 ++- toolchain/templates/frontier.mako | 7 ++++--- toolchain/templates/hipergator.mako | 3 ++- toolchain/templates/nautilus.mako | 3 ++- toolchain/templates/oscar.mako | 3 ++- toolchain/templates/phoenix-bench.mako | 3 ++- toolchain/templates/phoenix.mako | 8 +++++++- toolchain/templates/santis.mako | 3 ++- toolchain/templates/summit.mako | 1 + 14 files changed, 34 insertions(+), 12 deletions(-) diff --git a/toolchain/templates/bridges2.mako b/toolchain/templates/bridges2.mako index 4536551943..bcf7ed6760 100644 --- a/toolchain/templates/bridges2.mako +++ b/toolchain/templates/bridges2.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} @@ -14,7 +15,7 @@ % if account: #SBATCH --account="${account}" % endif -% if gpu: +% if gpu != gpuConfigOptions.NONE.value: #SBATCH --gpu-bind=verbose,closest #SBATCH --gres=gpu:v100-16:${tasks_per_node} % endif diff --git a/toolchain/templates/carpenter-cray.mako b/toolchain/templates/carpenter-cray.mako index bfaad0b427..2fe33321c0 100644 --- a/toolchain/templates/carpenter-cray.mako +++ b/toolchain/templates/carpenter-cray.mako @@ -1,6 +1,8 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> + % if engine == 'batch': #PBS -l select=${nodes}:ncpus=192:mpiprocs=${tasks_per_node} diff --git a/toolchain/templates/carpenter.mako b/toolchain/templates/carpenter.mako index a652a887f7..e004ad8126 100644 --- a/toolchain/templates/carpenter.mako +++ b/toolchain/templates/carpenter.mako @@ -1,6 +1,8 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> + % if engine == 'batch': #PBS -l select=${nodes}:ncpus=192:mpiprocs=${tasks_per_node} diff --git a/toolchain/templates/default.mako b/toolchain/templates/default.mako index b1cdaf81e0..671586a612 100644 --- a/toolchain/templates/default.mako +++ b/toolchain/templates/default.mako @@ -2,6 +2,8 @@ import os from mako.exceptions import RuntimeException %> +<%! from mfc.state import gpuConfigOptions %> + % if os.name == 'nt': @echo off % else: diff --git a/toolchain/templates/delta.mako b/toolchain/templates/delta.mako index 694f22c457..4352f5db1a 100644 --- a/toolchain/templates/delta.mako +++ b/toolchain/templates/delta.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} @@ -14,7 +15,7 @@ % if account: #SBATCH --account="${account}" % endif -% if gpu: +% if gpu != gpuConfigOptions.NONE.value: #SBATCH --gpus-per-node=${tasks_per_node} #SBATCH --mem=208G #SBATCH --gpu-bind=closest diff --git a/toolchain/templates/deltaai.mako b/toolchain/templates/deltaai.mako index 8492aa7a06..b2a5d0c313 100644 --- a/toolchain/templates/deltaai.mako +++ b/toolchain/templates/deltaai.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} @@ -14,7 +15,7 @@ % if account: #SBATCH --account="${account}" % endif -% if gpu: +% if gpu != gpuConfigOptions.NONE.value: #SBATCH --gpus-per-node=${tasks_per_node} #SBATCH --mem=208G #SBATCH --gpu-bind=closest diff --git a/toolchain/templates/frontier.mako b/toolchain/templates/frontier.mako index b6d4a9a887..a39fbab34c 100644 --- a/toolchain/templates/frontier.mako +++ b/toolchain/templates/frontier.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} @@ -10,7 +11,7 @@ #SBATCH --time=${walltime} #SBATCH --cpus-per-task=7 #SBATCH -C nvme -% if gpu: +% if gpu != gpuConfigOptions.NONE.value: #SBATCH --gpus-per-task=1 #SBATCH --gpu-bind=closest % endif @@ -39,7 +40,7 @@ cd "${MFC_ROOT_DIR}" cd - > /dev/null echo -% if gpu: +% if gpu != gpuConfigOptions.NONE.value: export MPICH_GPU_SUPPORT_ENABLED=1 % else: export MPICH_GPU_SUPPORT_ENABLED=0 @@ -66,7 +67,7 @@ ulimit -s unlimited % if engine == 'interactive': --unbuffered --nodes ${nodes} --ntasks-per-node ${tasks_per_node} \ --cpus-per-task 7 \ - % if gpu: + % if gpu != gpuConfigOptions.NONE.value: --gpus-per-task 1 --gpu-bind closest \ % endif ${profiler} "${target.get_install_binpath(case)}") diff --git a/toolchain/templates/hipergator.mako b/toolchain/templates/hipergator.mako index 3de36fea5b..4dde15c726 100644 --- a/toolchain/templates/hipergator.mako +++ b/toolchain/templates/hipergator.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} @@ -9,7 +10,7 @@ #SBATCH --output="${name}.out" #SBATCH --time=${walltime} #SBATCH --cpus-per-task=7 -% if gpu: +% if gpu != gpuConfigOptions.NONE.value: #SBATCH --gpus-per-task=1 #SBATCH --gpu-bind=closest % endif diff --git a/toolchain/templates/nautilus.mako b/toolchain/templates/nautilus.mako index 5dfbdfdd84..a2525de5a4 100644 --- a/toolchain/templates/nautilus.mako +++ b/toolchain/templates/nautilus.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} @@ -14,7 +15,7 @@ % if account: #SBATCH --account="${account}" % endif -% if gpu: +% if gpu != gpuConfigOptions.NONE.value: #SBATCH --gpu-bind=verbose,closest #SBATCH --gres=gpu:v100-16:${tasks_per_node} % endif diff --git a/toolchain/templates/oscar.mako b/toolchain/templates/oscar.mako index 158a217cc1..75dd156c3c 100644 --- a/toolchain/templates/oscar.mako +++ b/toolchain/templates/oscar.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} @@ -14,7 +15,7 @@ % if account: #SBATCH --account="${account}" % endif -% if gpu: +% if gpu != gpuConfigOptions.NONE.value: #SBATCH --gpus-per-node=${tasks_per_node} #SBATCH --mem=64G #SBATCH --gpu-bind=closest diff --git a/toolchain/templates/phoenix-bench.mako b/toolchain/templates/phoenix-bench.mako index e699da3e4c..d43ba1e99d 100644 --- a/toolchain/templates/phoenix-bench.mako +++ b/toolchain/templates/phoenix-bench.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} @@ -17,7 +18,7 @@ % if quality_of_service: #SBATCH --qos=${quality_of_service} % endif -% if gpu: +% if gpu != gpuConfigOptions.NONE.value: #SBATCH --gres=gpu:V100:${tasks_per_node} #SBATCH --mem-per-gpu=16G\ % endif diff --git a/toolchain/templates/phoenix.mako b/toolchain/templates/phoenix.mako index e5e139905f..7928c960d7 100644 --- a/toolchain/templates/phoenix.mako +++ b/toolchain/templates/phoenix.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} @@ -17,7 +18,7 @@ % if quality_of_service: #SBATCH --qos=${quality_of_service} % endif -% if gpu: +% if gpu != gpuConfigOptions.NONE.value: #SBATCH --gres=gpu:V100:${tasks_per_node} #SBATCH --mem-per-gpu=16G\ % endif @@ -34,6 +35,11 @@ cd "${MFC_ROOT_DIR}" . ./mfc.sh load -c p -m ${'g' if gpu else 'c'} cd - > /dev/null echo +% if gpu != gpuConfigOptions.NONE.value: +echo "GPU active" +% else: +echo "CPU active" +% endif % for target in targets: ${helpers.run_prologue(target)} diff --git a/toolchain/templates/santis.mako b/toolchain/templates/santis.mako index cb4b330625..e89a05f685 100644 --- a/toolchain/templates/santis.mako +++ b/toolchain/templates/santis.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --uenv=icon/25.2:v1@santis @@ -74,7 +75,7 @@ echo --ntasks=${nodes*tasks_per_node} \ --cpus-per-task 72 \ --cpu-bind=none \ - % if gpu: + % if gpu != gpuConfigOptions.NONE.value: --gpus-per-task 1 \ % endif --wait 200 --bcast=/tmp/${target.name} \ diff --git a/toolchain/templates/summit.mako b/toolchain/templates/summit.mako index 1ca902b2b1..0753b28d77 100644 --- a/toolchain/templates/summit.mako +++ b/toolchain/templates/summit.mako @@ -1,6 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> +<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #BSUB -J {{{name}}} From 985a86177bbe0844868ef943954211c862ed5bf8 Mon Sep 17 00:00:00 2001 From: Tanush Date: Wed, 19 Nov 2025 11:59:39 -0500 Subject: [PATCH 2/6] Remove test code --- toolchain/templates/phoenix.mako | 5 ----- 1 file changed, 5 deletions(-) diff --git a/toolchain/templates/phoenix.mako b/toolchain/templates/phoenix.mako index 7928c960d7..6febe44aaa 100644 --- a/toolchain/templates/phoenix.mako +++ b/toolchain/templates/phoenix.mako @@ -35,11 +35,6 @@ cd "${MFC_ROOT_DIR}" . ./mfc.sh load -c p -m ${'g' if gpu else 'c'} cd - > /dev/null echo -% if gpu != gpuConfigOptions.NONE.value: -echo "GPU active" -% else: -echo "CPU active" -% endif % for target in targets: ${helpers.run_prologue(target)} From 3503f95fe369b76903c20ac5b44663988d11aaee Mon Sep 17 00:00:00 2001 From: Tanush Date: Wed, 19 Nov 2025 14:37:38 -0500 Subject: [PATCH 3/6] Fixed some issues and added abstraction variable --- toolchain/templates/bridges2.mako | 4 ++-- toolchain/templates/carpenter-cray.mako | 2 +- toolchain/templates/carpenter.mako | 2 +- toolchain/templates/default.mako | 2 +- toolchain/templates/delta.mako | 4 ++-- toolchain/templates/deltaai.mako | 4 ++-- toolchain/templates/frontier.mako | 8 ++++---- toolchain/templates/hipergator.mako | 4 ++-- toolchain/templates/include/helpers.mako | 1 + toolchain/templates/nautilus.mako | 4 ++-- toolchain/templates/oscar.mako | 4 ++-- toolchain/templates/phoenix-bench.mako | 4 ++-- toolchain/templates/phoenix.mako | 4 ++-- toolchain/templates/santis.mako | 4 ++-- toolchain/templates/summit.mako | 2 +- 15 files changed, 27 insertions(+), 26 deletions(-) diff --git a/toolchain/templates/bridges2.mako b/toolchain/templates/bridges2.mako index bcf7ed6760..5d7361190e 100644 --- a/toolchain/templates/bridges2.mako +++ b/toolchain/templates/bridges2.mako @@ -15,7 +15,7 @@ % if account: #SBATCH --account="${account}" % endif -% if gpu != gpuConfigOptions.NONE.value: +% if is_gpu_active: #SBATCH --gpu-bind=verbose,closest #SBATCH --gres=gpu:v100-16:${tasks_per_node} % endif @@ -32,7 +32,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" -. ./mfc.sh load -c b -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c b -m ${'g' if is_gpu_active else 'c'} cd - > /dev/null echo diff --git a/toolchain/templates/carpenter-cray.mako b/toolchain/templates/carpenter-cray.mako index 2fe33321c0..885b895228 100644 --- a/toolchain/templates/carpenter-cray.mako +++ b/toolchain/templates/carpenter-cray.mako @@ -27,7 +27,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" -. ./mfc.sh load -c cc -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c cc -m ${'g' if is_gpu_active else 'c'} cd - > /dev/null echo diff --git a/toolchain/templates/carpenter.mako b/toolchain/templates/carpenter.mako index e004ad8126..c291cb2634 100644 --- a/toolchain/templates/carpenter.mako +++ b/toolchain/templates/carpenter.mako @@ -27,7 +27,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" -. ./mfc.sh load -c c -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c c -m ${'g' if is_gpu_active else 'c'} cd - > /dev/null echo diff --git a/toolchain/templates/default.mako b/toolchain/templates/default.mako index 671586a612..f31be1d4f0 100644 --- a/toolchain/templates/default.mako +++ b/toolchain/templates/default.mako @@ -50,7 +50,7 @@ if engine == 'batch': (set -x; ${profiler} \ jsrun --nrs ${tasks_per_node*nodes} \ --cpu_per_rs 1 \ - --gpu_per_rs ${1 if gpu else 0} \ + --gpu_per_rs ${1 if is_gpu_active else 0} \ --tasks_per_rs 1 \ "${target.get_install_binpath(case)}") elif [ "$binary" == "srun" ]; then diff --git a/toolchain/templates/delta.mako b/toolchain/templates/delta.mako index 4352f5db1a..c9552650b7 100644 --- a/toolchain/templates/delta.mako +++ b/toolchain/templates/delta.mako @@ -15,7 +15,7 @@ % if account: #SBATCH --account="${account}" % endif -% if gpu != gpuConfigOptions.NONE.value: +% if is_gpu_active: #SBATCH --gpus-per-node=${tasks_per_node} #SBATCH --mem=208G #SBATCH --gpu-bind=closest @@ -33,7 +33,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" -. ./mfc.sh load -c d -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c d -m ${'g' if is_gpu_active else 'c'} cd - > /dev/null echo diff --git a/toolchain/templates/deltaai.mako b/toolchain/templates/deltaai.mako index b2a5d0c313..ae45ccbfd8 100644 --- a/toolchain/templates/deltaai.mako +++ b/toolchain/templates/deltaai.mako @@ -15,7 +15,7 @@ % if account: #SBATCH --account="${account}" % endif -% if gpu != gpuConfigOptions.NONE.value: +% if is_gpu_active: #SBATCH --gpus-per-node=${tasks_per_node} #SBATCH --mem=208G #SBATCH --gpu-bind=closest @@ -33,7 +33,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" -. ./mfc.sh load -c dai -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c dai -m ${'g' if is_gpu_active else 'c'} cd - > /dev/null echo diff --git a/toolchain/templates/frontier.mako b/toolchain/templates/frontier.mako index a39fbab34c..faea0c2ab4 100644 --- a/toolchain/templates/frontier.mako +++ b/toolchain/templates/frontier.mako @@ -11,7 +11,7 @@ #SBATCH --time=${walltime} #SBATCH --cpus-per-task=7 #SBATCH -C nvme -% if gpu != gpuConfigOptions.NONE.value: +% if is_gpu_active: #SBATCH --gpus-per-task=1 #SBATCH --gpu-bind=closest % endif @@ -35,12 +35,12 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" % if engine == 'batch': -. ./mfc.sh load -c f -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c f -m ${'g' if is_gpu_active else 'c'} % endif cd - > /dev/null echo -% if gpu != gpuConfigOptions.NONE.value: +% if is_gpu_active: export MPICH_GPU_SUPPORT_ENABLED=1 % else: export MPICH_GPU_SUPPORT_ENABLED=0 @@ -67,7 +67,7 @@ ulimit -s unlimited % if engine == 'interactive': --unbuffered --nodes ${nodes} --ntasks-per-node ${tasks_per_node} \ --cpus-per-task 7 \ - % if gpu != gpuConfigOptions.NONE.value: + % if is_gpu_active: --gpus-per-task 1 --gpu-bind closest \ % endif ${profiler} "${target.get_install_binpath(case)}") diff --git a/toolchain/templates/hipergator.mako b/toolchain/templates/hipergator.mako index 4dde15c726..95c2386047 100644 --- a/toolchain/templates/hipergator.mako +++ b/toolchain/templates/hipergator.mako @@ -10,7 +10,7 @@ #SBATCH --output="${name}.out" #SBATCH --time=${walltime} #SBATCH --cpus-per-task=7 -% if gpu != gpuConfigOptions.NONE.value: +% if is_gpu_active: #SBATCH --gpus-per-task=1 #SBATCH --gpu-bind=closest % endif @@ -36,7 +36,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" % if engine == 'batch': -. ./mfc.sh load -c h -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c h -m ${'g' if is_gpu_active else 'c'} % endif cd - > /dev/null echo diff --git a/toolchain/templates/include/helpers.mako b/toolchain/templates/include/helpers.mako index a4086ee381..91c6d99b48 100644 --- a/toolchain/templates/include/helpers.mako +++ b/toolchain/templates/include/helpers.mako @@ -1,5 +1,6 @@ <%! import os %> +<% is_gpu_active = (gpu != gpuConfigOptions.NONE.value) %> <%def name="template_prologue()"> % if os.name != 'nt': #> diff --git a/toolchain/templates/nautilus.mako b/toolchain/templates/nautilus.mako index a2525de5a4..c3688e6d4b 100644 --- a/toolchain/templates/nautilus.mako +++ b/toolchain/templates/nautilus.mako @@ -15,7 +15,7 @@ % if account: #SBATCH --account="${account}" % endif -% if gpu != gpuConfigOptions.NONE.value: +% if is_gpu_active: #SBATCH --gpu-bind=verbose,closest #SBATCH --gres=gpu:v100-16:${tasks_per_node} % endif @@ -32,7 +32,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" -. ./mfc.sh load -c n -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c n -m ${'g' if is_gpu_active else 'c'} cd - > /dev/null echo diff --git a/toolchain/templates/oscar.mako b/toolchain/templates/oscar.mako index 75dd156c3c..30f3e8f72b 100644 --- a/toolchain/templates/oscar.mako +++ b/toolchain/templates/oscar.mako @@ -15,7 +15,7 @@ % if account: #SBATCH --account="${account}" % endif -% if gpu != gpuConfigOptions.NONE.value: +% if is_gpu_active: #SBATCH --gpus-per-node=${tasks_per_node} #SBATCH --mem=64G #SBATCH --gpu-bind=closest @@ -33,7 +33,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOTDIR}" -. ./mfc.sh load -c o -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c o -m ${'g' if is_gpu_active else 'c'} cd - > /dev/null echo diff --git a/toolchain/templates/phoenix-bench.mako b/toolchain/templates/phoenix-bench.mako index d43ba1e99d..c70eb32c50 100644 --- a/toolchain/templates/phoenix-bench.mako +++ b/toolchain/templates/phoenix-bench.mako @@ -18,7 +18,7 @@ % if quality_of_service: #SBATCH --qos=${quality_of_service} % endif -% if gpu != gpuConfigOptions.NONE.value: +% if is_gpu_active: #SBATCH --gres=gpu:V100:${tasks_per_node} #SBATCH --mem-per-gpu=16G\ % endif @@ -32,7 +32,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" -. ./mfc.sh load -c p -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c p -m ${'g' if is_gpu_active else 'c'} cd - > /dev/null echo diff --git a/toolchain/templates/phoenix.mako b/toolchain/templates/phoenix.mako index 6febe44aaa..4cee3c6bcd 100644 --- a/toolchain/templates/phoenix.mako +++ b/toolchain/templates/phoenix.mako @@ -18,7 +18,7 @@ % if quality_of_service: #SBATCH --qos=${quality_of_service} % endif -% if gpu != gpuConfigOptions.NONE.value: +% if is_gpu_active: #SBATCH --gres=gpu:V100:${tasks_per_node} #SBATCH --mem-per-gpu=16G\ % endif @@ -32,7 +32,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" -. ./mfc.sh load -c p -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c p -m ${'g' if is_gpu_active else 'c'} cd - > /dev/null echo diff --git a/toolchain/templates/santis.mako b/toolchain/templates/santis.mako index e89a05f685..994696e081 100644 --- a/toolchain/templates/santis.mako +++ b/toolchain/templates/santis.mako @@ -60,7 +60,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" % if engine == 'batch': -. ./mfc.sh load -c san -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c san -m ${'g' if is_gpu_active else 'c'} % endif cd - > /dev/null echo @@ -75,7 +75,7 @@ echo --ntasks=${nodes*tasks_per_node} \ --cpus-per-task 72 \ --cpu-bind=none \ - % if gpu != gpuConfigOptions.NONE.value: + % if is_gpu_active: --gpus-per-task 1 \ % endif --wait 200 --bcast=/tmp/${target.name} \ diff --git a/toolchain/templates/summit.mako b/toolchain/templates/summit.mako index 0753b28d77..c9c40dcc09 100644 --- a/toolchain/templates/summit.mako +++ b/toolchain/templates/summit.mako @@ -17,7 +17,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" -. ./mfc.sh load -c s -m ${'g' if gpu else 'c'} +. ./mfc.sh load -c s -m ${'g' if is_gpu_active else 'c'} cd - > /dev/null echo From 90e5f366684f0ca7588c2a68fed43f982268e0b5 Mon Sep 17 00:00:00 2001 From: Tanush Date: Wed, 19 Nov 2025 14:42:08 -0500 Subject: [PATCH 4/6] Removed unneeded include --- toolchain/templates/bridges2.mako | 1 - toolchain/templates/carpenter-cray.mako | 2 -- toolchain/templates/carpenter.mako | 2 -- toolchain/templates/default.mako | 1 - toolchain/templates/delta.mako | 5 ++--- toolchain/templates/deltaai.mako | 1 - toolchain/templates/frontier.mako | 1 - toolchain/templates/hipergator.mako | 1 - toolchain/templates/include/helpers.mako | 5 ++++- toolchain/templates/nautilus.mako | 1 - toolchain/templates/oscar.mako | 1 - toolchain/templates/phoenix-bench.mako | 1 - toolchain/templates/phoenix.mako | 1 - toolchain/templates/santis.mako | 1 - toolchain/templates/summit.mako | 2 +- 15 files changed, 7 insertions(+), 19 deletions(-) diff --git a/toolchain/templates/bridges2.mako b/toolchain/templates/bridges2.mako index 5d7361190e..e64b637c1f 100644 --- a/toolchain/templates/bridges2.mako +++ b/toolchain/templates/bridges2.mako @@ -1,7 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} diff --git a/toolchain/templates/carpenter-cray.mako b/toolchain/templates/carpenter-cray.mako index 885b895228..44c2a5e974 100644 --- a/toolchain/templates/carpenter-cray.mako +++ b/toolchain/templates/carpenter-cray.mako @@ -1,8 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> - % if engine == 'batch': #PBS -l select=${nodes}:ncpus=192:mpiprocs=${tasks_per_node} diff --git a/toolchain/templates/carpenter.mako b/toolchain/templates/carpenter.mako index c291cb2634..242340d0a1 100644 --- a/toolchain/templates/carpenter.mako +++ b/toolchain/templates/carpenter.mako @@ -1,8 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> - % if engine == 'batch': #PBS -l select=${nodes}:ncpus=192:mpiprocs=${tasks_per_node} diff --git a/toolchain/templates/default.mako b/toolchain/templates/default.mako index f31be1d4f0..15ba06dd72 100644 --- a/toolchain/templates/default.mako +++ b/toolchain/templates/default.mako @@ -2,7 +2,6 @@ import os from mako.exceptions import RuntimeException %> -<%! from mfc.state import gpuConfigOptions %> % if os.name == 'nt': @echo off diff --git a/toolchain/templates/delta.mako b/toolchain/templates/delta.mako index c9552650b7..a2489e7345 100644 --- a/toolchain/templates/delta.mako +++ b/toolchain/templates/delta.mako @@ -1,7 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} @@ -15,7 +14,7 @@ % if account: #SBATCH --account="${account}" % endif -% if is_gpu_active: +% if gpu != gpuConfigOptions.NONE.value: #SBATCH --gpus-per-node=${tasks_per_node} #SBATCH --mem=208G #SBATCH --gpu-bind=closest @@ -33,7 +32,7 @@ ${helpers.template_prologue()} ok ":) Loading modules:\n" cd "${MFC_ROOT_DIR}" -. ./mfc.sh load -c d -m ${'g' if is_gpu_active else 'c'} +. ./mfc.sh load -c d -m ${'g' if gpu != gpuConfigOptions.NONE.value else 'c'} cd - > /dev/null echo diff --git a/toolchain/templates/deltaai.mako b/toolchain/templates/deltaai.mako index ae45ccbfd8..d098d201e1 100644 --- a/toolchain/templates/deltaai.mako +++ b/toolchain/templates/deltaai.mako @@ -1,7 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} diff --git a/toolchain/templates/frontier.mako b/toolchain/templates/frontier.mako index faea0c2ab4..e10398c191 100644 --- a/toolchain/templates/frontier.mako +++ b/toolchain/templates/frontier.mako @@ -1,7 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} diff --git a/toolchain/templates/hipergator.mako b/toolchain/templates/hipergator.mako index 95c2386047..3ed8e54529 100644 --- a/toolchain/templates/hipergator.mako +++ b/toolchain/templates/hipergator.mako @@ -1,7 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} diff --git a/toolchain/templates/include/helpers.mako b/toolchain/templates/include/helpers.mako index 91c6d99b48..6a32369c0c 100644 --- a/toolchain/templates/include/helpers.mako +++ b/toolchain/templates/include/helpers.mako @@ -1,6 +1,9 @@ -<%! import os %> +<%! import os + from mfc.state import gpuConfigOptions +%> <% is_gpu_active = (gpu != gpuConfigOptions.NONE.value) %> + <%def name="template_prologue()"> % if os.name != 'nt': #> diff --git a/toolchain/templates/nautilus.mako b/toolchain/templates/nautilus.mako index c3688e6d4b..00c8cd190d 100644 --- a/toolchain/templates/nautilus.mako +++ b/toolchain/templates/nautilus.mako @@ -1,7 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} diff --git a/toolchain/templates/oscar.mako b/toolchain/templates/oscar.mako index 30f3e8f72b..e0f99a4e97 100644 --- a/toolchain/templates/oscar.mako +++ b/toolchain/templates/oscar.mako @@ -1,7 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} diff --git a/toolchain/templates/phoenix-bench.mako b/toolchain/templates/phoenix-bench.mako index c70eb32c50..aee7db5445 100644 --- a/toolchain/templates/phoenix-bench.mako +++ b/toolchain/templates/phoenix-bench.mako @@ -1,7 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} diff --git a/toolchain/templates/phoenix.mako b/toolchain/templates/phoenix.mako index 4cee3c6bcd..a550140a45 100644 --- a/toolchain/templates/phoenix.mako +++ b/toolchain/templates/phoenix.mako @@ -1,7 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --nodes=${nodes} diff --git a/toolchain/templates/santis.mako b/toolchain/templates/santis.mako index 994696e081..a1b41ab2ef 100644 --- a/toolchain/templates/santis.mako +++ b/toolchain/templates/santis.mako @@ -1,7 +1,6 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> % if engine == 'batch': #SBATCH --uenv=icon/25.2:v1@santis diff --git a/toolchain/templates/summit.mako b/toolchain/templates/summit.mako index c9c40dcc09..a1e2ad24d4 100644 --- a/toolchain/templates/summit.mako +++ b/toolchain/templates/summit.mako @@ -1,7 +1,7 @@ #!/usr/bin/env bash <%namespace name="helpers" file="helpers.mako"/> -<%! from mfc.state import gpuConfigOptions %> + % if engine == 'batch': #BSUB -J {{{name}}} From 214ee17d5f9d9ee17f4892d1c308105a5fc89fcb Mon Sep 17 00:00:00 2001 From: Tanush Date: Wed, 19 Nov 2025 16:26:31 -0500 Subject: [PATCH 5/6] Fix indent on template --- toolchain/templates/include/helpers.mako | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toolchain/templates/include/helpers.mako b/toolchain/templates/include/helpers.mako index 6a32369c0c..0e57d63b3d 100644 --- a/toolchain/templates/include/helpers.mako +++ b/toolchain/templates/include/helpers.mako @@ -1,5 +1,6 @@ -<%! import os - from mfc.state import gpuConfigOptions +<%! +import os +from mfc.state import gpuConfigOptions %> <% is_gpu_active = (gpu != gpuConfigOptions.NONE.value) %> From e5315b2b93cc5a6f96f1c51f7e7755c7ec94d6a1 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Wed, 19 Nov 2025 18:39:04 -0500 Subject: [PATCH 6/6] Fix documentation comment in m_bubbles module --- src/simulation/m_bubbles.fpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulation/m_bubbles.fpp b/src/simulation/m_bubbles.fpp index 2bec7e1609..14c6ab472c 100644 --- a/src/simulation/m_bubbles.fpp +++ b/src/simulation/m_bubbles.fpp @@ -4,7 +4,7 @@ #:include 'macros.fpp' -!> @brief This module contains the procedures shared by the ensemble-averaged and volume-averaged bubble models. +!> @brief This module contains the procedures shared by ensemble-averaged and volume-averaged bubble models. module m_bubbles use m_derived_types !< Definitions of the derived types