From 8d9d00c04256c8972f6360c30831219904d743b8 Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Thu, 11 Aug 2022 11:21:23 -0600 Subject: [PATCH] #1915: Cache TD pointer --- src/vt/runtime/runtime.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vt/runtime/runtime.cc b/src/vt/runtime/runtime.cc index cacbc289c7..446088a0f3 100644 --- a/src/vt/runtime/runtime.cc +++ b/src/vt/runtime/runtime.cc @@ -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); } ); }