Commit 9164669b authored by Patrick Godwin's avatar Patrick Godwin

gstlal_snax_dag_offline: skip jobs based on span of features generated, not...

gstlal_snax_dag_offline: skip jobs based on span of features generated, not total time. fix some formatting
parent fb731b77
...@@ -88,10 +88,16 @@ def feature_extractor_node_gen(feature_extractor_job, dag, parent_nodes, segsdic ...@@ -88,10 +88,16 @@ def feature_extractor_node_gen(feature_extractor_job, dag, parent_nodes, segsdic
# parallelize jobs by segments # parallelize jobs by segments
for seg in segsdict[ifo]: for seg in segsdict[ifo]:
# define analysis times
gps_start_time = int(seg[0])
feature_start_time = gps_start_time + options.psd_drop_time + max_template_length
feature_end_time = min(int(seg[1]), options.gps_end_time)
feature_seg = segments.segment(feature_start_time, feature_end_time)
# only produce jobs where the analysis runtime after applying segments is nonzero # only produce jobs where the analysis runtime after applying segments is nonzero
if not data_source_info.frame_segments[ifo].intersects_segment(seg): if not data_source_info.frame_segments[ifo].intersects_segment(feature_seg):
if options.verbose: if options.verbose:
print " Skipping segment (%d, %d) for channel subset %d since there is no analyzable data here" % (int(seg[0]), int(seg[1]), ii) print " Skipping segment (%d, %d) for channel subset %d since there is no analyzable data here" % (int(feature_seg[0]), int(feature_seg[1]), ii)
continue continue
# set maximum number of jobs reading concurrently from the same frame file to prevent I/O locks # set maximum number of jobs reading concurrently from the same frame file to prevent I/O locks
...@@ -108,36 +114,35 @@ def feature_extractor_node_gen(feature_extractor_job, dag, parent_nodes, segsdic ...@@ -108,36 +114,35 @@ def feature_extractor_node_gen(feature_extractor_job, dag, parent_nodes, segsdic
outpath = os.path.join(options.out_path, "gstlal_snax_extract") outpath = os.path.join(options.out_path, "gstlal_snax_extract")
# define analysis times
gps_start_time = int(seg[0])
feature_start_time = gps_start_time + options.psd_drop_time + max_template_length
feature_end_time = min(int(seg[1]), options.gps_end_time)
feature_extractor_nodes[(ii, seg)] = \ feature_extractor_nodes[(ii, seg)] = \
dagparts.DAGNode(feature_extractor_job, dag, parent_nodes = dep_nodes, dagparts.DAGNode(feature_extractor_job, dag, parent_nodes = dep_nodes,
opts = {"gps-start-time":gps_start_time, opts = {
"gps-end-time":feature_end_time, "gps-start-time": gps_start_time,
"feature-start-time":feature_start_time, "gps-end-time": feature_end_time,
"feature-end-time":feature_end_time, "feature-start-time": feature_start_time,
"data-source":"frames", "feature-end-time": feature_end_time,
"data-source": "frames",
"sample-rate": options.sample_rate, "sample-rate": options.sample_rate,
"mismatch":options.mismatch, "mismatch": options.mismatch,
"waveform":options.waveform, "waveform": options.waveform,
"qhigh":options.qhigh, "qhigh": options.qhigh,
"channel-name":' '.join(channels), "psd-fft-length": options.psd_fft_length,
"job-id":str(ii + 1).zfill(4), "channel-name": ' '.join(channels),
"cadence":options.cadence, "job-id": str(ii + 1).zfill(4),
"persist-cadence":options.persist_cadence, "cadence": options.cadence,
"max-streams":options.max_serial_streams, "persist-cadence": options.persist_cadence,
"disable-web-service":options.disable_web_service, "max-streams": options.max_serial_streams,
"local-frame-caching":options.local_frame_caching, "disable-web-service": options.disable_web_service,
"local-frame-caching": options.local_frame_caching,
"frame-segments-name": options.frame_segments_name, "frame-segments-name": options.frame_segments_name,
"save-format": options.save_format, "save-format": options.save_format,
"verbose":options.verbose "verbose": options.verbose
},
input_files = {
"frame-cache": options.frame_cache,
"frame-segments-file": options.frame_segments_file
}, },
input_files = {"frame-cache":options.frame_cache, output_files = {"out-path": outpath}
"frame-segments-file":options.frame_segments_file},
output_files = {"out-path":outpath}
) )
if options.verbose: if options.verbose:
print " Creating node for channel subset %d, gps range %d - %d" % (ii, feature_start_time, feature_end_time) print " Creating node for channel subset %d, gps range %d - %d" % (ii, feature_start_time, feature_end_time)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment