summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo Piparo <dpiparo@cern.ch>2013-05-31 15:06:17 +0200
committerDanilo Piparo <dpiparo@cern.ch>2013-05-31 15:06:17 +0200
commit5c40b2cd73abd321d0030fb9a3257f0e87c12235 (patch)
tree3d4d642ff5e95ab5134ae9d1b37748e0a81866b7
parentcfd34cb2cc35e0017f358c2e804e5ef1993c6cb1 (diff)
Better time-memory printoutsv0.5-ref1305
-rw-r--r--GaudiCoreSvc/src/ApplicationMgr/EventLoopMgr.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/GaudiCoreSvc/src/ApplicationMgr/EventLoopMgr.cpp b/GaudiCoreSvc/src/ApplicationMgr/EventLoopMgr.cpp
index 5ad8c45..6118c30 100644
--- a/GaudiCoreSvc/src/ApplicationMgr/EventLoopMgr.cpp
+++ b/GaudiCoreSvc/src/ApplicationMgr/EventLoopMgr.cpp
@@ -287,6 +287,10 @@ StatusCode EventLoopMgr::finalize() {
//--------------------------------------------------------------------------------------------
StatusCode EventLoopMgr::executeEvent(void* par) {
+ // DP Monitoring
+
+
+
// Fire BeginEvent "Incident"
m_incidentSvc->fireIncident(Incident(name(),IncidentType::BeginEvent));
// An incident may schedule a stop, in which case is better to exit before the actual execution.
@@ -320,7 +324,20 @@ StatusCode EventLoopMgr::executeRun( int maxevt ) {
//--------------------------------------------------------------------------------------------
// implementation of IAppMgrUI::nextEvent
//--------------------------------------------------------------------------------------------
+// External libraries
+#include "tbb/tick_count.h"
+#include "GaudiKernel/Memory.h"
StatusCode EventLoopMgr::nextEvent(int maxevt) {
+
+ // DP Monitoring
+ // Calculate runtime
+ auto start_time = tbb::tick_count::now();
+ auto secsFromStart = [&start_time]()->double{
+ return (tbb::tick_count::now()-start_time).seconds();
+ };
+ const float oneOver1204 = 1.f/1024.f;
+
+
static int total_nevt = 0;
DataObject* pObject = 0;
StatusCode sc(StatusCode::SUCCESS, true);
@@ -329,6 +346,11 @@ StatusCode EventLoopMgr::nextEvent(int maxevt) {
// if evtmax is -1 it means infinite loop
for( int nevt = 0; (maxevt == -1 ? true : nevt < maxevt); nevt++, total_nevt++) {
+ always() << "Event Number = " << total_nevt
+ << " WSS (MB) = " << System::mappedMemory(System::MemoryUnit::kByte)*oneOver1204
+ << " Time (s) = " << secsFromStart() << endmsg;
+
+
// Check if there is a scheduled stop issued by some algorithm/service
if ( m_scheduledStop ) {
m_scheduledStop = false;
@@ -385,6 +407,9 @@ StatusCode EventLoopMgr::nextEvent(int maxevt) {
return sc;
}
}
+
+ always() << "---> Loop Finished (seconds): " << secsFromStart() <<endmsg;
+
return StatusCode::SUCCESS;
}