-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdispatch.py
More file actions
25 lines (19 loc) · 810 Bytes
/
dispatch.py
File metadata and controls
25 lines (19 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import argparse
import subprocess
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('script', type=str)
parser.add_argument('training_script_args', nargs=argparse.REMAINDER)
return parser.parse_args()
def main():
args = parse_args()
name = args.script[:-3] + '_' + '_'.join(args.training_script_args)
out_file = name + '.out'
err_file = name + '.err'
cmd = ['bsub', '-env', 'LSB_CONTAINER_IMAGE=ibdgx001:5000/omri-20.02', '-q', 'waic-long',
'-gpu', 'num=1:j_exclusive=yes', '-R', 'rusage[mem=8192]', '-R', 'affinity[thread*8]',
'-app', 'nvidia-gpu', '-oo', out_file, '-eo', err_file, 'python', args.script] + args.training_script_args
print(' '.join(cmd))
subprocess.call(cmd)
if __name__ == '__main__':
main()