-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckTimeout.py
More file actions
32 lines (22 loc) · 835 Bytes
/
CheckTimeout.py
File metadata and controls
32 lines (22 loc) · 835 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
26
27
28
29
30
31
32
import os
import glob
base_dir = os.getcwd()
for root, dirs, files in os.walk('.', topdown=False):
for dir in dirs:
dirPath = os.path.join(root,dir)
AbsDirPath = os.path.abspath(dirPath)
os.chdir(AbsDirPath)
if 'slurm' in str(os.listdir(AbsDirPath)):
slurmFile = glob.glob('slurm-*')
if len(slurmFile) > 1:
print('\n')
print("Multiple Slurm File Exist!")
print(AbsDirPath)
print('\n')
f = open(slurmFile[0], 'r')
filecontents = f.readlines()
f.close()
if len(filecontents) > 0:
if "DUE TO TIME LIMIT" in filecontents[0]:
print(AbsDirPath)
os.chdir(base_dir)