15 lines
472 B
Python
15 lines
472 B
Python
import subprocess as sp
|
|
|
|
USER = 'ignis'
|
|
|
|
idlist = sp.check_output('squeue -h -u {} -o "%i"'.format(USER), shell=True).split()
|
|
|
|
foamBanner='F ield | OpenFOAM: The Open Source CFD Toolbox'
|
|
|
|
for sid in idlist:
|
|
a = sp.check_output('scontrol show job {}'.format(sid), shell=True).split()
|
|
d = {aa.split("=")[0]: aa.split("=")[-1] for aa in a}
|
|
|
|
with open(d["StdOut"]) as logfile:
|
|
if logfile.read().find(foamBanner) >= 0:
|
|
print d["StdOut"]
|