Skip to content

Commit 5ba7405

Browse files
committed
#2388: set lb stats write event on startup
1 parent 2f1d718 commit 5ba7405

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

src/vt/trace/trace.cc

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ void Trace::initialize() /*override*/ {
8484

8585
// Register a trace user event to demarcate flushes that occur
8686
flush_event_ = trace::registerEventCollective("trace_flush");
87+
write_stats_event_ = trace::registerEventCollective("write_lb_stats");
8788
#endif
8889
}
8990

src/vt/trace/trace_lite.h

+24-14
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,15 @@ struct TraceLite {
295295
return traces_.size();
296296
}
297297

298+
/**
299+
* @brief Get the LB Stats Write event
300+
*
301+
* @return the LB stats write event
302+
*/
303+
UserEventIDType getWriteStatsEvent() const {
304+
return write_stats_event_;
305+
}
306+
298307
/**
299308
* @brief Get the last recorded trace event
300309
*
@@ -430,20 +439,21 @@ struct TraceLite {
430439
EventHoldStackType event_holds_;
431440
TraceStackType open_events_;
432441
TraceContainerType traces_;
433-
TraceEventIDType cur_event_ = 1;
434-
UserEventIDType flush_event_ = no_user_event_id;
435-
bool enabled_ = true;
436-
TimeType start_time_ = TimeType{0.0};
437-
std::string prog_name_ = "";
438-
std::string trace_name_ = "";
439-
std::string full_trace_name_ = "";
440-
std::string full_sts_name_ = "";
441-
std::string full_dir_name_ = "";
442-
bool wrote_sts_file_ = false;
443-
size_t trace_write_count_ = 0;
444-
bool standalone_initalized_ = false;
445-
bool trace_enabled_cur_phase_ = true;
446-
bool idle_begun_ = false;
442+
TraceEventIDType cur_event_ = 1;
443+
UserEventIDType write_stats_event_ = no_user_event_id;
444+
UserEventIDType flush_event_ = no_user_event_id;
445+
bool enabled_ = true;
446+
TimeType start_time_ = TimeType{0.0};
447+
std::string prog_name_ = "";
448+
std::string trace_name_ = "";
449+
std::string full_trace_name_ = "";
450+
std::string full_sts_name_ = "";
451+
std::string full_dir_name_ = "";
452+
bool wrote_sts_file_ = false;
453+
size_t trace_write_count_ = 0;
454+
bool standalone_initalized_ = false;
455+
bool trace_enabled_cur_phase_ = true;
456+
bool idle_begun_ = false;
447457
std::unique_ptr<vt_gzFile> log_file_;
448458
std::unordered_map<TraceEventIDType, std::stack<Log*>> incomplete_notes_ = {};
449459
};

src/vt/vrt/collection/balance/lb_invoke/lb_manager.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ void LBManager::commitPhaseStatistics(PhaseType phase) {
667667
}
668668

669669
#if vt_check_enabled(trace_enabled)
670-
auto write_lb_stats_event = theTrace()->registerUserEventColl("write_lb_stats");
670+
auto write_lb_stats_event = theTrace()->getWriteStatsEvent();
671671
theTrace()->addUserEventBracketedBegin(write_lb_stats_event);
672672
#endif
673673

0 commit comments

Comments
 (0)