From f1c91e065ff79fc9d7b822406a4bed6ae7c3a687 Mon Sep 17 00:00:00 2001
From: Martin Karsten <mkarsten@uwaterloo.ca>
Date: Sat, 16 Jun 2018 11:44:13 -0400
Subject: [PATCH] - add TESTING_WAKE_CLUSTER option

---
 src/runtime/BaseProcessor.cc | 4 +++-
 src/testoptions.h            | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/runtime/BaseProcessor.cc b/src/runtime/BaseProcessor.cc
index 989b08c..cb175c5 100644
--- a/src/runtime/BaseProcessor.cc
+++ b/src/runtime/BaseProcessor.cc
@@ -17,7 +17,7 @@
 #include "runtime/Cluster.h"
 #include "runtime/RuntimeImpl.h"
 
-// from background enqueue -> find idle "real" processor to run
+// from background & staging enqueue -> find idle "real" processor to run
 void VirtualProcessor::wakeUp() {
   BaseProcessor* idleProc = cluster.findIdleProcessorHard();
   GENASSERT1(idleProc != this, FmtHex(this));
@@ -26,8 +26,10 @@ void VirtualProcessor::wakeUp() {
 
 // any other enqueue -> wake idle processor, but don't try too hard
 void VirtualProcessor::wakeCluster() {
+#if TESTING_WAKE_CLUSTER
   BaseProcessor* idleProc = cluster.findIdleProcessorSoft();
   if (idleProc && idleProc != this) idleProc->wakeUp();
+#endif
 }
 
 BaseProcessor::BaseProcessor(Cluster& c) : VirtualProcessor(c, "Processor"), terminate(false), idleStack(nullptr) {
diff --git a/src/testoptions.h b/src/testoptions.h
index 82b4b40..1b9e5e0 100644
--- a/src/testoptions.h
+++ b/src/testoptions.h
@@ -22,6 +22,7 @@
 //#define TESTING_MUTEX_FIFO            1 // use fifo/baton mutex
 //#define TESTING_MUTEX_SPIN            1 // spin before block in non-fifo mutex
 //#define TESTING_PLACEMENT_RR          1 // RR placement, instead of load-based
+#define TESTING_WAKE_CLUSTER          1 // try waking idle processor on cluster backlog
 #define TESTING_WORK_STEALING         1 // enable work stealing (default transient)
 #define TESTING_WORK_STEALING_STICKY  5 // sticky work stealing load threshold
 
-- 
GitLab