Storing memory threshold for adaptive scheduling in a global variable. Added a
authorIsaac Dooley <idooley2@illinois.edu>
Thu, 17 Sep 2009 19:30:13 +0000 (19:30 +0000)
committerIsaac Dooley <idooley2@illinois.edu>
Thu, 17 Sep 2009 19:30:13 +0000 (19:30 +0000)
preprocessor ifdef to determine whether to compile in the adaptive scheduling call.

src/conv-core/queueing.c
src/conv-core/queueing.h

index 32fded6bdd4bba57ce1d99773a9916d055ca78da..ce062a5604bf8380db89caf9ee60b8c7610b3a61 100644 (file)
 */
 
 
+/** A memory limit threshold for adaptively scheduling */
+int schedAdaptMemThresholdMB;
+
+
 /** Initialize a deq */
 static void CqsDeqInit(d)
 deq d;
@@ -666,9 +670,9 @@ void CqsEnqueue(Queue q, void *data)
 /** Retrieve the highest priority message (one with most negative priority) */
 void CqsDequeue(Queue q, void **resp)
 {
-#if 0
+#ifdef ADAPT_SCHED_MEM
     /* Added by Isaac for testing purposes: */
-    if(CmiMemoryUsage() > 600*1024*1024 ){
+    if((q->length > 1) && (CmiMemoryUsage() > schedAdaptMemThresholdMB*1024*1024) ){
        CqsIncreasePriorityForEntryMethod(q, 153);
     }
 #endif
index fd463274b3897f20e60d8f6927f0971f7eaf8489..30a6b72a11c59cc0dea58cbd11823a65a74a2933 100644 (file)
 extern "C" {
 #endif
 
+
+/** A memory limit threshold for adaptively scheduling */
+extern int schedAdaptMemThresholdMB;
+
 #ifndef CINTBITS
 #define CINTBITS ((unsigned int) (sizeof(int)*8))
 #endif