From 2ffc1e1c29b5ff76269cb9f2306f2f5e2db64afb Mon Sep 17 00:00:00 2001
From: Patrick Godwin <patrick.godwin@ligo.org>
Date: Thu, 5 Jul 2018 11:27:57 -0500
Subject: [PATCH] add online feature extractor Makefile, update
 gstlal_feature_extractor_pipe_online to allow for connections to UWM O2
 replay to occur

---
 .../bin/gstlal_feature_extractor_pipe_online  | 11 ++-
 .../Makefile.gstlal_feature_extractor_online  | 89 +++++++++++++++++++
 2 files changed, 96 insertions(+), 4 deletions(-)
 create mode 100644 gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_online

diff --git a/gstlal-burst/bin/gstlal_feature_extractor_pipe_online b/gstlal-burst/bin/gstlal_feature_extractor_pipe_online
index ab94880f08..47f2773818 100755
--- a/gstlal-burst/bin/gstlal_feature_extractor_pipe_online
+++ b/gstlal-burst/bin/gstlal_feature_extractor_pipe_online
@@ -74,17 +74,20 @@ def feature_extractor_node_gen(gstlalFeatureExtractorJob, dag, parent_nodes, ifo
 
 		feature_extractor_nodes[ii] = \
 			inspiral_pipe.generic_node(gstlalFeatureExtractorJob, dag, parent_nodes = parent_nodes,
-				opts = {"data-source":"framexmit",
+				opts = {"mismatch":options.mismatch,
+					"shared-memory-partition": options.shared_memory_partition,
+					"shared-memory-assumed-duration": options.shared_memory_assumed_duration,
+					"data-source":"lvshm",
 					"mismatch":options.mismatch,
 					"waveform":options.waveform,
 					"qhigh":options.qhigh,
 					"max-streams":options.max_streams,
-					"channel-name":' '.join(channels),
 					"job-id":str(ii + 1).zfill(4),
 					"cadence":options.cadence,
 					"disable-web-service":options.disable_web_service,
 					"save-format": options.save_format,
-					"verbose":options.verbose
+					"verbose":options.verbose,
+					"channel-name":' '.join(channels)
 				},
 				output_files = {"out-path":outpath}
 			)
@@ -108,7 +111,7 @@ def parse_command_line():
 	parser.add_option("--disable-web-service", action = "store_true", help = "If set, disables web service that allows monitoring of PSDS of aux channels.")
 	parser.add_option("--description", metavar = "string", default = "GSTLAL_IDQ_FEATURES", help = "Set the filename description in which to save the output.")
 	parser.add_option("--save-format", action = "store_true", default = "hdf5", help = "Specifies the save format (ascii or hdf5) of features written to disk. Default = hdf5")
-	parser.add_option("--cadence", type = "int", default = 32, help = "Rate at which to write trigger files to disk. Default = 32 seconds.")
+	parser.add_option("--cadence", type = "int", default = 20, help = "Rate at which to write trigger files to disk. Default = 20 seconds.")
 	parser.add_option("-m", "--mismatch", type = "float", default = 0.05, help = "Mismatch between templates, mismatch = 1 - minimal match. Default = 0.05.")
 	parser.add_option("-q", "--qhigh", type = "float", default = 100, help = "Q high value for half sine-gaussian waveforms. Default = 100.")
 	parser.add_option("--waveform", metavar = "string", default = "sine_gaussian", help = "Specifies the waveform used for matched filtering. Possible options: (half_sine_gaussian, sine_gaussian). Default = half_sine_gaussian")
diff --git a/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_online b/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_online
new file mode 100644
index 0000000000..4a4378ef1a
--- /dev/null
+++ b/gstlal-burst/share/feature_extractor/Makefile.gstlal_feature_extractor_online
@@ -0,0 +1,89 @@
+SHELL := /bin/bash
+# condor commands
+# Set the accounting tag from https://ldas-gridmon.ligo.caltech.edu/ldg_accounting/user
+ACCOUNTING_TAG=ligo.dev.o3.detchar.onlinedq.idq
+GROUP_USER=patrick.godwin
+CONDOR_COMMANDS:=--condor-command=accounting_group=$(ACCOUNTING_TAG) --condor-command=accounting_group_user=$(GROUP_USER)
+
+#########################
+# Triggering parameters #
+#########################
+
+OUTPATH = $(PWD)
+
+# channel list for analysis
+CHANNEL_LIST = channel_list.txt 
+
+MAX_STREAMS = 200
+DATA_SOURCE = lvshm
+
+# Parameter space config of waveform
+WAVEFORM = sine_gaussian
+MISMATCH = 0.02
+QHIGH = 40
+
+# Detector
+CLUSTER:=$(shell hostname -d)
+
+IFO = H1
+#IFO = L1
+
+#################
+# Web directory #
+#################
+
+# A user tag for the run
+#TAG = O2_C00
+# Run number
+#RUN = run_1
+# A web directory for output (note difference between cit+uwm and Atlas)
+# cit & uwm
+#WEBDIR = ~/public_html/observing/$(TAG)/$(START)-$(STOP)-$(RUN)
+# Atlas
+#WEBDIR = ~/WWW/LSC/testing/$(TAG)/$(START)-$(STOP)-test_dag-$(RUN)
+
+############
+# Workflow #
+############
+
+all : dag
+	sed -i '/gstlal_feature_extractor / s/$$/ |& grep -v '\''XLAL\|GSL\|Generic'\''/' feature_extractor_pipe.sh
+	@echo "Submit with: condor_submit_dag feature_extractor_pipe.dag"
+
+# Run etg pipe to produce dag
+dag : plots $(CHANNEL_LIST)
+	gstlal_feature_extractor_pipe_online \
+		--data-source $(DATA_SOURCE) \
+		--channel-list $(CHANNEL_LIST) \
+		--out-path $(OUTPATH) \
+		--max-streams $(MAX_STREAMS) \
+		--mismatch $(MISMATCH) \
+		--qhigh $(QHIGH) \
+		$(CONDOR_COMMANDS) \
+		--shared-memory-partition H1=LHO_RedDtchr \
+		--shared-memory-assumed-duration 1 \
+		--cadence 20 \
+		--request-cpu 2 \
+		--request-memory 15GB \
+		--verbose \
+		--disable-web-service
+
+#		--web-dir $(WEBDIR) \
+
+# FIXME Determine channel list automatically.
+#full_channel_list.txt : frame.cache
+#	FrChannels $$(head -n 1 $^ | awk '{ print $$5}' | sed -e "s@file://localhost@@g") > $@
+
+# FIXME Add webpages once we have output
+# Make webpage directory and copy files across
+#$(WEBDIR) : $(MAKEFILE_LIST)
+#	mkdir -p $(WEBDIR)/OPEN-BOX
+#	cp $(MAKEFILE_LIST) $@
+
+# Makes local plots directory
+plots :
+	mkdir plots
+
+clean :
+	-rm -rvf *.sub *.dag* *.cache *.sh logs *.sqlite plots *.html Images *.css *.js
+
-- 
GitLab