Commit 11680bf9 authored by Sebastien Ponce's avatar Sebastien Ponce Committed by Charles Leggett
Browse files

Fixed handling of data dependencies in ToolHandles

parent a82fa2bb
......@@ -64,6 +64,7 @@ set(GaudiExamples_srcs
src/testing/*.cpp
src/IntelProfiler/*.cpp
src/PluginService/*.cpp
src/ToolHandles/*.cpp
)
# Add the sources requiring non-standard externals:
......
from Gaudi.Configuration import *
from Configurables import HiveWhiteBoard, HiveSlimEventLoopMgr, AvalancheSchedulerSvc
from Configurables import Gaudi__Examples__THDataProducer as THDataProducer
from Configurables import Gaudi__Examples__THDataProducer2 as THDataProducer2
from Configurables import Gaudi__Examples__THDataConsumer as THDataConsumer
# Application setup
whiteboard = HiveWhiteBoard("EventDataSvc", EventSlots=2)
slimeventloopmgr = HiveSlimEventLoopMgr(OutputLevel=INFO)
scheduler = AvalancheSchedulerSvc(ThreadPoolSize=2)
# - Algorithms
topalgs = [THDataProducer("THDataProducer"),
THDataProducer2("THDataProducer2"),
THDataConsumer("THDataConsumer")]
# Application manager
app = ApplicationMgr(EvtMax=4,
ExtSvc=[whiteboard],
EventLoop=slimeventloopmgr,
TopAlg=topalgs)
......@@ -40,13 +40,8 @@ StatusCode MyGaudiAlgorithm::initialize()
m_privateToolWithName = tool<IMyTool>( m_privateToolType, "ToolWithName", this );
m_privateOtherInterface = tool<IMyOtherTool>( "MyGaudiTool", this );
// force initialization of tool handles
if ( !( m_myPrivToolHandle.retrieve() && m_myConstToolHandle.retrieve() && m_myPubToolHandle.retrieve() &&
m_myCopiedConstToolHandle.retrieve() && m_myCopiedConstToolHandle2.retrieve() &&
m_myCopiedToolHandle.retrieve() && m_myGenericToolHandle.retrieve() ) ) {
error() << "Unable to retrive one of the ToolHandles" << endmsg;
return StatusCode::FAILURE;
}
// disable ToolHandle
m_myUnusedToolHandle.disable();
info() << m_tracks.objKey() << endmsg;
info() << m_hits.objKey() << endmsg;
......
#include "FloatTool.h"
#include <GaudiAlg/Consumer.h>
#include <GaudiAlg/Producer.h>
#include <GaudiKernel/AnyDataHandle.h>
#include <GaudiKernel/MsgStream.h>
namespace Gaudi
{
namespace Examples
{
using BaseClass_t = Gaudi::Functional::Traits::BaseClass_t<Algorithm>;
struct THDataProducer : Gaudi::Functional::Producer<int(), BaseClass_t> {
THDataProducer( const std::string& name, ISvcLocator* svcLoc )
: Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyInt" ) )
{
}
int operator()() const override
{
info() << "executing IntDataProducer, storing 7 into " << outputLocation() << endmsg;
return 7;
}
};
DECLARE_COMPONENT( THDataProducer )
struct THDataProducer2 : Gaudi::Functional::Producer<float(), BaseClass_t> {
THDataProducer2( const std::string& name, ISvcLocator* svcLoc )
: Producer( name, svcLoc, KeyValue( "OutputLocation", "/Event/MyFloat" ) )
{
}
float operator()() const override
{
info() << "executing IntDataProducer, storing 7.0 into " << outputLocation() << endmsg;
return 7.0;
}
};
DECLARE_COMPONENT( THDataProducer2 )
struct THDataConsumer : Gaudi::Functional::Consumer<void( const int& ), BaseClass_t> {
THDataConsumer( const std::string& name, ISvcLocator* svcLoc )
: Consumer( name, svcLoc, KeyValue( "InputLocation", "/Event/MyInt" ) )
{
}
void operator()( const int& input ) const override
{
info() << "executing IntDataConsumer, checking " << input << " from " << inputLocation() << " and "
<< m_floatTool->getFloat() << " from FloatTool are matching" << endmsg;
}
ToolHandle<FloatTool> m_floatTool{this, "FloatTool", "Gaudi::Examples::FloatTool"};
};
DECLARE_COMPONENT( THDataConsumer )
}
}
#include "FloatTool.h"
float Gaudi::Examples::FloatTool::getFloat() const { return *m_float.get(); }
DECLARE_COMPONENT( Gaudi::Examples::FloatTool )
#pragma once
#include "GaudiAlg/GaudiTool.h"
#include "GaudiKernel/AnyDataHandle.h"
namespace Gaudi
{
namespace Examples
{
struct FloatTool : public GaudiTool {
FloatTool( const std::string& type, const std::string& name, const IInterface* parent )
: GaudiTool( type, name, parent )
{
}
float getFloat() const;
AnyDataHandle<float> m_float{"/Event/MyFloat", Gaudi::DataHandle::Reader, this};
};
}
}
......@@ -11,30 +11,36 @@ ApplicationMgr(EvtMax=1).TopAlg.append(GaudiTesting__ListTools('ListTools'))
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="validator"><text>
import re
tools = [l.strip().split()[-1]
for l in stdout.splitlines()
if re.match(r'^ListTools +INFO \S+', l)]
tools.sort()
tools = set(l.strip().split()[-1]
for l in stdout.splitlines()
if re.match(r'^ListTools +INFO \S+', l))
expected = ['ToolSvc.MyTool',
'MyAlg.MyTool',
'ToolSvc.MyGaudiTool',
'MyAlg.MyGaudiTool',
'MyAlg.ToolWithName',
'MyGaudiAlg.MyTool',
'MyGaudiAlg.MyGaudiTool',
'MyGaudiAlg.ToolWithName',
'MyGaudiAlg.PrivToolHandle',
'ToolSvc.TestPubToolHandle',
'ToolSvc.GenericToolHandle',
'ToolSvc.ConstGenericToolHandle',
'ToolSvc.ToolA',
'ToolSvc.ToolB',
'ToolSvc.PubToolHandle'
]
expected.sort()
expected = set(['ToolSvc.MyTool',
'MyAlg.MyTool',
'ToolSvc.MyGaudiTool',
'MyAlg.MyGaudiTool',
'MyAlg.ToolWithName',
'MyGaudiAlg.LegacyToolHandle',
'MyGaudiAlg.MyTool',
'MyGaudiAlg.MyGaudiTool',
'MyGaudiAlg.ToolWithName',
'MyGaudiAlg.PrivToolHandle',
'ToolSvc.TestPubToolHandle',
'ToolSvc.GenericToolHandle',
'ToolSvc.ConstGenericToolHandle',
'ToolSvc.ToolA',
'ToolSvc.ToolB',
'ToolSvc.PubToolHandle'])
if tools != expected:
causes.append('list of tools')
missing = expected - tools
extra = tools - expected
if missing:
result['missing_tools'] = ('&lt;ul&gt;&lt;li&gt;{0}&lt;/li&gt;&lt;/ul&gt;'
.format('&lt;/li&gt;&lt;li&gt;'.join(sorted(missing))))
if extra:
result['extra_tools'] = ('&lt;ul&gt;&lt;li&gt;{0}&lt;/li&gt;&lt;/ul&gt;'
.format('&lt;/li&gt;&lt;li&gt;'.join(sorted(extra))))
</text></argument>
</extension>
<?xml version="1.0" ?><!DOCTYPE extension PUBLIC '-//QM/2.3/Extension//EN' 'http://www.codesourcery.com/qm/dtds/2.3/-//qm/2.3/extension//en.dtd'>
<extension class="GaudiTest.GaudiExeTest" kind="test">
<argument name="program"><text>gaudirun.py</text></argument>
<argument name="args"><set><text>$GAUDIEXAMPLESROOT/options/ToolHandles.py</text></set></argument>
<argument name="reference"><text>refs/ToolHandles.ref</text></argument>
</extension>
......@@ -147,39 +147,39 @@ MyAlg.ToolWithName INFO String = hundred
MyAlg.ToolWithName INFO Bool = 1
MyAlg DEBUG Registering tool MyAlg.ToolWithName
MyAlg DEBUG Registering tool MyAlg.MyGaudiTool
MyAlg INFO /Event/Rec/Tracks
MyAlg INFO /Event/Rec/Hits
MyAlg INFO /Rec/RAW
MyAlg INFO /Event/MyAnalysis/Tracks
MyAlg INFO ....initialization done
MyAlg DEBUG input handles: 3
MyAlg DEBUG output handles: 1
MyAlg.PrivToolH... DEBUG Property update for OutputLevel : new value = 2
MyAlg.PrivToolH... INFO intialize() has been called
MyAlg.PrivToolH... INFO Int = 100
MyAlg.PrivToolH... INFO Double = 100
MyAlg.PrivToolH... INFO String = hundred
MyAlg.PrivToolH... INFO Bool = 1
ToolSvc.ConstGe... INFO intialize() has been called
ToolSvc.ConstGe... INFO Int = 100
ToolSvc.ConstGe... INFO Double = 100
ToolSvc.ConstGe... INFO String = hundred
ToolSvc.ConstGe... INFO Bool = 1
MyAlg DEBUG Adding private ToolHandle tool MyAlg.PrivToolHandle (MyTool)
ToolSvc.PubTool... INFO intialize() has been called
ToolSvc.PubTool... INFO Int = 100
ToolSvc.PubTool... INFO Double = 100
ToolSvc.PubTool... INFO String = hundred
ToolSvc.PubTool... INFO Bool = 1
MyAlg DEBUG Adding public ToolHandle tool ToolSvc.PubToolHandle (MyTool)
ToolSvc.Generic... INFO intialize() has been called
ToolSvc.Generic... INFO Int = 100
ToolSvc.Generic... INFO Double = 100
ToolSvc.Generic... INFO String = hundred
ToolSvc.Generic... INFO Bool = 1
MyAlg INFO /Event/Rec/Tracks
MyAlg INFO /Event/Rec/Hits
MyAlg INFO /Rec/RAW
MyAlg INFO /Event/MyAnalysis/Tracks
MyAlg INFO ....initialization done
MyAlg DEBUG input handles: 3
MyAlg DEBUG output handles: 1
MyAlg DEBUG Adding private ToolHandle tool MyAlg.PrivToolHandle (MyTool)
MyAlg DEBUG Adding public ToolHandle tool ToolSvc.PubToolHandle (MyTool)
MyAlg DEBUG Adding public ToolHandle tool ToolSvc.GenericToolHandle (MyTool)
MyAlg DEBUG ToolHandle TestToolFailing/UnusedToolHandle not used
MyAlg DEBUG ToolHandle MyTool/LegacyToolHandle not used
MyAlg.LegacyToo... DEBUG Property update for OutputLevel : new value = 2
MyAlg.LegacyToo... INFO intialize() has been called
MyAlg.LegacyToo... INFO Int = 100
MyAlg.LegacyToo... INFO Double = 100
MyAlg.LegacyToo... INFO String = hundred
MyAlg.LegacyToo... INFO Bool = 1
MyAlg DEBUG Adding private ToolHandle tool MyAlg.LegacyToolHandle (MyTool)
MyAlg DEBUG Data Deps for MyAlg
+ INPUT ('/Event/Rec/Hits')
+ INPUT ('/Event/Rec/Tracks')
......@@ -270,6 +270,11 @@ MyAlg INFO tools created via ToolHandle<T>....
MyAlg.PrivToolH... INFO doIt() has been called
MyAlg.PrivToolH... DEBUG doIt() [DEBUG] has been called
ToolSvc.PubTool... INFO doIt() has been called
ToolSvc.ConstGe... INFO intialize() has been called
ToolSvc.ConstGe... INFO Int = 100
ToolSvc.ConstGe... INFO Double = 100
ToolSvc.ConstGe... INFO String = hundred
ToolSvc.ConstGe... INFO Bool = 1
ToolSvc.ConstGe... INFO doIt() has been called
MyAlg INFO tools copied assigned via ToolHandle<T>....
ToolSvc.PubTool... INFO doIt() has been called
......@@ -561,18 +566,20 @@ ToolSvc.ToolA DEBUG Releasing tool 'ToolSvc.ToolB'
ToolSvc.ToolA DEBUG De-Registering tool ToolSvc.ToolB
ToolSvc.ToolA DEBUG The tool 'ToolSvc.ToolB' of type 'TestTool' is released
ToolSvc.ToolA DEBUG Services to release :
MyAlg.LegacyToo... INFO finalize() has been called
ToolSvc.Generic... INFO finalize() has been called
MyAlg.PrivToolH... INFO finalize() has been called
ToolSvc.ConstGe... INFO finalize() has been called
MyAlg.PrivToolH... INFO finalize() has been called
ToolSvc.PubTool... INFO finalize() has been called
MyAlg.ToolWithName INFO destructor has been called
MyAlg.MyGaudiTool INFO destructor has been called
ToolSvc.MyGaudi... INFO destructor has been called
MyAlg.MyTool INFO destructor has been called
ToolSvc.MyTool INFO destructor has been called
MyAlg.LegacyToo... INFO destructor has been called
ToolSvc.Generic... INFO destructor has been called
MyAlg.PrivToolH... INFO destructor has been called
ToolSvc.ConstGe... INFO destructor has been called
MyAlg.PrivToolH... INFO destructor has been called
ToolSvc.PubTool... INFO destructor has been called
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
......@@ -56,36 +56,31 @@ MyGaudiAlg.Tool... INFO Int = 100
MyGaudiAlg.Tool... INFO Double = 100
MyGaudiAlg.Tool... INFO String = hundred
MyGaudiAlg.Tool... INFO Bool = 1
MyGaudiAlg INFO /Event/Rec/Tracks
MyGaudiAlg INFO /Event/Rec/Hits
MyGaudiAlg INFO /Rec/RAW
MyGaudiAlg INFO /Event/MyAnalysis/Tracks
MyGaudiAlg INFO ....initialization done
MyGaudiAlg.Priv... INFO intialize() has been called
MyGaudiAlg.Priv... INFO Int = 100
MyGaudiAlg.Priv... INFO Double = 100
MyGaudiAlg.Priv... INFO String = Is a private tool
MyGaudiAlg.Priv... INFO Bool = 1
ToolSvc.ConstGe... INFO intialize() has been called
ToolSvc.ConstGe... INFO Int = 100
ToolSvc.ConstGe... INFO Double = 100
ToolSvc.ConstGe... INFO String = hundred
ToolSvc.ConstGe... INFO Bool = 1
ToolSvc.TestPub... INFO intialize() has been called
ToolSvc.TestPub... INFO Int = 100
ToolSvc.TestPub... INFO Double = 100
ToolSvc.TestPub... INFO String = Is a public tool
ToolSvc.TestPub... INFO Bool = 1
ToolSvc.PubTool... INFO intialize() has been called
ToolSvc.PubTool... INFO Int = 100
ToolSvc.PubTool... INFO Double = 100
ToolSvc.PubTool... INFO String = hundred
ToolSvc.PubTool... INFO Bool = 1
ToolSvc.Generic... INFO intialize() has been called
ToolSvc.Generic... INFO Int = 100
ToolSvc.Generic... INFO Double = 100
ToolSvc.Generic... INFO String = hundred
ToolSvc.Generic... INFO Bool = 1
MyGaudiAlg INFO /Event/Rec/Tracks
MyGaudiAlg INFO /Event/Rec/Hits
MyGaudiAlg INFO /Rec/RAW
MyGaudiAlg INFO /Event/MyAnalysis/Tracks
MyGaudiAlg INFO ....initialization done
MyGaudiAlg.Lega... INFO intialize() has been called
MyGaudiAlg.Lega... INFO Int = 100
MyGaudiAlg.Lega... INFO Double = 100
MyGaudiAlg.Lega... INFO String = hundred
MyGaudiAlg.Lega... INFO Bool = 1
ToolSvc.ToolA DEBUG Property update for OutputLevel : new value = 2
ToolSvc.ToolA DEBUG Initialize
ToolSvc.ToolA DEBUG Initialize base class GaudiCommon<AlgTool>
......@@ -105,8 +100,6 @@ ToolSvc.ToolA DEBUG Property ['Name': Value] = 'TypePrint':True
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'StatPrint':True
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'PropertiesPrint':False
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ErrorsPrint':True
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraOutputs':[]
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraInputs':[]
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditRestart':False
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditReinitialize':False
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditFinalize':False
......@@ -116,6 +109,8 @@ ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditInitialize':False
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'AuditTools':False
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'OutputLevel':2
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraOutputs':[]
ToolSvc.ToolA DEBUG Property ['Name': Value] = 'ExtraInputs':[]
ToolSvc.ToolA DEBUG Loading tool ToolB of type TestTool
ToolSvc.ToolB DEBUG Property update for OutputLevel : new value = 2
ToolSvc.ToolB DEBUG Initialize
......@@ -136,8 +131,6 @@ ToolSvc.ToolB DEBUG Property ['Name': Value] = 'TypePrint':True
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'StatPrint':True
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'PropertiesPrint':False
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ErrorsPrint':True
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraOutputs':[]
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraInputs':[]
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditRestart':False
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditReinitialize':False
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditFinalize':False
......@@ -147,6 +140,8 @@ ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditInitialize':False
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'AuditTools':False
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'MonitorService':MonitorSvc
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'OutputLevel':2
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraOutputs':[]
ToolSvc.ToolB DEBUG Property ['Name': Value] = 'ExtraInputs':[]
ToolSvc.ToolB DEBUG Loading tool ToolA of type TestTool
ToolSvc.ToolB DEBUG Registering tool ToolSvc.ToolA
ToolSvc.ToolA DEBUG Registering tool ToolSvc.ToolB
......@@ -175,8 +170,18 @@ MyGaudiAlg.MyGa... INFO doItAgain() has been called
MyGaudiAlg INFO tools created via ToolHandle<T>....
MyGaudiAlg.Priv... INFO doIt() has been called
ToolSvc.TestPub... INFO doIt() has been called
ToolSvc.ConstGe... INFO intialize() has been called
ToolSvc.ConstGe... INFO Int = 100
ToolSvc.ConstGe... INFO Double = 100
ToolSvc.ConstGe... INFO String = hundred
ToolSvc.ConstGe... INFO Bool = 1
ToolSvc.ConstGe... INFO doIt() has been called
MyGaudiAlg INFO tools copied assigned via ToolHandle<T>....
ToolSvc.PubTool... INFO intialize() has been called
ToolSvc.PubTool... INFO Int = 100
ToolSvc.PubTool... INFO Double = 100
ToolSvc.PubTool... INFO String = hundred
ToolSvc.PubTool... INFO Bool = 1
ToolSvc.PubTool... INFO doIt() has been called
ToolSvc.PubTool... INFO doIt() has been called
ToolSvc.ConstGe... INFO doIt() has been called
......@@ -472,11 +477,12 @@ ToolSvc.ToolA DEBUG Releasing tool 'ToolSvc.ToolB'
ToolSvc.ToolA DEBUG De-Registering tool ToolSvc.ToolB
ToolSvc.ToolA DEBUG The tool 'ToolSvc.ToolB' of type 'TestTool' is released
ToolSvc.ToolA DEBUG Services to release :
MyGaudiAlg.Lega... INFO finalize() has been called
ToolSvc.Generic... INFO finalize() has been called
ToolSvc.PubTool... INFO finalize() has been called
ToolSvc.ConstGe... INFO finalize() has been called
ToolSvc.TestPub... INFO finalize() has been called
MyGaudiAlg.Priv... INFO finalize() has been called
ToolSvc.ConstGe... INFO finalize() has been called
MyGaudiAlg.Tool... INFO destructor has been called
MyGaudiAlg.MyGa... INFO destructor has been called
MyGaudiAlg.MyTool INFO destructor has been called
......@@ -485,10 +491,11 @@ MyAlg.MyGaudiTool INFO destructor has been called
MyAlg.MyTool INFO destructor has been called
ToolSvc.MyGaudi... INFO destructor has been called
ToolSvc.MyTool INFO destructor has been called
MyGaudiAlg.Lega... INFO destructor has been called
ToolSvc.Generic... INFO destructor has been called
ToolSvc.PubTool... INFO destructor has been called
ToolSvc.ConstGe... INFO destructor has been called
ToolSvc.TestPub... INFO destructor has been called
MyGaudiAlg.Priv... INFO destructor has been called
ToolSvc.ConstGe... INFO destructor has been called
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
# setting LC_ALL to "C"
# --> Including file '/var/local/sponce/native/Gaudi/GaudiExamples/options/ToolHandles.py'
# <-- End of file '/var/local/sponce/native/Gaudi/GaudiExamples/options/ToolHandles.py'
ApplicationMgr SUCCESS
====================================================================================================================================
Welcome to ApplicationMgr (GaudiCoreSvc v29r0)
running on lblhcbpr3.cern.ch on Mon Oct 9 17:05:27 2017
====================================================================================================================================
ApplicationMgr INFO Application Manager Configured successfully
ThreadPoolSvc INFO no thread init tools attached
AvalancheSchedu... INFO Activating scheduler in a separate thread
AvalancheSchedu... INFO Waiting for AvalancheSchedulerSvc to activate
AvalancheSchedu... INFO Start checking the actionsQueue
AlgResourcePool INFO TopAlg list empty. Recovering the one of Application Manager
AlgResourcePool INFO Algorithm THDataProducer is un-Clonable but Cardinality was set to 0. Only creating 1 instance
AlgResourcePool INFO Algorithm THDataProducer2 is un-Clonable but Cardinality was set to 0. Only creating 1 instance
AlgResourcePool INFO Algorithm THDataConsumer is un-Clonable but Cardinality was set to 0. Only creating 1 instance
PrecedenceSvc INFO Assembling CF and DF task precedence rules
PrecedenceSvc INFO PrecedenceSvc initialized successfully
AvalancheSchedu... INFO Found 3 algorithms
AvalancheSchedu... INFO Data Dependencies for Algorithms:
THDataProducer
o OUTPUT ('/Event/MyInt')
THDataProducer2
o OUTPUT ('/Event/MyFloat')
THDataConsumer
o INPUT ('/Event/MyFloat')
o INPUT ('/Event/MyInt')
AvalancheSchedu... INFO Concurrency level information:
AvalancheSchedu... INFO o Number of events in flight: 2
AvalancheSchedu... INFO o TBB thread pool size: 'ThreadPoolSize':2
HistogramPersis...WARNING Histograms saving not required.
HiveSlimEventLo... INFO Found 0 events in black list
ApplicationMgr INFO Application Manager Initialized successfully
ApplicationMgr INFO Application Manager Started successfully
HiveSlimEventLo... INFO Starting loop on events
EventSelector INFO End of event input reached.
HiveSlimEventLo... INFO No more events in event selection
HiveSlimEventLo... ERROR Detected nullptr ctxt before clearing WB!
HiveSlimEventLo... INFO ---> Loop Finished (skipping 1st evt) - WSS 52.5977 total time 113833
HiveSlimEventLo... INFO 0 events were SKIPed
ApplicationMgr INFO Application Manager Stopped successfully
HiveSlimEventLo... INFO Histograms converted successfully according to request.
AvalancheSchedu... INFO Joining Scheduler thread
AvalancheSchedu... INFO Terminating thread-pool resources
ToolSvc INFO Removing all tools created by ToolSvc
ApplicationMgr INFO Application Manager Finalized successfully
ApplicationMgr INFO Application Manager Terminated successfully
......@@ -81,6 +81,13 @@ public:
virtual std::string typeAndName() const = 0;
/// Helper to check if the ToolHandle should be retrieved.
inline bool enabled() const
{
// by convention, an empty type/name means that we do not use the tool
return !typeAndName().empty();
}
protected:
virtual const IAlgTool* getAsIAlgTool() const = 0;
......@@ -195,6 +202,13 @@ public:
return m_pToolSvc.initialize( "ToolSvc", GaudiHandleBase::parentName() );
}
/// Helper to declare that the ToolHandle should not retrieved.
inline void disable()
{
// by convention, an empty type/name means that we do not use the tool
GaudiHandleBase::setTypeAndName( "" );
}
/** Retrieve the AlgTool. Release existing tool if needed.
Function must be repeated here to avoid hiding the function retrieve( T*& ) */
StatusCode retrieve() const
......
......@@ -178,7 +178,13 @@ StatusCode Algorithm::sysInitialize()
if ( m_updateDataHandles ) acceptDHVisitor( m_updateDataHandles.get() );
// visit all sub-algs and tools, build full set
// visit all sub-algs and tools, build full set. First initialize ToolHandles if needed
try {
if ( !m_toolHandlesInit ) initToolHandles();
} catch ( const GaudiException& Exception ) {
error() << "Failing initializing ToolHandles : " << Exception << endmsg;
return StatusCode::FAILURE;
}
DHHVisitor avis( m_inputDataObjs, m_outputDataObjs );
acceptDHVisitor( &avis );
......@@ -905,15 +911,16 @@ void Algorithm::initToolHandles() const
}
for ( auto th : m_toolHandles ) {
tool = th->get();
if ( tool ) {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
debug() << "Adding " << ( th->isPublic() ? "public" : "private" ) << " ToolHandle tool " << tool->name() << " ("
<< tool->type() << ")" << endmsg;
m_tools.push_back( tool );
} else {
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) ) debug() << "ToolHandle " << th->typeAndName() << " not used" << endmsg;
// ignore *disabled* tool handles (i.e. empty type/name)
if ( !th->enabled() ) continue;
auto sc = th->retrieve( tool );
if ( UNLIKELY( sc.isFailure() ) ) {
throw GaudiException( "Failed to retrieve tool " + th->typeAndName(), this->name(), StatusCode::FAILURE );
}
if ( UNLIKELY( msgLevel( MSG::DEBUG ) ) )
debug() << "Adding " << ( th->isPublic() ? "public" : "private" ) << " ToolHandle tool " << tool->name() << " ("
<< tool->type() << ")" << endmsg;
m_tools.push_back( tool );
}
m_toolHandlesInit = true;
......
......@@ -59,7 +59,7 @@ def kill_tree(ppid, sig):
raise
log.debug('no such process %d', ppid)
#-------------------------------------------------------------------------#
# -------------------------------------------------------------------------#
class BaseTest(object):
......@@ -255,9 +255,9 @@ class BaseTest(object):
# print self.result.annotations.keys()
return dict(resultDict)
#-------------------------------------------------#
#----------------Validating tool------------------#
#-------------------------------------------------#
# -------------------------------------------------#
# ----------------Validating tool------------------#
# -------------------------------------------------#
def ValidateOutput(self, stdout, stderr, result):
if not self.stderr:
......@@ -302,7 +302,8 @@ class BaseTest(object):
len(reflines) - signature_offset]
if reflines != outlines:
msg = "standard output"
# I do not want 2 messages in causes if teh function is called twice
# I do not want 2 messages in causes if the function is called
# twice
if not msg in causes:
causes.append(msg)
result[res_field +
......@@ -554,7 +555,7 @@ except ImportError:
# dummy implementation
return False
#--------------------------------- TOOLS ---------------------------------#
# --------------------------------- TOOLS ---------------------------------#
def RationalizePath(p):
......@@ -591,10 +592,9 @@ def which(executable):
return None
#-------------------------------------------------------------------------#
#----------------------------- Result Classe -----------------------------#
#-------------------------------------------------------------------------#
# -------------------------------------------------------------------------#
# ----------------------------- Result Classe -----------------------------#
# -------------------------------------------------------------------------#
import types
......@@ -629,11 +629,13 @@ class Result:
return string
#-------------------------------------------------------------------------#
#--------------------------- Validator Classes ---------------------------#
#-------------------------------------------------------------------------#
# -------------------------------------------------------------------------#
# --------------------------- Validator Classes ---------------------------#
# -------------------------------------------------------------------------#
# Basic implementation of an option validator for Gaudi test. This implementation is based on the standard (LCG) validation functions used in QMTest.
# Basic implementation of an option validator for Gaudi test. This
# implementation is based on the standard (LCG) validation functions used
# in QMTest.