Skip to content
Snippets Groups Projects
Commit 6b41209b authored by Ryan Everett's avatar Ryan Everett
Browse files

gstlal_inspiral: PR #2343 Create a checkpoint

parent 1e6b8d69
No related branches found
No related tags found
No related merge requests found
......@@ -178,6 +178,7 @@ import socket
import time
import tempfile
import math
import subprocess
from collections import namedtuple
# The following snippet is taken from http://gstreamer.freedesktop.org/wiki/FAQ#Mypygstprogramismysteriouslycoredumping.2Chowtofixthis.3F
......@@ -546,7 +547,22 @@ else:
#
for svd_bank, output_filename, likelihood_namedtuple in zip(svd_banks, options.output, likelihood_namedtuples_list):
for output_file_number, (svd_bank, output_filename, likelihood_namedtuple) in enumerate(zip(svd_banks, options.output, likelihood_namedtuples_list)):
#
# Checkpointing only supported for gzip files in offline analysis
# FIXME Is there a better way to check if a file is corrupted? Implement a means by which to check for sqlite file validity
#
if options.data_source not in ("lvshm", "framexmit") and output_filename.endswith('.gz'):
try:
subprocess.check_call(["gzip", "--test", output_filename])
# File is OK and there is no need to process it, skip ahead in the loop
continue
except subprocess.CalledProcessError:
# File does not exist or is corrupted, need to reprocess
print >>sys.stderr, "Checkpoint: {0} of {1} files completed and continuing with {2}".format(output_file_number, len(options.output), os.path.basename(output_filename))
pass
#
# create a new, empty, Bottle application and make it the current
# default, then start http server(s) to serve it up
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment