diff --git a/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py b/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py index 020c5bc6c32fbb072d2474dda063f28cbab5abe7..6d7a9a50d8d675ff3a3dcbd0c2bfae14ad19cf60 100755 --- a/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py +++ b/HLT/Trigger/TrigControl/TrigCommon/bin/athenaHLT.py @@ -337,9 +337,6 @@ def main(): if not args.concurrent_events: args.concurrent_events = args.threads - if args.nprocs > 1 and not args.oh_monitoring: - parser.error('You have to run with -M/--oh-monitoring in case of multiple child processes') - # Update args and set athena flags update_run_params(args) set_athena_flags(args) diff --git a/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h b/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h index acf48e2d2aec0b253bf2fa2773acdf3c83e92b0c..d377f6c1df3be26f5db19179b0387abf69283577 100644 --- a/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h +++ b/HLT/Trigger/TrigControl/TrigServices/TrigServices/HltEventLoopMgr.h @@ -48,6 +48,8 @@ class IScheduler; class ITHistSvc; class StoreGateSvc; class TrigCOOLUpdateHelper; +class IIoComponentMgr; + namespace coral { class AttributeList; } @@ -174,6 +176,7 @@ private: ServiceHandle<ITHistSvc> m_THistSvc; ServiceHandle<IEvtSelector> m_evtSelector; ServiceHandle<IConversionSvc> m_outputCnvSvc; + ServiceHandle<IIoComponentMgr> m_ioCompMgr; /// Reference to the Whiteboard interface SmartIF<IHiveWhiteBoard> m_whiteboard; diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx index b54826c4a053c9e39e7ef1f4ad35721b7a09b139..986e063f4b95241a50338f2525dea5c448c9ab4f 100644 --- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx +++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx @@ -32,12 +32,16 @@ #include "GaudiKernel/IProperty.h" #include "GaudiKernel/IScheduler.h" #include "GaudiKernel/ITHistSvc.h" +#include "GaudiKernel/IIoComponentMgr.h" #include "GaudiKernel/ThreadLocalContext.h" // TDAQ includes #include "eformat/StreamTag.h" #include "owl/time.h" +// Boost includes +#include <boost/filesystem.hpp> + // System includes #include <sstream> @@ -79,6 +83,7 @@ HltEventLoopMgr::HltEventLoopMgr(const std::string& name, ISvcLocator* svcLoc) m_THistSvc("THistSvc", name), m_evtSelector("EvtSel", name), m_outputCnvSvc("OutputCnvSvc", name), + m_ioCompMgr("IoComponentMgr", name), m_coolHelper("TrigCOOLUpdateHelper", this), m_hltResultMaker("HLTResultMTMaker", this), m_detector_mask(0xffffffff, 0xffffffff, 0, 0), @@ -256,23 +261,16 @@ StatusCode HltEventLoopMgr::initialize() //---------------------------------------------------------------------------- // Initialise services //---------------------------------------------------------------------------- - //IncidentSvc ATH_CHECK(m_incidentSvc.retrieve()); - //StoreGateSvc ATH_CHECK(m_evtStore.retrieve()); - // DetectorStore ATH_CHECK(m_detectorStore.retrieve()); - // InputMetaDataStore ATH_CHECK(m_inputMetaDataStore.retrieve()); - // ROBDataProviderSvc ATH_CHECK(m_robDataProviderSvc.retrieve()); - // Histogram Service ATH_CHECK(m_THistSvc.retrieve()); - // Event Selector (also create an EvtSelectorContext) ATH_CHECK(m_evtSelector.retrieve()); - ATH_CHECK(m_evtSelector->createContext(m_evtSelContext)); - // Output Conversion Service + ATH_CHECK(m_evtSelector->createContext(m_evtSelContext)); // create an EvtSelectorContext ATH_CHECK(m_outputCnvSvc.retrieve()); + ATH_CHECK(m_ioCompMgr.retrieve()); //---------------------------------------------------------------------------- // Initialise tools @@ -504,6 +502,8 @@ StatusCode HltEventLoopMgr::prepareForRun(const ptree& pt) return StatusCode::SUCCESS; */ + ATH_CHECK(m_ioCompMgr->io_finalize()); // close any open files (e.g. THistSvc) + ATH_MSG_VERBOSE("end of " << __FUNCTION__); return StatusCode::SUCCESS; } @@ -531,6 +531,9 @@ StatusCode HltEventLoopMgr::hltUpdateAfterFork(const ptree& /*pt*/) { ATH_MSG_VERBOSE("start of " << __FUNCTION__); + updateDFProps(); + ATH_MSG_INFO("Post-fork initialization for " << m_applicationName.value()); + ATH_MSG_DEBUG("Initialising the scheduler after forking"); m_schedulerSvc = serviceLocator()->service(m_schedulerName, /*createIf=*/ true); if ( !m_schedulerSvc.isValid()){ @@ -550,6 +553,17 @@ StatusCode HltEventLoopMgr::hltUpdateAfterFork(const ptree& /*pt*/) ATH_REPORT_MESSAGE(MSG::WARNING) << "Could not retrieve CoreDumpSvc"; } + // Make sure output files, i.e. histograms are written to their own directory. + // Nothing happens if the online TrigMonTHistSvc is used as there are no output files. + boost::filesystem::path worker_dir = boost::filesystem::absolute("athenaHLT_workers"); + worker_dir /= m_applicationName.value(); + if ( !boost::filesystem::create_directories(worker_dir) ) { + ATH_MSG_ERROR("Cannot create worker directory " << worker_dir); + return StatusCode::FAILURE; + } + ATH_CHECK(m_ioCompMgr->io_update_all(worker_dir.string())); + ATH_CHECK(m_ioCompMgr->io_reinitialize()); + // Start the timeout thread ATH_MSG_DEBUG("Starting the timeout thread"); m_timeoutThread.reset(new std::thread(std::bind(&HltEventLoopMgr::runEventTimer,this)));