-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_job.py
More file actions
24 lines (19 loc) · 754 Bytes
/
Copy pathrun_job.py
File metadata and controls
24 lines (19 loc) · 754 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
import os
# Loop through seed directories from seed1 to seed10
for seed_num in range(1, 21):
seed_dir = f'seed{seed_num}'
# Check if the directory exists
if os.path.isdir(seed_dir):
job_script = os.path.join(seed_dir, 'job.sh')
# Check if job.sh exists in the directory
if os.path.isfile(job_script):
# Change the working directory to the subdirectory
os.chdir(seed_dir)
# Use os.system to submit the job using qsub
os.system('qsub job.sh')
# Return to the parent directory
os.chdir('..')
else:
print(f'job.sh not found in {seed_dir}')
else:
print(f'{seed_dir} not found')