Index: /trunk/Ohana/src/opihi/pcontrol/CheckIdleHost.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/CheckIdleHost.c	(revision 20323)
+++ /trunk/Ohana/src/opihi/pcontrol/CheckIdleHost.c	(revision 20324)
@@ -1,3 +1,5 @@
 # include "pcontrol.h"
+
+static FILE *logfile = NULL;
 
 /* the supplied host is not on a stack: it cannot be taken by the other thread */
@@ -7,4 +9,8 @@
   Stack *stack;
   Job *job;
+
+  if (logfile == NULL) { 
+    logfile = fopen ("pcontrol.log", "w");
+  }
 
   ASSERT (host, "host not set");
@@ -32,4 +38,6 @@
     host[0].job = (struct Job *) job;
 
+    if (logfile) fprintf (logfile, "start needhost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]);
+
     /* take the job off the stack and unlock the stack */
     RemoveStackEntry (stack, i);
@@ -50,4 +58,6 @@
     host[0].job = (struct Job *) job;
 
+    if (logfile) fprintf (logfile, "start wanthost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]);
+
     /* take the job off the stack and unlock the stack */
     RemoveStackEntry (stack, i);
@@ -66,4 +76,6 @@
     host[0].job = (struct Job *) job;
 
+    if (logfile) fprintf (logfile, "start  anyhost %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]);
+
     /* take the job off the stack and unlock the stack */
     RemoveStackEntry (stack, i);
@@ -80,4 +92,6 @@
     if (job[0].mode != PCONTROL_JOB_WANTHOST) continue;
     // XXX test the job age and skip if too young
+
+    if (logfile) fprintf (logfile, "start wanthost(2) %s (job host %s) : %s\n", host[0].hostname, job[0].hostname, job[0].argv[0]);
 
     /* we have found an appropriate job; link it to the host and send to StartJob */
