Skip to content

Commit

Permalink
#1915: Cache TD pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander authored and PhilMiller committed Aug 24, 2022
1 parent 71c1f28 commit 8d9d00c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/vt/runtime/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1027,22 +1027,23 @@ void Runtime::initializeWorkers(WorkerCountType const num_workers) {
// Without workers running on the node, the termination detector should
// enable/disable the global collective epoch based on the state of the
// scheduler; register listeners to activate/deactivate that epoch
auto td = vt::theTerm();
theSched->registerTrigger(
sched::SchedulerEvent::BeginIdleMinusTerm, []{
sched::SchedulerEvent::BeginIdleMinusTerm, [td]{
vt_debug_print(
normal, runtime,
"setLocalTerminated: BeginIdle: true\n"
);
vt::theTerm()->setLocalTerminated(true, false);
td->setLocalTerminated(true, false);
}
);
theSched->registerTrigger(
sched::SchedulerEvent::EndIdleMinusTerm, []{
sched::SchedulerEvent::EndIdleMinusTerm, [td]{
vt_debug_print(
normal, runtime,
"setLocalTerminated: EndIdle: false\n"
);
vt::theTerm()->setLocalTerminated(false, false);
td->setLocalTerminated(false, false);
}
);
}
Expand Down

0 comments on commit 8d9d00c

Please sign in to comment.