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
  • holau/Gaudi
  • dmagdali/Gaudi
  • pmunozpa/Gaudi
  • ssottoco/Gaudi
  • cvarni/Gaudi
  • mafila/Gaudi
  • admorris/Gaudi
  • staider/Gaudi
  • gunther/Gaudi
  • bstanisl/Gaudi
  • jtorasso/Gaudi
  • wochung/Gaudi
  • mveghel/Gaudi
  • averbyts/Gaudi
  • dguest/Gaudi
  • alboyer/Gaudi
  • dkonst/Gaudi
  • jcarcell/Gaudi
  • elmsheus/Gaudi
  • hpxgaudi/Gaudi
  • ganis/Gaudi
  • tadej/Gaudi
  • hahansen/Gaudi
  • juesseiv/Gaudi
  • imjelde/gaudida
  • jheuel/Gaudi
  • mimazure/Gaudi
  • masato/Gaudi
  • dcasperfaser/Gaudi
  • faser/offline/Gaudi
  • axu/Gaudi
  • sailer/Gaudi
  • amete/Gaudi
  • ponyisi/Gaudi
  • vavolkl/Gaudi
  • mstahl/Gaudi
  • wlampl/Gaudi
  • kreczko/Gaudi
  • emoyse/Gaudi
  • dhynds/Gaudi
  • sstahl/Gaudi
  • rcurrie/Gaudi
  • smh/Gaudi
  • valassi/Gaudi
  • bwynne/Gaudi_gaudi
  • abarton/Gaudi
  • tsulaia/gaudigaudi
  • mnowak/Gaudi
  • roiser/Gaudi
  • merrenst/Gaudi
  • mato/Gaudi
  • christos/Gaudi
  • goetz/Gaudi
  • goetz/AtlasGaudi
  • tsulaia/atlasgaudi
  • olupton/Gaudi
  • pseyfert/Gaudi
  • graemes/Gaudi
  • gianelle/Gaudi
  • akraszna/AtlasGaudi
  • cattanem/Gaudi
  • skluth/Gaudi
  • will/Gaudi
  • ssnyder/Gaudi
  • agonzale/Gaudi
  • leggett/AtlasGaudi
  • apearce/Gaudi
  • mnowak/Gaudi-ORIG
  • fwinkl/AtlasGaudi
  • bwynne/Gaudi_atlas
  • chamont/Gaudi
  • rmatev/Gaudi
  • lhcb/Gaudi
  • atlas/Gaudi
  • akraszna/GaudiGaudi
  • fwinkl/Gaudi
  • jonrob/Gaudi
  • azaborow/Gaudi
  • clemenci/Gaudi
  • hgraslan/Gaudi
  • srimanob/Gaudi
  • graven/Gaudi
  • hegner/Gaudi
  • gaudi/Gaudi
