Skip to content

Commit 5d6f9ae

Browse files
committed
fix ups on formatting and some defaults
1 parent 831a8ca commit 5d6f9ae

File tree

5 files changed

+14
-50
lines changed

5 files changed

+14
-50
lines changed

toolchain/mfc/args.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def add_common_arguments(p: argparse.ArgumentParser, mask = None):
5959
if "m" not in mask:
6060
for f in dataclasses.fields(config):
6161
if f.name == 'gpu':
62-
p.add_argument(f"--{f.name}", action="store", nargs='?', const= gpuConfigOptions.ACC.value,default=gpuConfigOptions.ACC.value, dest=f.name, choices=[e.value for e in gpuConfigOptions], help=f"Turn the {f.name} option to OpenACC or OpenMP.")
62+
p.add_argument(f"--{f.name}", action="store", nargs='?', const= gpuConfigOptions.ACC.value,default=gpuConfigOptions.NONE.value, dest=f.name, choices=[e.value for e in gpuConfigOptions], help=f"Turn the {f.name} option to OpenACC or OpenMP.")
6363
p.add_argument(f"--no-{f.name}", action="store_const", const = gpuConfigOptions.NONE.value, dest=f.name, help=f"Turn the {f.name} option OFF.")
6464
continue
6565
p.add_argument( f"--{f.name}", action="store_true", help=f"Turn the {f.name} option ON.")

toolchain/mfc/run/run.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,17 @@ def __generate_job_script(targets, case: input.MFCInputFile):
101101

102102
# Compute GPU mode booleans for templates
103103
gpu_mode = ARG('gpu')
104-
gpu_enabled = (gpu_mode != gpuConfigOptions.NONE.value)
105-
gpu_acc = (gpu_mode == gpuConfigOptions.ACC.value)
106-
gpu_mp = (gpu_mode == gpuConfigOptions.MP.value)
104+
105+
# Validate gpu_mode is one of the expected values
106+
valid_gpu_modes = {e.value for e in gpuConfigOptions}
107+
if gpu_mode not in valid_gpu_modes:
108+
raise MFCException(
109+
f"Invalid GPU mode '{gpu_mode}'. Must be one of: {', '.join(sorted(valid_gpu_modes))}"
110+
)
111+
112+
gpu_enabled = gpu_mode != gpuConfigOptions.NONE.value
113+
gpu_acc = gpu_mode == gpuConfigOptions.ACC.value
114+
gpu_mp = gpu_mode == gpuConfigOptions.MP.value
107115

108116
content = __get_template().render(
109117
**{**ARGS(), 'targets': targets},

toolchain/templates/frontier.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ echo
4545
export MPICH_GPU_SUPPORT_ENABLED=0
4646
% endif
4747

48-
%if unified:
48+
% if unified:
4949
export CRAY_ACC_USE_UNIFIED_MEM=1
5050
% endif
5151

toolchain/templates/phoenix.mako

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
% endif
2020
% if gpu_enabled:
2121
#SBATCH --gres=gpu:V100:${tasks_per_node}
22-
#SBATCH --mem-per-gpu=16G\
22+
#SBATCH --mem-per-gpu=16G
2323
% endif
2424
% if email:
2525
#SBATCH --mail-user=${email}

toolchain/templates/summit.mako

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)