Index: trunk/Ohana/src/opihi/pcontrol/CheckSystem.c
===================================================================
--- trunk/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 10668)
+++ trunk/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 10693)
@@ -3,11 +3,15 @@
 
 static struct timeval lastlive = {0, 0};
-static int RunSystem = FALSE;
-
-int SetRunSystem (int state) {
-  int oldstate;
-  oldstate = RunSystem;
-  RunSystem = state;
-  return oldstate;
+static RunLevels RunLevel = PCONTROL_RUN_NONE;
+
+RunLevels SetRunLevel (RunLevels level) {
+  RunLevels oldlevel;
+  oldlevel = RunLevel;
+  RunLevel = level;
+  return oldlevel;
+}
+
+RunLevels GetRunLevel () {
+  return RunLevel;
 }
 
@@ -65,38 +69,47 @@
     TestCheckPoint ();
 
-    // don't run the system checks if RunSystem is FALSE
+    // don't run the system checks if RunLevel is FALSE
     // XXX stop should not suspend all checks: we should continue
     // to harvest completed jobs and migrate idle machines to down
-    if (!RunSystem) {
-      usleep (50000); // idle if RunSystem is FALSE
+    if (RunLevel == PCONTROL_RUN_NONE) {
+      usleep (100000); // idle if we are running nothing
       continue;
     }
-
-    Njobchecks = 0;
-    Nhostchecks = 0;
-
-    // we want to give each block a maximum allowed time
-    Nhostchecks += CheckIdleHosts(0.020); /* submit a new job */
-    TestCheckPoint ();
-
-    Njobchecks  += CheckBusyJobs(0.020);  /* get job status */
-    Njobchecks  += CheckDoneJobs(0.020);  /* harvest job stdout/stderr */
-    Njobchecks  += CheckKillJobs(0.020);  /* harvest job stdout/stderr */
-    TestCheckPoint ();
-
-    Nhostchecks += CheckDoneHosts(0.020); /* reset the host */
-    Nhostchecks += CheckDownHosts(0.100); /* launch the host */
-    TestCheckPoint ();
 
     /* always allow at least one test */
     /* most tests require about 2ms per host.  
        CheckDoneJobs must depend on the size of the output buffer */
+    /* the max delay times are fairly arbitrary and do not impact
+       the user interface.
+     */
+
+    Njobchecks = 0;
+    Nhostchecks = 0;
+
+    if ((RunLevel == PCONTROL_RUN_ALL) || (RunLevel == PCONTROL_RUN_REAP)) {
+      Njobchecks  += CheckBusyJobs(0.020);  /* get job status */
+      Njobchecks  += CheckDoneJobs(0.020);  /* harvest job stdout/stderr */
+      Njobchecks  += CheckKillJobs(0.020);  /* harvest job stdout/stderr */
+      TestCheckPoint ();
+    }
+
+    if (RunLevel != PCONTROL_RUN_NONE) {
+      Nhostchecks += CheckDoneHosts(0.020); /* reset the host */
+      Nhostchecks += CheckDownHosts(0.100); /* launch the host */
+      TestCheckPoint ();
+    }
+
+    if (RunLevel == PCONTROL_RUN_ALL) {
+      // we want to give each block a maximum allowed time
+      Nhostchecks += CheckIdleHosts(0.020); /* submit a new job */
+      TestCheckPoint ();
+    }
 
     // there is nothing on the stacks.  test the hosts and wait a bit
-    if (!Njobchecks && !Nhostchecks) {
+    if (!Njobchecks && !Nhostchecks && (RunLevel != PCONTROL_RUN_NONE)) {
       CheckLiveHosts(0.040);
       usleep (100000); // idle if no jobs are waiting
     } 
-
+    
     if (DEBUG) { 
       Stack *stack;
