-
Notifications
You must be signed in to change notification settings - Fork 2
/
submit.py
49 lines (38 loc) · 1.09 KB
/
submit.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import os
import click
import time
from two_peptides.status import submitted, is_finished
TEST = False
DRYRUN = False
submit_stub = lambda a,b: (
f"sbatch "
f"-J sim_{a}_{b} -o log/sim_{a}_{b}.log "
f"--time 24:00:00 -p gpu --gres gpu:1 --mem 8GB "
f"--exclude gpu[100-130],gpu064,gpu066,gpu077 "
f"two_peptides run -a {a} -b {b} "
)
def submit(a,b):
command = submit_stub(a, b)
if TEST:
command += "--test"
if not (is_finished(a, b) or is_finished(b, a)):
if DRYRUN:
print(command)
else:
print(a, b)
os.system(command)
time.sleep(0.5)
@click.command()
@click.option("--many/--no-many", default=False)
@click.option("-a", "--aminoacids1", default=None)
@click.option("-b", "--aminoacids2", default=None)
def main(many, aminoacids1, aminoacids2):
if many:
to_submit = submitted()
else:
assert aminoacids1 is not None and aminoacids2 is not None
to_submit = ((aminoacids1, aminoacids2), )
for a, b in to_submit:
submit(a, b)
if __name__ == "__main__":
main()