84 results
Show changes
Commits on Source (20)
Showing
with 335 additions and 298 deletions
......@@ -111,19 +111,20 @@ StatusCode AlgExecStateSvc::finalize() { return StatusCode::SUCCESS; }
void AlgExecStateSvc::dump( std::ostringstream& ost, const EventContext& ctx ) const
{
size_t slotID = ctx.valid() ? ctx.slot() : 0;
ost << "Event: " << trans( m_eventStatus.at( ctx.slot() ) ) << std::endl;
ost << "Algs: " << m_algStates.at( ctx.slot() ).size() << std::endl;
ost << "Event: " << trans( m_eventStatus.at( slotID ) ) << std::endl;
ost << "Algs: " << m_algStates.at( slotID ).size() << std::endl;
size_t ml( 0 );
for ( auto& e : m_algStates.at( ctx.slot() ) ) {
for ( auto& e : m_algStates.at( slotID ) ) {
if ( e.first.str().length() > ml ) {
ml = e.first.str().length();
}
}
ost << " - Slot " << ctx.slot() << std::endl;
const AlgStateMap_t& m = m_algStates.at( ctx.slot() );
ost << " - Slot " << slotID << std::endl;
const AlgStateMap_t& m = m_algStates.at( slotID );
for ( auto& e : m ) {
ost << " + " << std::setw( ml ) << e.first.str() << " " << e.second << std::endl;
}
......
......@@ -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:
......
#
# Write a DST and a miniDST, including File Summary Records
#
from Gaudi.Configuration import *
from Configurables import Gaudi__Examples__IntDataProducer as IntDataProducer
from Configurables import Gaudi__Examples__FloatDataConsumer as FloatDataConsumer
from Configurables import Gaudi__Examples__IntDataConsumer as IntDataConsumer
from Configurables import Gaudi__Examples__IntToFloatData as IntToFloatData
from Configurables import Gaudi__Examples__IntIntToFloatFloatData as IntIntToFloatFloatData
from Configurables import TimelineSvc
# Application setup
app = ApplicationMgr()
# - Algorithms
OtherIntDataProducer = IntDataProducer('OtherIntDataProducer')
OtherIntDataProducer.OutputLocation = "/Event/MyOtherInt"
app.TopAlg = [IntDataProducer("IntDataProducer"),
OtherIntDataProducer,
IntDataConsumer("IntDataConsumer"),
IntToFloatData("IntToFloatData"),
IntIntToFloatFloatData("IntIntToFloatFloatData"),
FloatDataConsumer("FloatDataConsumer")]
# - Events
app.EvtMax = 2
app.EvtSel = "NONE"
app.HistogramPersistency = "NONE"
# - Activate timeline service
TimelineSvc(RecordTimeline=True,
DumpTimeline=True, TimelineFile='myTimeline.csv')
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>
......@@ -9,4 +9,7 @@
countErrorLines({"ERROR":0})
</text></argument>
<argument name="use_temp_dir"><enumeral>true</enumeral></argument>
<argument name="prerequisites"><set>
<tuple><text>gaudiexamples.multi_input.prepare_base</text><enumeral>PASS</enumeral></tuple>
</set></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/Timeline.py</text></set></argument>
<argument name="reference"><text>refs/Timeline.ref</text></argument>
<argument name="validator"><text>
# Default validation, but validating the timeline file rather that the output
preproc = (normalizeExamples +
RegexpReplacer(r'^[0-9]+ [0-9]+ ([^ ]+) [0-9]+', r'- - \1 -'))
validateWithReference(stdout=open('myTimeline.csv').read(), stderr='', preproc=preproc)
</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
#start end algorithm thread slot event
1507020228941760205 1507020228941796115 IntDataProducer 140475789195072 0 0
1507020228941828266 1507020228941843443 OtherIntDataProducer 140475789195072 0 0
1507020228941844596 1507020228941872611 IntDataConsumer 140475789195072 0 0
1507020228941873976 1507020228941888747 IntToFloatData 140475789195072 0 0
1507020228941889911 1507020228941927914 IntIntToFloatFloatData 140475789195072 0 0
1507020228941931910 1507020228941970116 FloatDataConsumer 140475789195072 0 0
1507020228941989890 1507020228942002113 IntDataProducer 140475789195072 0 1
1507020228942003236 1507020228942012775 OtherIntDataProducer 140475789195072 0 1
1507020228942013531 1507020228942022577 IntDataConsumer 140475789195072 0 1
1507020228942031498 1507020228942042679 IntToFloatData 140475789195072 0 1
1507020228942043588 1507020228942066924 IntIntToFloatFloatData 140475789195072 0 1
1507020228942067876 1507020228942082076 FloatDataConsumer 140475789195072 0 1
# 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
......@@ -302,8 +302,8 @@ StatusCode AvalancheSchedulerSvc::initialize()
SmartIF<IMessageSvc> messageSvc( serviceLocator() );
if ( !messageSvc.isValid() ) error() << "Error retrieving MessageSvc interface IMessageSvc." << endmsg;
m_eventSlots.assign( m_maxEventsInFlight, EventSlot( m_algosDependencies, algsNumber,
precSvc->getRules()->getControlFlowNodeCounter(), messageSvc ) );
m_eventSlots.assign( m_maxEventsInFlight,
EventSlot( algsNumber, precSvc->getRules()->getControlFlowNodeCounter(), messageSvc ) );
std::for_each( m_eventSlots.begin(), m_eventSlots.end(), []( EventSlot& slot ) { slot.complete = true; } );
if ( m_threadPoolSize > 1 ) {
......@@ -474,11 +474,22 @@ StatusCode AvalancheSchedulerSvc::pushNewEvent( EventContext* eventContext )
debug() << "Executing event " << eventContext->evt() << " on slot " << thisSlotNum << endmsg;
thisSlot.reset( eventContext );
// Result status code:
StatusCode result = StatusCode::SUCCESS;
// promote to CR and DR the initial set of algorithms
Cause cs = {Cause::source::Root, "RootDecisionHub"};
m_precSvc->iterate( thisSlot, cs );
if ( m_precSvc->iterate( thisSlot, cs ).isFailure() ) {
error() << "Failed to call IPrecedenceSvc::iterate for slot " << thisSlotNum << endmsg;
result = StatusCode::FAILURE;
}
return this->updateStates( thisSlotNum );
if ( this->updateStates( thisSlotNum ).isFailure() ) {
error() << "Failed to call AvalancheSchedulerSvc::updateStates for slot " << thisSlotNum << endmsg;
result = StatusCode::FAILURE;
}
return result;
}; // end of lambda
// Kick off the scheduling!
......@@ -616,7 +627,7 @@ StatusCode AvalancheSchedulerSvc::updateStates( int si, const std::string& algo_
m_updateNeeded = true;
StatusCode global_sc( StatusCode::FAILURE, true );
StatusCode global_sc( StatusCode::SUCCESS );
// Sort from the oldest to the newest event
// Prepare a vector of pointers to the slots to avoid copies
......@@ -645,7 +656,10 @@ StatusCode AvalancheSchedulerSvc::updateStates( int si, const std::string& algo_
// Perform the I->CR->DR transitions
if ( !algo_name.empty() ) {
Cause cs = {Cause::source::Task, algo_name};
m_precSvc->iterate( thisSlot, cs );
if ( m_precSvc->iterate( thisSlot, cs ).isFailure() ) {
error() << "Failed to call IPrecedenceSvc::iterate for slot " << iSlot << endmsg;
global_sc = StatusCode::FAILURE;
}
}
StatusCode partial_sc( StatusCode::FAILURE, true );
......@@ -832,34 +846,9 @@ void AvalancheSchedulerSvc::dumpSchedulerState( int iSlot )
<< " event: " << thisSlot.eventContext->evt() << " -----------" << std::endl;
if ( 0 > iSlot or iSlot == slotCount ) {
outputMessageStream << "Algorithms states:" << std::endl;
const DataObjIDColl& wbSlotContent( thisSlot.dataFlowMgr.content() );
for ( unsigned int algoIdx = 0; algoIdx < thisSlot.algsStates.size(); ++algoIdx ) {
outputMessageStream << " o " << index2algname( algoIdx ) << " ["
<< AlgsExecutionStates::stateNames[thisSlot.algsStates[algoIdx]] << "] Data deps: ";
DataObjIDColl deps( thisSlot.dataFlowMgr.dataDependencies( algoIdx ) );
const int depsSize = deps.size();
if ( depsSize == 0 ) outputMessageStream << " none";
DataObjIDColl missing;
for ( auto d : deps ) {
outputMessageStream << d << " ";
if ( wbSlotContent.find( d ) == wbSlotContent.end() ) {
// outputMessageStream << "[missing] ";
missing.insert( d );
}
}
outputMessageStream << std::endl;
}
// Snapshot of the WhiteBoard
outputMessageStream << "\nWhiteboard contents: " << std::endl;
for ( auto& product : wbSlotContent ) outputMessageStream << " o " << product << std::endl;
// Snapshot of the ControlFlow
outputMessageStream << "\nControl Flow:" << std::endl;
// Snapshot of the Control Flow and FSM states
outputMessageStream << "\nControl Flow and FSM states:" << std::endl;
outputMessageStream << m_precSvc->printState( thisSlot ) << std::endl;
}
}
......
#include "DataFlowManager.h"
//---------------------------------------------------------------------------
// Static members
std::vector<DataFlowManager::dependency_bitset> DataFlowManager::m_algosRequirements;
std::unordered_map<DataObjID, long int, DataObjID_Hasher> DataFlowManager::m_productName_index_map;
std::vector<DataObjID> DataFlowManager::m_productName_vec;
//---------------------------------------------------------------------------
/**
* If this is the first instance, the constructor fills the requirements of
* all algorithms and indexes the data products.
*/
DataFlowManager::DataFlowManager( algosDependenciesCollection algosDependencies )
{
// Count how many products are actually requested
unsigned int nProducts( 0 );
for ( auto& thisAlgoDependencies : algosDependencies ) {
nProducts += thisAlgoDependencies.size();
}
m_dataObjectsCatalog.resize( nProducts );
// If it's not the first instance, nothing to do here
if ( m_algosRequirements.size() == 0 ) {
// This is the first instance, compile the requirements
m_algosRequirements.resize( algosDependencies.size(), dependency_bitset( nProducts ) );
// Fill the requirements
unsigned int algoIndex = 0;
long int productIndex = 0;
for ( auto& thisAlgoDependencies : algosDependencies ) {
// Make a local alias for better readability
auto& dependency_bits = m_algosRequirements[algoIndex];
for ( auto& product : thisAlgoDependencies ) {
auto ret_val = m_productName_index_map.insert( std::pair<DataObjID, long int>( product, productIndex ) );
// insert successful means product wasn't known before. So increment counter
if ( ret_val.second == true ) ++productIndex;
// in any case the return value holds the proper product index
dependency_bits[ret_val.first->second] = true;
} // end loop on products on which the algo depends
algoIndex++;
} // end loop on algorithms
// Now the vector of products
m_productName_vec.resize( m_productName_index_map.size() );
for ( auto& name_idx : m_productName_index_map ) m_productName_vec[name_idx.second] = name_idx.first;
}
}
//---------------------------------------------------------------------------
/**
* This method is called to know if the algorithm can run according to what
* data objects are in the event.
*/
bool DataFlowManager::canAlgorithmRun( unsigned int iAlgo )
{
const dependency_bitset& thisAlgoRequirements = m_algosRequirements[iAlgo];
return thisAlgoRequirements.is_subset_of( m_dataObjectsCatalog );
}
//---------------------------------------------------------------------------
/// Update the catalog of available products in the slot
void DataFlowManager::updateDataObjectsCatalog( const DataObjIDColl& newProducts )
{
for ( const auto& new_product : newProducts ) {
m_fc.insert( new_product );
const int index = productName2index( new_product );
if ( index >= 0 ) m_dataObjectsCatalog[index] = true;
}
}
//---------------------------------------------------------------------------
/// Reset the slot for a new event
void DataFlowManager::reset()
{
m_dataObjectsCatalog.reset();
m_fc.clear();
}
//---------------------------------------------------------------------------
/// Get the content (inefficient, only for debug in case of crashes)
DataObjIDColl DataFlowManager::content() const
{
DataObjIDColl products;
for ( const auto& p : m_fc ) {
products.insert( p );
}
return products;
}
//---------------------------------------------------------------------------
/// Get the data dependencies (inefficient, only for debug in case of crashes)
DataObjIDColl DataFlowManager::dataDependencies( unsigned int iAlgo ) const
{
// with move semantics this is ~fine
DataObjIDColl deps;
for ( unsigned int i = 0; i < m_productName_vec.size(); ++i ) {
if ( m_algosRequirements[iAlgo][i] ) deps.insert( m_productName_vec[i] );
}
return deps;
}
//---------------------------------------------------------------------------
#ifndef GAUDIHIVE_DATAFLOWMANAGER_H
#define GAUDIHIVE_DATAFLOWMANAGER_H
// FW includes
#include "GaudiKernel/DataObjID.h"
#include "GaudiKernel/IAlgorithm.h"
#include "GaudiKernel/SmartIF.h"
// boost
#include "boost/dynamic_bitset.hpp"
// std includes
#include <list>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <vector>
/**@class DataFlowManager DataFlowManager.h GaudiHive/src/DataFlowManager.h
*
* The DataFlowManager takes care of keeping track of the dependencies of
* the algorithms in terms of dataObjects.
* One instance of the DataFlowManager is responsible for one event.
*
* @author Danilo Piparo, Benedikt Hegner
* @version 1.0
*/
class DataFlowManager
{
public:
/// Type holding the dependencies for one single algorithm
typedef boost::dynamic_bitset<> dependency_bitset;
typedef std::vector<DataObjIDColl> algosDependenciesCollection;
/// Constructor
DataFlowManager( const std::list<IAlgorithm*>& /*algos*/ ) : m_dataObjectsCatalog( 0 ){};
/// Constructor (transitional, will be deprecated once handles are in place)
DataFlowManager( algosDependenciesCollection algoDependencies );
/// Needed data products are available
bool canAlgorithmRun( unsigned int iAlgo );
/// Update the catalog of available products in the slot
void updateDataObjectsCatalog( const DataObjIDColl& newProducts );
/// Reset to default values
void reset();
/// Get the content of the catalog
DataObjIDColl content() const;
/// Get the dependencies of a single algo;
DataObjIDColl dataDependencies( unsigned int iAlgo ) const;
private:
DataObjIDColl m_fc;
/// Catalog of the products in the whiteboard
dependency_bitset m_dataObjectsCatalog;
/// Requirements of algos. Static since the same for all events.
static std::vector<dependency_bitset> m_algosRequirements;
/// Track the products, assigning an index to them. Static since the same for all events.
static std::vector<DataObjID> m_productName_vec;
/// Track the products, assigning an index to them. Static since the same for all events.
typedef DataObjID productName_t;
static std::unordered_map<productName_t, long int, DataObjID_Hasher> m_productName_index_map;
/// Simple helper method to convert the product name into an index
inline long int productName2index( const productName_t& productName )
{
return m_productName_index_map.count( productName ) > 0 ? m_productName_index_map[productName] : -1;
};
/// Simple helper method to convert an index to a product name
inline DataObjID& index2productName( const unsigned int i ) { return m_productName_vec[i]; };
};
#endif
......@@ -3,7 +3,6 @@
// Framework includes
#include "AlgsExecutionStates.h"
#include "DataFlowManager.h"
#include "GaudiKernel/EventContext.h"
// Event slots management -------------------------------------------------
......@@ -11,12 +10,10 @@
class EventSlot
{
public:
EventSlot( const std::vector<DataObjIDColl>& algoDependencies, unsigned int numberOfAlgorithms,
unsigned int numberOfControlFlowNodes, SmartIF<IMessageSvc> MS )
EventSlot( unsigned int numberOfAlgorithms, unsigned int numberOfControlFlowNodes, SmartIF<IMessageSvc> MS )
: eventContext( nullptr )
, algsStates( numberOfAlgorithms, MS )
, complete( false )
, dataFlowMgr( algoDependencies )
, controlFlowState( numberOfControlFlowNodes, -1 ){};
~EventSlot(){};
......@@ -26,7 +23,6 @@ public:
{
eventContext = theeventContext;
algsStates.reset();
dataFlowMgr.reset();
complete = false;
controlFlowState.assign( controlFlowState.size(), -1 );
};
......@@ -37,8 +33,6 @@ public:
AlgsExecutionStates algsStates;
/// Flags completion of the event
bool complete;
/// DataFlowManager of this slot
DataFlowManager dataFlowMgr;
/// State of the control flow
std::vector<int> controlFlowState;
};
......