Skip to content

Commit

Permalink
#2384: trace: add some manual timings
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander committed Jan 9, 2025
1 parent fc07449 commit 661437a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/vt/trace/trace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@

namespace vt { namespace trace {

std::unordered_map<std::string, double> manual_timings;

using TraceContainersType = TraceContainers;

using LogType = Trace::LogType;
Expand Down Expand Up @@ -119,6 +121,13 @@ void Trace::finalize() /*override*/ {
// Always end any between-loop event left open.
endProcessing(between_sched_event_, timing::getCurrentTime());
between_sched_event_ = TraceProcessingTag{};

fmt::print("{}: ", theContext()->getNode());
for (auto const& [name, time] : manual_timings) {
fmt::print("({},{}) ", name, time);
}
fmt::print("\n");
fflush(stdout);
}

void Trace::loadAndBroadcastSpec() {
Expand Down
2 changes: 2 additions & 0 deletions src/vt/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@

namespace vt { namespace trace {

extern std::unordered_map<std::string, double> manual_timings;

/// Tracking information for beginProcessing/endProcessing.
struct TraceProcessingTag {

Expand Down
13 changes: 13 additions & 0 deletions src/vt/vrt/collection/balance/baselb/baselb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,22 @@ std::shared_ptr<const balance::Reassignment> BaseLB::startLB(
importProcessorData(in_stats, in_comm_lb_data, in_data_map);

runInEpochCollective("BaseLB::startLB -> runLB", [this,total_load]{

auto t1 = timing::getCurrentTime();
getArgs(phase_);
auto t2 = timing::getCurrentTime();
trace::manual_timings["getArgs"] = t2-t1;

inputParams(config_entry_.get());

auto t3 = timing::getCurrentTime();
trace::manual_timings["inputParams"] = t3-t2;

runLB(total_load);

auto t4 = timing::getCurrentTime();
trace::manual_timings["runLB"] = t4-t3;

});

return normalizeReassignments();
Expand Down

0 comments on commit 661437a

Please sign in to comment.