Skip to content

Commit

Permalink
Block global termination while spinning the scheduler for a particula…
Browse files Browse the repository at this point in the history
…r epoch
  • Loading branch information
Phil Miller committed May 26, 2020
1 parent 778c136 commit 0dbd148
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/vt/scheduler/scheduler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,13 @@ void runScheduler() {
}

void runSchedulerThrough(EpochType epoch) {
// WARNING: This is to prevent global termination from spuriously
// thinking that the work done in this loop over the scheduler
// represents the entire work of the program, and thus leading to
// stuff being torn down
theTerm()->produce();
theSched()->runSchedulerWhile([=]{ return !theTerm()->isEpochTerminated(epoch); });
theTerm()->consume();
}

} //end namespace vt

0 comments on commit 0dbd148

Please sign in to comment.