Commit f81707b6 authored by mstahl's avatar mstahl
Browse files

hacked TimelineSvc to spit out a manageable csv file

parent b80b6328
Pipeline #856548 failed with stages
in 17 minutes and 40 seconds
......@@ -3,6 +3,7 @@
#include "GaudiKernel/StatusCode.h"
#include <fstream>
#include <functional>
StatusCode TimelineSvc::initialize() {
StatusCode sc = Service::initialize();
......@@ -66,8 +67,10 @@ ITimelineSvc::TimelineRecorder TimelineSvc::getRecorder( std::string alg, const
bool TimelineSvc::getTimelineEvent( TimelineEvent& e ) const {
for ( const auto& candidate : m_events ) {
if ( candidate.algorithm == e.algorithm && candidate.event == e.event ) {
e = candidate;
return true;
if(e.event % m_receverynthevent == 0 && (m_algos.empty() || std::find(m_algos.begin(), m_algos.end(), e.algorithm) != m_algos.end())){
e = candidate;
return true;
}
}
}
return false;
......@@ -78,11 +81,11 @@ void TimelineSvc::outputTimeline() {
out << "#start end algorithm thread slot event" << std::endl;
for ( const auto& e : m_events ) {
out << std::chrono::duration_cast<std::chrono::nanoseconds>( e.start.time_since_epoch() ).count() << " "
<< std::chrono::duration_cast<std::chrono::nanoseconds>( e.end.time_since_epoch() ).count() << " "
<< e.algorithm << " " << e.thread << " " << e.slot << " " << e.event << std::endl;
}
for ( const auto& e : m_events )
if(e.event % m_receverynthevent == 0 && (m_algos.empty() || std::find(m_algos.begin(), m_algos.end(), e.algorithm) != m_algos.end()))
out << std::chrono::duration_cast<std::chrono::microseconds>( e.start.time_since_epoch() ).count() << " "
<< std::chrono::duration_cast<std::chrono::microseconds>( e.end.time_since_epoch() ).count() << " "
<< e.algorithm << " " << e.thread << " " << e.slot << " " << e.event << std::endl;
out.close();
}
......
......@@ -25,10 +25,12 @@ public:
private:
void outputTimeline();
Gaudi::Property<std::string> m_timelineFile{this, "TimelineFile", "timeline.csv", ""};
Gaudi::Property<bool> m_isEnabled{this, "RecordTimeline", false, "Enable recording of the timeline events"};
Gaudi::Property<bool> m_dumpTimeline{this, "DumpTimeline", false, "Enable dumping of the timeline events"};
Gaudi::Property<bool> m_partial{this, "Partial", false, ""};
Gaudi::Property<std::string> m_timelineFile{this, "TimelineFile", "timeline.csv", ""};
Gaudi::Property<bool> m_isEnabled{this, "RecordTimeline", false, "Enable recording of the timeline events"};
Gaudi::Property<bool> m_dumpTimeline{this, "DumpTimeline", false, "Enable dumping of the timeline events"};
Gaudi::Property<int> m_receverynthevent{this, "RecordEveryNthEntry", 1, "Only record every nth event"};
Gaudi::Property<std::vector<std::string>> m_algos{this, "RecordedAlgorithms",std::vector<std::string>{}, "Whitelist of algorithms"};
Gaudi::Property<bool> m_partial{this, "Partial", false, ""};
tbb::concurrent_vector<TimelineEvent> m_events;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment