Commit 0a66fa36 authored by Ben Hazelwood's avatar Ben Hazelwood
Browse files

Support for start/end heartbeat with +ve/-ve tag

parent 43bf8f06
...@@ -38,8 +38,6 @@ struct Timer { ...@@ -38,8 +38,6 @@ struct Timer {
// Store the MPI_Requests for each heartbeat delta (per replica) // Store the MPI_Requests for each heartbeat delta (per replica)
std::map< int, std::list<MPI_Request> > heartbeatTimeRequests; std::map< int, std::list<MPI_Request> > heartbeatTimeRequests;
std::map< int, bool > isHeartbeatTriggeredForTag;
// Hash for each heartbeat buffer (per replica) // Hash for each heartbeat buffer (per replica)
std::map<int, std::list<std::size_t> > heartbeatHashes; std::map<int, std::list<std::size_t> > heartbeatHashes;
// Store the MPI_Requests for each heartbeat (per replica) // Store the MPI_Requests for each heartbeat (per replica)
...@@ -64,19 +62,16 @@ void Timing::finaliseTiming() { ...@@ -64,19 +62,16 @@ void Timing::finaliseTiming() {
} }
void Timing::markTimeline(int tag) { void Timing::markTimeline(int tag) {
if (timer.isHeartbeatTriggeredForTag.find(tag) == timer.isHeartbeatTriggeredForTag.end()) { if (tag > 0) {
// New heartbeat tag found
timer.isHeartbeatTriggeredForTag.insert({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()); timer.heartbeatTimes.at(getTeam()).push_back(PMPI_Wtime());
} else { } else if (tag < 0) {
// End heartbeat if (timer.heartbeatTimes.at(getTeam()).size()) {
timer.heartbeatTimes.at(getTeam()).back() = PMPI_Wtime() - timer.heartbeatTimes.at(getTeam()).back(); timer.heartbeatTimes.at(getTeam()).back() = PMPI_Wtime() - timer.heartbeatTimes.at(getTeam()).back();
compareProgressWithReplicas(); compareProgressWithReplicas();
} }
timer.isHeartbeatTriggeredForTag.at(tag) = !timer.isHeartbeatTriggeredForTag.at(tag); } else {
// TODO: if tag == 0 then single heartbeat mode not deltas
}
} }
void Timing::markTimeline(int tag, const void *sendbuf, int sendcount, MPI_Datatype sendtype) { 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