Skip to content
Snippets Groups Projects
Commit 866890ef authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Merge branch 'extend-DR-criterion' into 'master'

Extend the criterion of data dependency resolution

Promote an algorithm to DATAREADY if all its data supplying algorithms
were executed, regardless of EVTACCEPTED or EVTREJECTED state.

See merge request !368
parents 3cd763ce 27ad5311
No related branches found
No related tags found
1 merge request!368Extend the criterion of data dependency resolution
Pipeline #
...@@ -18,9 +18,9 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${TBB_INCL ...@@ -18,9 +18,9 @@ include_directories(SYSTEM ${Boost_INCLUDE_DIRS} ${ROOT_INCLUDE_DIRS} ${TBB_INCL
#---Libraries--------------------------------------------------------------- #---Libraries---------------------------------------------------------------
gaudi_add_module(GaudiHive gaudi_add_module(GaudiHive
*.cpp *.cpp
LINK_LIBRARIES GaudiKernel Boost ROOT TBB GaudiAlgLib ${LIBRT_NAME} LINK_LIBRARIES GaudiKernel Boost ROOT TBB GaudiAlgLib ${LIBRT_NAME}
INCLUDE_DIRS Boost ROOT TBB) INCLUDE_DIRS Boost ROOT TBB)
gaudi_add_test(WhiteBoard gaudi_add_test(WhiteBoard
FRAMEWORK options/testWhiteBoard.py FRAMEWORK options/testWhiteBoard.py
...@@ -66,12 +66,15 @@ gaudi_add_test(AtlasMCRecoScenario ...@@ -66,12 +66,15 @@ gaudi_add_test(AtlasMCRecoScenario
TIMEOUT 120) TIMEOUT 120)
set_property(TEST GaudiHive.AtlasMCRecoScenario PROPERTY SKIP_RETURN_CODE 77) set_property(TEST GaudiHive.AtlasMCRecoScenario PROPERTY SKIP_RETURN_CODE 77)
# Test the SequentialSequencer
gaudi_add_test(SequentialSequencer gaudi_add_test(SequentialSequencer
FRAMEWORK options/SequentialAlgSequencerTest.py FRAMEWORK options/SequentialAlgSequencerTest.py
DEPENDS WhiteBoard DEPENDS WhiteBoard
TIMEOUT 120) TIMEOUT 120)
gaudi_add_test(ControlFlowBranching+CrossBranchDataFlow
FRAMEWORK options/ControlFlowBranching+CrossBranchDataFlow.py
TIMEOUT 120)
# BugFixes # BugFixes
gaudi_add_test(BugCFHEP114 gaudi_add_test(BugCFHEP114
FRAMEWORK options/BugCFHEP114.py FRAMEWORK options/BugCFHEP114.py
......
#!/usr/bin/env gaudirun.py
"""
Typically, an EVTREJECTED algorithm is used to "short-circuit" the execution flow within
the group of algorithms it belongs to. Within such early-terminated group, a false-negative
data dependency resolution can never occur since all downstream algorithms are skipped.
However, there might be other algorithms - outside of the early-terminated group - that depend
on data outputs of the EVTREJECTED algorithm. The test emulates this scenario.
"""
from Gaudi.Configuration import *
from Configurables import HiveWhiteBoard, HiveSlimEventLoopMgr, AvalancheSchedulerSvc, AlgResourcePool
from Configurables import GaudiSequencer, CPUCruncher
# metaconfig
evtslots = 1
evtMax = 1
algosInFlight = 1
InertMessageSvc(OutputLevel=INFO)
whiteboard = HiveWhiteBoard("EventDataSvc",
EventSlots=evtslots,
OutputLevel=INFO)
slimeventloopmgr = HiveSlimEventLoopMgr(SchedulerName="AvalancheSchedulerSvc",
OutputLevel=DEBUG)
AvalancheSchedulerSvc(ThreadPoolSize=algosInFlight,
OutputLevel=DEBUG)
AlgResourcePool(OutputLevel=DEBUG)
# Assemble data flow graph
a1 = CPUCruncher("AlgA", InvertDecision=True) # algorithm that triggers an early exit from "Branch2"
a1.outKeys = ['/Event/A']
a2 = CPUCruncher("AlgB")
a2.inpKeys = ['/Event/A']
a3 = CPUCruncher("AlgC")
a3.inpKeys = ['/Event/A']
for a in [a1,a2,a3]:
a.shortCalib = True
a.avgRuntime = .01
# Assemble control flow graph
branch1 = GaudiSequencer("Branch1", ModeOR=False, ShortCircuit=False)
branch2 = GaudiSequencer("Branch2", ModeOR=False, ShortCircuit=True, Sequential=True)
branch2.Members = [a1,a2]
branch1.Members = [branch2,a3]
ApplicationMgr(EvtMax = evtMax,
EvtSel = 'NONE',
ExtSvc = [whiteboard],
EventLoop = slimeventloopmgr,
TopAlg = [branch1],
MessageSvcType = "InertMessageSvc",
OutputLevel = INFO)
...@@ -323,6 +323,8 @@ StatusCode CPUCruncher::execute() // the execution of the algorithm ...@@ -323,6 +323,8 @@ StatusCode CPUCruncher::execute() // the execution of the algorithm
<< " ActualTotalRuntime= " << actualRuntime << " Ratio= " << ( crunchtime + dreamtime ) / actualRuntime << " ActualTotalRuntime= " << actualRuntime << " Ratio= " << ( crunchtime + dreamtime ) / actualRuntime
<< " Niters= " << n_iters << endmsg; << " Niters= " << n_iters << endmsg;
setFilterPassed(!m_invertCFD);
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
......
...@@ -64,6 +64,7 @@ private: ...@@ -64,6 +64,7 @@ private:
Gaudi::Property<float> m_sleepFraction{ Gaudi::Property<float> m_sleepFraction{
this, "SleepFraction", 0.0f, this, "SleepFraction", 0.0f,
"Fraction of time, between 0 and 1, when an algorithm is actually sleeping instead of crunching"}; "Fraction of time, between 0 and 1, when an algorithm is actually sleeping instead of crunching"};
Gaudi::Property<bool> m_invertCFD{this, "InvertDecision", false, "Invert control flow decision."};
// To calib only once // To calib only once
static std::vector<unsigned int> m_niters_vect; static std::vector<unsigned int> m_niters_vect;
......
...@@ -34,11 +34,13 @@ namespace concurrency { ...@@ -34,11 +34,13 @@ namespace concurrency {
bool result = false; // return false if the input has no producers at all bool result = false; // return false if the input has no producers at all
for ( auto algoNode : node.getProducers() ) for ( auto algoNode : node.getProducers() ) {
if ( State::EVTACCEPTED == m_slot->algsStates[algoNode->getAlgoIndex()] ) { const auto& state = m_slot->algsStates[algoNode->getAlgoIndex()];
if ( State::EVTACCEPTED == state || State::EVTREJECTED == state ) {
result = true; result = true;
break; // skip checking other producers if one was found to be executed break; // skip checking other producers if one was found to be executed
} }
}
// return true only if this DataNode is produced // return true only if this DataNode is produced
return result; return result;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment