Skip to content

Instantly share code, notes, and snippets.

@wtbarnes
Created August 27, 2015 18:16
Show Gist options
  • Save wtbarnes/dd074d2eab30a71cdeec to your computer and use it in GitHub Desktop.
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
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