Skip to content
Snippets Groups Projects
Commit 096c7448 authored by Biljana Mitreska's avatar Biljana Mitreska
Browse files

update options for SciFi online

parent 6dd03dbc
No related branches found
No related tags found
2 merge requests!342updates from online alignment stack,!232Draft: Add test for SciFi alignment
Pipeline #5596000 passed
###############################################################################
# (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 DummyRunable
from Configurables import Online__AlgFlowManager as AlgFlowManager
from Configurables import HLTControlFlowMgr, EventLoopMgr
from pathlib import Path
from MooreOnlineConf.utils import (
alignment_options,
ensure_output_dir,
distribute_files,
)
application = GaudiOnline.Passthrough(
outputLevel=OnlineEnv.OutputLevel,
partitionName=OnlineEnv.PartitionName,
partitionID=OnlineEnv.PartitionID,
classType=GaudiOnline.Class1)
application.setup_fifolog()
online_options = alignment_options(OnlineEnv)
ensure_output_dir(online_options.analyzer_output_path, online_options.tag)
ensure_output_dir(online_options.iterator_output_path, online_options.tag)
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
]
files_per_node = distribute_files(online_options.nodes, files)
utgid = os.environ["UTGID"]
worker_id = utgid.split("_")[1]
try:
input_files = files_per_node[worker_id]
except KeyError:
# When testing we run multiple instances on the same node
# TODO this should probably be done based on the partition name
# and also "nodes" should be renamed to workers everywhere.
worker_id = utgid
input_files = files_per_node[worker_id]
# TODO handle case where input_files is empty (here and in iterator)
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]
from Configurables import Gaudi__Histograming__Sink__Root
from Configurables import HistogramPersistencySvc
from Configurables import AlignAlgorithm
from Configurables import LHCb__Det__LbDD4hep__DD4hepSvc as DD4hepSvc
Gaudi__Histograming__Sink__Root(
"Gaudi__Histograming__Sink__Root").FileName = str(
histofile.with_stem(histofile.stem + "_new"))
HistogramPersistencySvc().OutputFile = str(histofile)
AlignAlgorithm().OutputDataFile = str(derivfile)
DD4hepSvc().ConditionsOverlayInitPath = str(
online_options.iterator_output_path / "OverlayRoot")
# input_files = ['/scratch/rmatev/aligninputfiles/00146082_00000001_1.mdf']
# input_files = ['/scratch/rmatev/aligninputfiles2/Minbias_MagDown_Boole_lhcbhead3379_dddb-20220705_sim-20220705-vc-md100_lumi0.mdf']
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
application.config.enablePause = True
# 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 = 4
application.config.numStatusThreads = 1
application.config.FILE_maxEventsIn = 1000
application.app.Runable = DummyRunable()
application.app.TopAlg.insert(0, application.updateAndReset)
application.app.EvtSel = 'NONE'
application.app.EvtMax = -1
application.app.StopOnSignal = False # = default
application.app.StalledEventMonitoring = False # = default
EventLoopMgr().Warnings = False
......@@ -17,5 +17,5 @@ setup_options_path MONITORING
exec_gaudirun \
$MOOREONLINECONFROOT/options/verbosity.py \
$MOOREONLINECONFROOT/options/align_options.py \
$HUMBOLDTROOT/options/AlignVPHalvesModules_OfflineAnalyzer.py \
$MOOREONLINECONFROOT/options/align_analyzer.py
$HUMBOLDTROOT/options/AlignFTModules_Analyzer.py \
$MOOREONLINECONFROOT/options/align_analyzer_Tracker.py
......@@ -18,5 +18,5 @@ setup_options_path MONITORING
exec_gaudirun --application=Online::OnlineApplication \
$MOOREONLINECONFROOT/options/verbosity.py \
$MOOREONLINECONFROOT/options/align_options.py \
$HUMBOLDTROOT/options/AlignVPHalvesModules_Iterator.py \
$HUMBOLDTROOT/options/AlignFTModules_Iterator.py \
$MOOREONLINECONFROOT/options/align_iterator.py
......@@ -30,7 +30,7 @@ async def run(tasks, args):
# Write the alignment-specific options
with open("RunList.opts", "w") as f:
# dump_opts({"DeferredRuns": {"0000230000"}}, f)
dump_opts({"DeferredRuns": {"0000255623"}}, f)
dump_opts({"DeferredRuns": {"0000256145"}}, f)
with open("NodeList.opts", "w") as f:
# usually the NodeList would contain only the node name
# since we run one instance per node. When testing locally
......
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