-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_generic.py
39 lines (30 loc) · 1.07 KB
/
run_generic.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
from run_utils import *
import sys
import os
# root = '/mnt/qb/work/geiger/pghosh58/transfuser/test/poseconvgrut4l1'
# root = '/mnt/qb/work/geiger/pghosh58/transfuser/test/poseconvgru_diectt4l1'
root = os.getcwd()
cmd = [
f'cd {root}',
f'CUDA_VISIBLE_DEVICES={",".join([str(x) for x in range(int(sys.argv[1]))])} python {sys.argv[2]}',
f'mv $SLURM_JOB_ID.out out.txt',
f'mv $SLURM_JOB_ID.err err.txt',
]
with open(f'run.sh', 'w') as f:
f.write(slurm.format(sys.argv[1], f'{root}',f'{root}')+"\n".join(cmd))
os.system("chmod +x run.sh")
os.system(f'sbatch run.sh')
# i=0
# step = 10000
# while i < 150000:
# cmd = [
# f'cd {root}',
# f'CUDA_VISIBLE_DEVICES={",".join([str(x) for x in range(int(sys.argv[1]))])} python {sys.argv[2]} {i} {step}',
# f'mv $SLURM_JOB_ID.out out.txt',
# f'mv $SLURM_JOB_ID.err err.txt',
# ]
# i+=step
# with open(f'run.sh', 'w') as f:
# f.write(slurm.format(sys.argv[1], f'{root}',f'{root}')+"\n".join(cmd))
# os.system("chmod +x run.sh")
# os.system(f'sbatch run.sh')