diff --git a/GaudiHive/src/ForwardSchedulerSvc.cpp b/GaudiHive/src/ForwardSchedulerSvc.cpp index dcaff991a96369f7a12d8dcd7f378ff192bc872b..cef9b9957a5fe69ff36e92ed81c1ee59e08c90b3 100644 --- a/GaudiHive/src/ForwardSchedulerSvc.cpp +++ b/GaudiHive/src/ForwardSchedulerSvc.cpp @@ -316,10 +316,21 @@ StatusCode ForwardSchedulerSvc::initialize() info() << " o Number of algorithms in flight: " << m_maxAlgosInFlight << endmsg; info() << " o TBB thread pool size: " << m_threadPoolSize << endmsg; - info() << " --------- Dumping Data Flow ---------" << endmsg; m_efg = algPool->getPRGraph(); - m_efg->dumpDataFlow(); + if (m_showConfig) { + info() << std::endl + << "========== Algorithm and Sequence Configuration ==========" + << std::endl << std::endl; + info() << m_efg->printConfiguration() << endmsg; + } + + if (m_showDataFlow) { + info() << std::endl + << "======================= Data Flow ========================" + << std::endl; + info() << m_efg->dumpDataFlow() << endmsg; + } // info() << "\n\n --------- Dumping Execution Plan ---------" << endmsg; // algPool->getPRGraph()->dumpExecutionPlan(); @@ -487,7 +498,8 @@ StatusCode ForwardSchedulerSvc::pushNewEvent( EventContext* eventContext ) return StatusCode::FAILURE; } - info() << "Executing event " << eventContext->evt() << " on slot " << thisSlotNum << endmsg; + debug() << "Executing event " << eventContext->evt() << " on slot " + << thisSlotNum << endmsg; thisSlot.reset( eventContext ); // check Condition Algs and data diff --git a/GaudiHive/src/ForwardSchedulerSvc.h b/GaudiHive/src/ForwardSchedulerSvc.h index 60afb35e2f88652d49be4b5c614e1179bd1671f1..e582a9dd5c936189b01b4fe3eb70186923d6362d 100644 --- a/GaudiHive/src/ForwardSchedulerSvc.h +++ b/GaudiHive/src/ForwardSchedulerSvc.h @@ -150,6 +150,11 @@ private: Gaudi::Property m_enableCondSvc{this, "EnableConditions", false, "Enable ConditionsSvc"}; + Gaudi::Property m_showDataFlow{this, "ShowDataFlow", false, + "Show the configuration of DataFlow between Algorithms"}; + + Gaudi::Property m_showConfig{this, "ShowConfiguration", false, + "Show the configuration of all Algorithms and Sequences"}; // Utils and shortcuts ---------------------------------------------------- diff --git a/GaudiHive/src/PrecedenceRulesGraph.cpp b/GaudiHive/src/PrecedenceRulesGraph.cpp index 1d0cbdc55a7dcb3bf2422aa689945fa8cde2c850..c54e79de46e5b5e5ffca165add569068f7cfad94 100644 --- a/GaudiHive/src/PrecedenceRulesGraph.cpp +++ b/GaudiHive/src/PrecedenceRulesGraph.cpp @@ -772,13 +772,51 @@ namespace concurrency return result; } + std::string PrecedenceRulesGraph::printConfiguration() const { + std::ostringstream ost; + printConfiguration(ost,m_headNode,0); + return ost.str(); + } + + void PrecedenceRulesGraph::printConfiguration(std::ostringstream& ost, + ControlFlowNode* node, + const int& indent) const { + ost << std::string(indent*2, ' '); + DecisionNode *dn = dynamic_cast (node); + AlgorithmNode *an = dynamic_cast (node); + if ( dn != 0 ) { + if (node != m_headNode) { + ost << node->getNodeName() << " [Seq] "; + ost << ( (dn->m_modeConcurrent) ? " [Concurrent] " : " [Sequential] " ); + ost << ( (dn->m_modePromptDecision) ? " [Prompt] " : "" ); + ost << ( (dn->m_modeOR) ? " [OR] " : "" ); + ost << ( (dn->m_allPass) ? " [PASS] " : "" ); + ost << "\n"; + } + const std::vector& dth = dn->getDaughters(); + for (std::vector::const_iterator itr= dth.begin(); + itr != dth.end(); ++itr) { + printConfiguration(ost,*itr,indent+1); + } + } else if (an != 0) { + ost << node->getNodeName() << " [Alg] "; + if (an != 0) { + auto ar = an->getAlgorithmRepresentatives(); + ost << " [n= " << ar.at(0)->cardinality() << "]"; + ost << ( (! ar.at(0)->isClonable()) ? " [unclonable] " : "" ); + } + ost << "\n"; + } + + } + //--------------------------------------------------------------------------- std::string PrecedenceRulesGraph::dumpDataFlow() const - { + { const char idt[] = " "; std::ostringstream ost; - + ost << "\n" << idt << "====================================\n"; ost << idt << "Data origins and destinations:\n"; ost << idt << "====================================\n"; diff --git a/GaudiHive/src/PrecedenceRulesGraph.h b/GaudiHive/src/PrecedenceRulesGraph.h index 627ee1608f70e7fc4e734d3efb28428f6d188594..035a257312856e562b6f6e22e92e5525e904bf80 100644 --- a/GaudiHive/src/PrecedenceRulesGraph.h +++ b/GaudiHive/src/PrecedenceRulesGraph.h @@ -353,6 +353,8 @@ public: /// set cause-effect connection between two algorithms in the execution plan void addEdgeToExecutionPlan(const AlgorithmNode* u, const AlgorithmNode* v); + std::string printConfiguration() const; + private: /// the head node of the control flow graph; may want to have multiple ones once supporting trigger paths DecisionNode* m_headNode; @@ -376,6 +378,10 @@ private: /// temporary items to experiment with execution planning boost::ExecPlan m_ExecPlan; std::map m_exec_plan_map; + + void printConfiguration(std::ostringstream&, ControlFlowNode*, + const int&) const; + };