Commit e2348120 authored by Ben Hazelwood's avatar Ben Hazelwood
Browse files

Add support for start/end heartbeat with tag

parent c9ea1a70
......@@ -31,11 +31,15 @@ struct Timer {
// Mark when an application sleeps
std::vector<double> sleepPoints;
// TODO: add support for multiple tags
// Delta times for each heartbeat (per replica)
std::map< int, std::list<double> > heartbeatTimes;
// Store the MPI_Requests for each heartbeat delta (per replica)
std::map< int, std::list<MPI_Request> > heartbeatTimeRequests;
std::map< int, bool > isHeartbeatTriggeredForTag;
// Hash for each heartbeat buffer (per replica)
std::map<int, std::list<std::size_t> > heartbeatHashes;
// Store the MPI_Requests for each heartbeat (per replica)
......@@ -60,12 +64,19 @@ void Timing::finaliseTiming() {
}
void Timing::markTimeline(int tag) {
if (tag == 0) {
if (timer.isHeartbeatTriggeredForTag.find(tag) == timer.isHeartbeatTriggeredForTag.end()) {
// New heartbeat tag found
timer.isHeartbeatTriggeredForTag.insert( std::make_pair(tag, false));
timer.heartbeatTimes.at(getTeam()).push_back(PMPI_Wtime());
} else if (timer.isHeartbeatTriggeredForTag.at(tag) == false) {
// Trigger heartbeat
timer.heartbeatTimes.at(getTeam()).push_back(PMPI_Wtime());
} else {
// End heartbeat
timer.heartbeatTimes.at(getTeam()).back() = PMPI_Wtime() - timer.heartbeatTimes.at(getTeam()).back();
compareProgressWithReplicas();
}
timer.isHeartbeatTriggeredForTag.at(tag) = !timer.isHeartbeatTriggeredForTag.at(tag);
}
void Timing::markTimeline(int tag, const void *sendbuf, int sendcount, MPI_Datatype sendtype) {
......
Supports Markdown
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