Skip to content

Commit 3503f95

Browse files
committed
Fixed some issues and added abstraction variable
1 parent 985a861 commit 3503f95

File tree

15 files changed

+27
-26
lines changed

15 files changed

+27
-26
lines changed

toolchain/templates/bridges2.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
% if account:
1616
#SBATCH --account="${account}"
1717
% endif
18-
% if gpu != gpuConfigOptions.NONE.value:
18+
% if is_gpu_active:
1919
#SBATCH --gpu-bind=verbose,closest
2020
#SBATCH --gres=gpu:v100-16:${tasks_per_node}
2121
% endif
@@ -32,7 +32,7 @@ ${helpers.template_prologue()}
3232

3333
ok ":) Loading modules:\n"
3434
cd "${MFC_ROOT_DIR}"
35-
. ./mfc.sh load -c b -m ${'g' if gpu else 'c'}
35+
. ./mfc.sh load -c b -m ${'g' if is_gpu_active else 'c'}
3636
cd - > /dev/null
3737
echo
3838

toolchain/templates/carpenter-cray.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ${helpers.template_prologue()}
2727

2828
ok ":) Loading modules:\n"
2929
cd "${MFC_ROOT_DIR}"
30-
. ./mfc.sh load -c cc -m ${'g' if gpu else 'c'}
30+
. ./mfc.sh load -c cc -m ${'g' if is_gpu_active else 'c'}
3131
cd - > /dev/null
3232
echo
3333

toolchain/templates/carpenter.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ${helpers.template_prologue()}
2727

2828
ok ":) Loading modules:\n"
2929
cd "${MFC_ROOT_DIR}"
30-
. ./mfc.sh load -c c -m ${'g' if gpu else 'c'}
30+
. ./mfc.sh load -c c -m ${'g' if is_gpu_active else 'c'}
3131
cd - > /dev/null
3232
echo
3333

toolchain/templates/default.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if engine == 'batch':
5050
(set -x; ${profiler} \
5151
jsrun --nrs ${tasks_per_node*nodes} \
5252
--cpu_per_rs 1 \
53-
--gpu_per_rs ${1 if gpu else 0} \
53+
--gpu_per_rs ${1 if is_gpu_active else 0} \
5454
--tasks_per_rs 1 \
5555
"${target.get_install_binpath(case)}")
5656
elif [ "$binary" == "srun" ]; then

toolchain/templates/delta.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
% if account:
1616
#SBATCH --account="${account}"
1717
% endif
18-
% if gpu != gpuConfigOptions.NONE.value:
18+
% if is_gpu_active:
1919
#SBATCH --gpus-per-node=${tasks_per_node}
2020
#SBATCH --mem=208G
2121
#SBATCH --gpu-bind=closest
@@ -33,7 +33,7 @@ ${helpers.template_prologue()}
3333

3434
ok ":) Loading modules:\n"
3535
cd "${MFC_ROOT_DIR}"
36-
. ./mfc.sh load -c d -m ${'g' if gpu else 'c'}
36+
. ./mfc.sh load -c d -m ${'g' if is_gpu_active else 'c'}
3737
cd - > /dev/null
3838
echo
3939

toolchain/templates/deltaai.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
% if account:
1616
#SBATCH --account="${account}"
1717
% endif
18-
% if gpu != gpuConfigOptions.NONE.value:
18+
% if is_gpu_active:
1919
#SBATCH --gpus-per-node=${tasks_per_node}
2020
#SBATCH --mem=208G
2121
#SBATCH --gpu-bind=closest
@@ -33,7 +33,7 @@ ${helpers.template_prologue()}
3333

3434
ok ":) Loading modules:\n"
3535
cd "${MFC_ROOT_DIR}"
36-
. ./mfc.sh load -c dai -m ${'g' if gpu else 'c'}
36+
. ./mfc.sh load -c dai -m ${'g' if is_gpu_active else 'c'}
3737
cd - > /dev/null
3838
echo
3939

toolchain/templates/frontier.mako

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#SBATCH --time=${walltime}
1212
#SBATCH --cpus-per-task=7
1313
#SBATCH -C nvme
14-
% if gpu != gpuConfigOptions.NONE.value:
14+
% if is_gpu_active:
1515
#SBATCH --gpus-per-task=1
1616
#SBATCH --gpu-bind=closest
1717
% endif
@@ -35,12 +35,12 @@ ${helpers.template_prologue()}
3535
ok ":) Loading modules:\n"
3636
cd "${MFC_ROOT_DIR}"
3737
% if engine == 'batch':
38-
. ./mfc.sh load -c f -m ${'g' if gpu else 'c'}
38+
. ./mfc.sh load -c f -m ${'g' if is_gpu_active else 'c'}
3939
% endif
4040
cd - > /dev/null
4141
echo
4242

43-
% if gpu != gpuConfigOptions.NONE.value:
43+
% if is_gpu_active:
4444
export MPICH_GPU_SUPPORT_ENABLED=1
4545
% else:
4646
export MPICH_GPU_SUPPORT_ENABLED=0
@@ -67,7 +67,7 @@ ulimit -s unlimited
6767
% if engine == 'interactive':
6868
--unbuffered --nodes ${nodes} --ntasks-per-node ${tasks_per_node} \
6969
--cpus-per-task 7 \
70-
% if gpu != gpuConfigOptions.NONE.value:
70+
% if is_gpu_active:
7171
--gpus-per-task 1 --gpu-bind closest \
7272
% endif
7373
${profiler} "${target.get_install_binpath(case)}")

toolchain/templates/hipergator.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#SBATCH --output="${name}.out"
1111
#SBATCH --time=${walltime}
1212
#SBATCH --cpus-per-task=7
13-
% if gpu != gpuConfigOptions.NONE.value:
13+
% if is_gpu_active:
1414
#SBATCH --gpus-per-task=1
1515
#SBATCH --gpu-bind=closest
1616
% endif
@@ -36,7 +36,7 @@ ${helpers.template_prologue()}
3636
ok ":) Loading modules:\n"
3737
cd "${MFC_ROOT_DIR}"
3838
% if engine == 'batch':
39-
. ./mfc.sh load -c h -m ${'g' if gpu else 'c'}
39+
. ./mfc.sh load -c h -m ${'g' if is_gpu_active else 'c'}
4040
% endif
4141
cd - > /dev/null
4242
echo

toolchain/templates/include/helpers.mako

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<%! import os %>
22
3+
<% is_gpu_active = (gpu != gpuConfigOptions.NONE.value) %>
34
<%def name="template_prologue()">
45
% if os.name != 'nt':
56
#>

toolchain/templates/nautilus.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
% if account:
1616
#SBATCH --account="${account}"
1717
% endif
18-
% if gpu != gpuConfigOptions.NONE.value:
18+
% if is_gpu_active:
1919
#SBATCH --gpu-bind=verbose,closest
2020
#SBATCH --gres=gpu:v100-16:${tasks_per_node}
2121
% endif
@@ -32,7 +32,7 @@ ${helpers.template_prologue()}
3232

3333
ok ":) Loading modules:\n"
3434
cd "${MFC_ROOT_DIR}"
35-
. ./mfc.sh load -c n -m ${'g' if gpu else 'c'}
35+
. ./mfc.sh load -c n -m ${'g' if is_gpu_active else 'c'}
3636
cd - > /dev/null
3737
echo
3838

0 commit comments

Comments
 (0)