Skip to content
Snippets Groups Projects
Commit 829df8d6 authored by Ben Cumming's avatar Ben Cumming Committed by w-klijn
Browse files

Feature/time meter (#219)

meter_manager correctly detects first checkpoint, which is necessary to ensure that all the timers are synchronized.
parent 54f47392
No related branches found
No related tags found
No related merge requests found
......@@ -16,15 +16,14 @@ meter_manager::meter_manager() {
};
void meter_manager::checkpoint(std::string name) {
checkpoint_names.push_back(std::move(name));
// Enforce a global synchronization point the first time that the meters
// are used, to ensure that times measured across all domains are
// synchronised.
if (meters.size()==0) {
if (checkpoint_names.size()==0) {
communication::global_policy::barrier();
}
checkpoint_names.push_back(std::move(name));
for (auto& m: meters) {
m->take_reading();
}
......
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