Created
August 27, 2015 18:16
-
-
Save wtbarnes/dd074d2eab30a71cdeec to your computer and use it in GitHub Desktop.
python script for checking many SLURM job output files to make sure all EBTEL runs were successful
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import os | |
#get all slurm output files in home directory | |
files = glob.glob(os.environ['HOME']+"/slurm-*.out") | |
for f in files: | |
out_file = open(f) | |
lines = out_file.readlines() | |
if lines[-1].split(' ')[1] != "process" and lines[0][0] != '*': | |
print "Bad file found: %s" % (f) | |
os.system("tail "+f) | |
out_file.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment