Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#2387: Gather hashed trace user events at the end of run #2395

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/vt/trace/trace_lite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ void TraceLite::flushTracesFile(bool useGlobalSync) {
void TraceLite::writeTracesFile(int flush, bool is_incremental_flush) {
auto const node = theContext()->getNode();

vt::runInEpochCollective([&]{
proxy.reduce<vt::collective::PlusOp>(0, std::move(user_event_));
});

size_t to_write = traces_.size();

if (traceWritingEnabled(node) and to_write > 0) {
Expand Down
27 changes: 9 additions & 18 deletions src/vt/trace/trace_user_event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,25 +82,12 @@ UserEventIDType UserEventRegistry::hash(std::string const& in_event_name) {
id_hash = id_hash & 0x0FFF;
auto ret = newEventImpl(false, false, in_event_name, id_hash, true);
auto id = std::get<0>(ret);
auto inserted = std::get<1>(ret);
if (inserted) {
auto const node = theContext()->getNode();
if (node != 0) {
auto msg = makeMessage<NewUserEventMsg>(false, id, in_event_name);
theMsg()->sendMsg<newEventHan>(0, msg);
}
}
return id;
}

UserEventIDType UserEventRegistry::rooted(std::string const& in_event_name) {
auto ret = newEventImpl(false, true, in_event_name, cur_root_event_++);
auto id = std::get<0>(ret);
auto const node = theContext()->getNode();
if (node != 0) {
auto msg = makeMessage<NewUserEventMsg>(false, id, in_event_name);
theMsg()->sendMsg<newEventHan>(0, msg);
}
return id;
}

Expand All @@ -109,11 +96,6 @@ UserEventIDType UserEventRegistry::user(
) {
auto ret = newEventImpl(true, false, in_event_name, seq);
auto id = std::get<0>(ret);
auto const node = theContext()->getNode();
if (node != 0) {
auto msg = makeMessage<NewUserEventMsg>(true, id, in_event_name);
theMsg()->sendMsg<newEventHan>(0, msg);
}
return id;
}
#endif
Expand Down Expand Up @@ -145,9 +127,18 @@ bool UserEventRegistry::insertEvent(
);
return true;
} else {
user_event_[event] += " COLLISION " + name;
return false;
}
}

UserEventRegistry operator+(
UserEventRegistry r1, UserEventRegistry const& r2
) {
for (auto& [hash, event_str] : r2.getEvents()) {
r1.insertEvent(hash, event_str);
}
return r1;
}

}} /* end namespace vt::trace */
Loading