[mpich2-commits] r3968 - mpich2/trunk/src/pm/hydra/bootstrap/utils

balaji at mcs.anl.gov balaji at mcs.anl.gov
Sat Mar 7 17:40:05 CST 2009


Author: balaji
Date: 2009-03-07 17:40:05 -0600 (Sat, 07 Mar 2009)
New Revision: 3968

Modified:
   mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_wait.c
Log:
Added some comments on why some things are the way they are, otherwise it's easy to forget.

Modified: mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_wait.c
===================================================================
--- mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_wait.c	2009-03-07 23:22:44 UTC (rev 3967)
+++ mpich2/trunk/src/pm/hydra/bootstrap/utils/bscu_wait.c	2009-03-07 23:40:05 UTC (rev 3968)
@@ -36,8 +36,8 @@
 
     /* We get here only after the I/O sockets have been closed. If the
      * application did not manually close its stdout and stderr
-     * sockets, this means that the processes have terminated. That
-     * means the below loop will return almost immediately. If not, we
+     * sockets, this means that the processes have terminated. In that
+     * case the below loop will return almost immediately. If not, we
      * poll for some time, burning CPU. */
     do {
         pid = waitpid(-1, &ret_status, WNOHANG);
@@ -57,6 +57,13 @@
         }
         if (HYD_CSU_Time_left() == 0)
             break;
+
+        /* FIXME: If we did not break out yet, add a small usleep to
+         * yield CPU here. We can not just sleep for the remaining
+         * time, as the timeout value might be large and the
+         * application might exit much quicker. Note that the
+         * sched_yield() call is broken on newer linux kernel versions
+         * and should not be used. */
     } while (not_completed > 0);
 
     if (not_completed) {



More information about the mpich2-commits mailing list