Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding gres handling for teach #259

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/crc_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def parse_args(self, args=None, namespace=None) -> Namespace:

# Set defaults that need to be determined dynamically
if not args.num_gpus:
args.num_gpus = 1 if args.gpu else 0
args.num_gpus = 1 if (args.gpu or (args.teach and (args.partition == 'gpu'))) else 0

# Check wall time is between limits, enable both %H:%M format and integer hours
check_time = args.time.hour + args.time.minute / 60 + args.time.second / 3600
Expand Down Expand Up @@ -171,7 +171,7 @@ def create_srun_command(self, args: Namespace) -> str:
srun_args += ' ' + srun_arg_name.format(arg_value)

# The --gres argument in srun needs some special handling so is missing from the above dict
if (args.gpu or args.invest) and args.num_gpus:
if (args.gpu or args.invest or (args.teach and (args.partition == 'gpu'))) and args.num_gpus:
srun_args += ' ' + f'--gres=gpu:{args.num_gpus}'

try:
Expand Down