Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • lhcb/MooreOnline
1 result
Show changes
Commits on Source (11)
Showing
with 846 additions and 596 deletions
This diff is collapsed.
This diff is collapsed.
......@@ -51,7 +51,7 @@
|-root_ioalg_opts = {} (default: {})
|-scheduler_legacy_mode = True (default: True)
|-simulation = True (default: None)
|-write_decoding_keys_to_git = True (default: True)
|-write_decoding_keys_to_git = None
|-write_options_to_fsr = False (default: False)
|-write_streams_attributes_to_json = False (default: False)
|-xml_file_catalog = '' (default: '')
......
......@@ -51,7 +51,7 @@
|-root_ioalg_opts = {} (default: {})
|-scheduler_legacy_mode = True (default: True)
|-simulation = True (default: None)
|-write_decoding_keys_to_git = True (default: True)
|-write_decoding_keys_to_git = None
|-write_options_to_fsr = False (default: False)
|-write_streams_attributes_to_json = False (default: False)
|-xml_file_catalog = '' (default: '')
......
......@@ -51,7 +51,7 @@
|-root_ioalg_opts = {} (default: {})
|-scheduler_legacy_mode = True (default: True)
|-simulation = True (default: None)
|-write_decoding_keys_to_git = True (default: True)
|-write_decoding_keys_to_git = None
|-write_options_to_fsr = False (default: False)
|-write_streams_attributes_to_json = False (default: False)
|-xml_file_catalog = '' (default: '')
......
......@@ -13,8 +13,7 @@ import fifo_log
import GaudiOnline
import OnlineEnvBase as OnlineEnv
from Configurables import DummyRunable
from Configurables import Online__AlgFlowManager as AlgFlowManager
from Configurables import HLTControlFlowMgr, ExecutionReportsWriter, EventLoopMgr
from Configurables import EventLoopMgr
OnlineEnv.OutputLevel = 3
......@@ -31,19 +30,6 @@ fifo_log.logger_set_tag(OnlineEnv.PartitionName)
input_files = ['/scratch/shollitt/inputfiles/00146082_00000001_1.mdf']
application.setup_file_access(input_files)
# application.setup_hive(FlowManager("EventLoop"), 40) <- simple event loop
flow = AlgFlowManager("EventLoop")
application.setup_hive(flow, 44)
# HACK: transfer options from HLTControlFlowMgr
cfm = HLTControlFlowMgr('HLTControlFlowMgr')
flow.CompositeCFNodes = cfm.CompositeCFNodes
flow.BarrierAlgNames = cfm.BarrierAlgNames
# HACK: tell the HltDecReports creator to use the online scheduler
# only works because there is exactly one instance of ExecutionReportsWriter
ExecutionReportsWriter().Scheduler = flow
application.setup_monitoring()
application.monSvc.DimUpdateInterval = 1
......
......@@ -12,8 +12,7 @@ import os
import GaudiOnline
import OnlineEnvBase as OnlineEnv
from Configurables import DummyRunable
from Configurables import Online__AlgFlowManager as AlgFlowManager
from Configurables import HLTControlFlowMgr, EventLoopMgr
from Configurables import EventLoopMgr
from pathlib import Path
from MooreOnlineConf.utils import (
alignment_options,
......@@ -79,14 +78,6 @@ DD4hepSvc().UseConditionsOverlay = True
application.setup_file_access(input_files)
flow = AlgFlowManager("EventLoop")
application.app.EventLoop = flow
# HACK: transfer options from HLTControlFlowMgr
cfm = HLTControlFlowMgr('HLTControlFlowMgr')
flow.CompositeCFNodes = cfm.CompositeCFNodes
flow.BarrierAlgNames = cfm.BarrierAlgNames
application.setup_monitoring()
application.monSvc.DimUpdateInterval = 1
......
......@@ -12,8 +12,7 @@ import os
import GaudiOnline
import OnlineEnvBase as OnlineEnv
from Configurables import DummyRunable
from Configurables import Online__AlgFlowManager as AlgFlowManager
from Configurables import HLTControlFlowMgr, EventLoopMgr
from Configurables import EventLoopMgr
from pathlib import Path
from MooreOnlineConf.utils import (
alignment_options,
......@@ -32,10 +31,16 @@ online_options = alignment_options(OnlineEnv)
print(f"Will write analyzer output to {online_options.analyzer_output_path}")
INPUT_DATA_PATH = Path("/calib/align/LHCb/Tracker")
files = [
sorted((INPUT_DATA_PATH / run).iterdir()) for run in online_options.runs
]
if OnlineEnv.PartitionName == "LHCbA":
INPUT_DATA_PATH = Path("/calib/align/LHCb/Tracker")
files = [
sorted((INPUT_DATA_PATH / run).iterdir())
for run in online_options.runs
]
else:
INPUT_DATA_PATH = Path("input_data")
files = [sorted(INPUT_DATA_PATH.iterdir())]
files_per_node = distribute_files(online_options.nodes, files)
utgid = os.environ["UTGID"]
......@@ -55,6 +60,10 @@ derivfile = online_options.analyzer_output_path / f"derivatives-{worker_id}.out"
histofile = online_options.analyzer_output_path / f"histograms-{worker_id}.root"
input_files = [str(f) for f in input_files]
# FIXME: doing this with old-style configurables seriously violates the current configurables philosophy.
# it seems also bad design that we need to construct the filename twice: once for the analyser and once for the iterator.
# cannot we construct the names inside the alignment_options class, and pass them as options via Moore options?
from Configurables import Gaudi__Histograming__Sink__Root
from Configurables import HistogramPersistencySvc
from Configurables import AlignAlgorithm
......@@ -71,16 +80,6 @@ DD4hepSvc().UseConditionsOverlay = True
application.setup_file_access(input_files)
# application.setup_hive(FlowManager("EventLoop"), 40) <- simple event loop
flow = AlgFlowManager("EventLoop")
application.app.EventLoop = flow
# application.setup_hive(flow, 44)
# HACK: transfer options from HLTControlFlowMgr
cfm = HLTControlFlowMgr('HLTControlFlowMgr')
flow.CompositeCFNodes = cfm.CompositeCFNodes
flow.BarrierAlgNames = cfm.BarrierAlgNames
application.setup_monitoring()
application.monSvc.DimUpdateInterval = 1
......
......@@ -10,16 +10,37 @@
###############################################################################
import os
from Moore import options
from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc
options.input_type = 'Online'
options.dddb_tag = 'upgrade/master'
options.conddb_tag = 'upgrade/master'
options.geometry_version = "run3/trunk"
options.conditions_version = "master"
options.n_threads = 8
import OnlineEnvBase as OnlineEnv
options.input_type = 'Online'
options.output_type = 'Online'
options.geometry_version = OnlineEnv.DDDBTag
options.conditions_version = OnlineEnv.CondDBTag
if options.geometry_version == "master":
options.geometry_version = "run3/trunk"
options.simulation = False
online_cond_path = '/group/online/hlt/conditions.run3/lhcb-conditions-database'
if os.path.exists(online_cond_path):
from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc
DD4hepSvc().ConditionsLocation = 'file://' + online_cond_path
# make sure to set the Moore histogram path correctly
# FIXME: this way to retreive the worker_id may not work online.
# see the way it is currently set in align_analyzer(_Tracker).py
utgid = os.environ["UTGID"]
if utgid:
worker_id = utgid
from MooreOnlineConf.utils import alignment_options
online_options = alignment_options(OnlineEnv)
options.histo_file = str(online_options.analyzer_output_path /
f"histograms-{worker_id}_new.root")
#options.derivativefile = str(online_options.analyzer_output_path / f"derivatives-{worker_id}.out")
#options.ftmatcalibdatafile = str(online_options.analyzer_output_path / f"ftmatcalibdata-{worker_id}.out")
#
#print("histo_file name: ", options.histo_file)
#print("worker_id: ", worker_id)
#print("online_options.nodes: ", online_options.nodes)
###############################################################################
# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
import os
import GaudiOnline
import OnlineEnvBase as OnlineEnv
from Configurables import (
Online__OutputAlg as OutputAlg,
ApplicationMgr,
OnlMonitorSink,
HiveDataBrokerSvc,
HLTControlFlowMgr,
)
from Gaudi.Configuration import allConfigurables
task_type = os.getenv("TASK_TYPE", "GenericTask")
application = GaudiOnline.Passthrough(
outputLevel=OnlineEnv.OutputLevel,
partitionName=OnlineEnv.PartitionName,
partitionID=OnlineEnv.PartitionID,
classType=GaudiOnline.Class1)
application.setup_fifolog()
application.setup_mbm_access('Events', True)
for name, configurable in allConfigurables.items():
if isinstance(configurable, OutputAlg):
writer = application.setup_mbm_output(
'Output', name=configurable.name())
writer.MBM_maxConsumerWait = 10
writer.MBM_allocationSize = 1024 * 1024 # bytes
# Make sure we don't overwrite requests to publish histograms/counters
onl_sink = OnlMonitorSink()
# TODO make sure the default HistogramsToPublish=[] accepts everything and the lines below are not necessary
if not onl_sink.isPropertySet("HistogramsToPublish"):
onl_sink.HistogramsToPublish = [(".*", ".*")]
if not onl_sink.isPropertySet("CountersToPublish"):
onl_sink.CountersToPublish = [("Combiner", "# passed"),
("Prescaler", "#accept")]
if onl_sink not in ApplicationMgr().ExtSvc:
ApplicationMgr().ExtSvc.append(onl_sink)
application.setup_monitoring(task_type)
application.updateAndReset.saveHistograms = 1
application.updateAndReset.saveSetDir = "Savesets"
application.updateAndReset.saveSetFilePrefix = "PRMon"
# Never update the "bulk" DIM histogram service for HLT2 and monitoring tasks.
# (For HLT1 it has to be done since the adders rely on it)
application.monSvc.DimUpdateInterval = 1000000 # timer interval in seconds
application.monSvc.HistUpdateOnStop = False # do not update on stop
# prevent duplicated entries in the output...
application.monSvc.disableDeclareInfoHistos = True
application.updateAndReset.saverCycle = 300
# TODO we should remove update_and_reset from task python options
from MooreOnlineConf.utils import update_and_reset
uar_config = update_and_reset().configuration()
uar_algs = uar_config.apply()[0]
HiveDataBrokerSvc().DataProducers.extend(uar_algs)
HLTControlFlowMgr('HLTControlFlowMgr').PreambleAlgs = uar_algs
# TODO add histogram of number of executions and filter passed
n_instances = int(os.getenv("NBOFSLAVES", "0")) + 1
try:
n_threads = int(os.environ["NBOFTHREADS"])
# NBOFTHREADS is populated from the "-numthreads" argument in Arch.xml
except (KeyError, ValueError):
n_threads = 1
# Use execMode = 1 for multi-threaded (async_queued) mode and
# use 0 (default) for single-threaded (sync) mode, i.e. debugging.
application.config.execMode = 1
application.config.numEventThreads = n_threads
HLTControlFlowMgr().ThreadPoolSize = n_threads
# Enable controlling number of threads with a DIM command
application.config.numThreadSvcName = 'NumThreads'
event_store = allConfigurables["EventDataSvc"]
# Ensure enough event slots to "bridge" the short wait when
# switching event bursts.
event_store.EventSlots = max(
event_store.getProp("EventSlots"),
n_threads + max(int(0.25 * n_threads), 1))
# For monitoring tasks we use UserType=USER, i.e. the task may not see
# all events if it can't process fast enough. However, for testing we
# use "ONE" so that the reader does not keep on pumping events when
# they are not consumer (i.e. a debugger is attached).
input_mbm_user_type = "USER"
if OnlineEnv.PartitionName.startswith("TEST"):
input_mbm_user_type = "ONE"
application.config.MBM_numConnections = 1
application.config.MBM_numEventThreads = 1
# Special setting for PbPb:
# application.config.MBM_numEventThreads = 2
application.config.MBM_requests = [
'EvType=2;TriggerMask=0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF;' +
f'VetoMask=0,0,0,0;MaskType=ANY;UserType={input_mbm_user_type};' +
'Frequency=PERC;Perc=100.0'
]
from Configurables import LHCb__DetDesc__ReserveDetDescForEvent as reserveIOV
reserveIOV("reserveIOV").PreloadGeometry = False
application.config.expandTAE = True
#!/bin/bash
###############################################################################
# (c) Copyright 2000-2022 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source "$DIR/../setupTask.sh"
setup_options_path MONITORING
vp_options=$HUMBOLDTROOT/options/UseRetina.py
#first_run=$(grep DeferredRuns ${INFO_OPTIONS%OnlineEnv.opts}RunList.opts | grep -o '0000[0-9]*')
#settings=$(curl -sL http://rundb-internal.lbdaq.cern.ch/api/run/$first_run/ | jq -r '.triggerConfiguration')
settings=$(python -c 'import OnlineEnvBase; print(OnlineEnvBase.HLTType)')
echo "HLTTYPE $settings"
if [[ $settings == *"veloSP" ]]; then
echo "SciFi alignment: configuring VELO SP algorithms based on current trigger config $settings"
vp_options=
fi
exec_gaudirun \
$MOOREONLINECONFROOT/options/verbosity.py \
$vp_options \
$MOOREONLINECONFROOT/options/align_options.py \
$HUMBOLDTROOT/options/AlignFTMats_Analyzer.py \
$MOOREONLINECONFROOT/options/align_analyzer_Tracker.py
#!/bin/bash
###############################################################################
# (c) Copyright 2000-2021 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source "$DIR/../setupTask.sh"
set -x
setup_options_path MONITORING
exec_gaudirun --application=Online::OnlineApplication \
$MOOREONLINECONFROOT/options/verbosity.py \
$MOOREONLINECONFROOT/options/align_options.py \
$HUMBOLDTROOT/options/AlignFTMats_Iterator.py \
$MOOREONLINECONFROOT/options/align_iterator.py
#!/bin/bash
###############################################################################
# (c) Copyright 2000-2021 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
# #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization #
# or submit itself to any jurisdiction. #
###############################################################################
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
source "$DIR/setupTask.sh"
setup_options_path MONITORING
settings=$(python -c 'import OnlineEnvBase; print(OnlineEnvBase.HLTType)')
vp_options=$MOOREONLINECONFROOT/options/vp_retina_clusters.py
if [[ $settings == *"veloSP" ]]; then
echo "RecoMon: configuring VELO SP algorithms based on current trigger config $settings"
vp_options=$MOOREONLINECONFROOT/options/vp_veloSP.py
fi
exec_gaudirun \
$MOOREONLINECONFROOT/options/tags-OnlineEnv.py \
$MOOREONLINECONFROOT/options/verbosity.py \
$vp_options \
$MOOREONLINECONFROOT/options/reco.py \
$MOOREONLINECONFROOT/options/prtest.py
<!--
(c) Copyright 2021-2022 CERN for the benefit of the LHCb Collaboration
This software is distributed under the terms of the GNU General Public
Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING".
In applying this licence, CERN does not waive the privileges and immunities
granted to it by virtue of its status as an Intergovernmental Organization
or submit itself to any jurisdiction.
-->
<tasks_inventory>
<task name="MBM" user="${USER}" group="${GROUP}">
<command>${MOORESCRIPTSROOT}/scripts/runDFTask.sh</command>
<argument name="-type" value="${NAME}" />
<argument name="-runinfo" value="${RUNINFO}" />
<argument name="-options" value="${MOORESCRIPTSROOT}/options/MonMBM.opts" />
<argument name="-class" value="Class0" />
<fmcparam name="utgid" value="${PARTITION}_${NODE}_${NAME}_${INSTANCE}" />
<fmcparam name="define" value="BINARY_TAG=${BINARY_TAG}" />
<fmcparam name="define" value="WORKING_DIR=${WORKING_DIR}" />
<timeout action="Any" value="20" />
</task>
<task name="MDFProd" user="${USER}" group="${GROUP}">
<command>${MOORESCRIPTSROOT}/scripts/runDFTask.sh</command>
<argument name="-type" value="${NAME}" />
<argument name="-runinfo" value="${RUNINFO}" />
<argument name="-options" value="${MOORESCRIPTSROOT}/options/MDFProd.opts" />
<argument name="-class" value="Class2" />
<fmcparam name="utgid" value="${PARTITION}_${NODE}_${NAME}_${INSTANCE}" />
<fmcparam name="define" value="BINARY_TAG=${BINARY_TAG}" />
<fmcparam name="define" value="WORKING_DIR=${WORKING_DIR}" />
<timeout action="Any" value="30" />
</task>
<task name="RecoPhysMon" user="${USER}" group="${GROUP}" instances="NUMBER_OF_INSTANCES">
<command>${MOORESCRIPTSROOT}/job/runRecoMonPR.sh</command>
<argument name="-type" value="${NAME}" />
<argument name="-runinfo" value="${RUNINFO}" />
<argument name="-class" value="Class1" />
<fmcparam name="utgid" value="${PARTITION}_${NODE}_${NAME}_${INSTANCE}" />
<fmcparam name="define" value="BINARY_TAG=${BINARY_TAG}" />
<fmcparam name="define" value="WORKING_DIR=${WORKING_DIR}" />
<timeout action="Any" value="120" />
<timeout action="load" value="20" />
</task>
</tasks_inventory>