Skip to content

Commit

Permalink
add easy interrupting sweeps
Browse files Browse the repository at this point in the history
  • Loading branch information
csinva committed Feb 1, 2023
1 parent 5b98a60 commit dee492d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/submit_utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from typing import Any, Dict, List, Tuple

import itertools
import os
import subprocess
import random
from functools import reduce
"""Handles utilities for submission.
"""Handles utilities for job sweeps.
This file probably does not need to be edited.
"""

Expand Down Expand Up @@ -50,7 +50,11 @@ def run_args_list(
f'\n\n-------------------{i + 1}/{len(args_list)}--------------------\n', param_str)
try:
if actually_run:
os.system(param_str)
# os.system(param_str)
sts = subprocess.Popen(param_str, shell=True).wait()
except KeyboardInterrupt:
print('Keyboard interrupt, exiting...')
exit(0)
except Exception as e:
print(e)

Expand Down Expand Up @@ -116,3 +120,4 @@ def _validate_arguments(
for k in k_tup:
assert not k in params_shared_dict, f"params_coupled_dict key {k} should not be in params_shared_dict"


0 comments on commit dee492d

Please sign in to comment.