[mpich2-commits] r7694 - in mpich2/trunk/src/pm/hydra: pm/pmiserv tools/demux

balaji at mcs.anl.gov balaji at mcs.anl.gov
Wed Jan 12 04:08:14 CST 2011


Author: balaji
Date: 2011-01-12 04:08:14 -0600 (Wed, 12 Jan 2011)
New Revision: 7694

Modified:
   mpich2/trunk/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
   mpich2/trunk/src/pm/hydra/tools/demux/demux.c
Log:
Some more changes to the STDIN management. This is not perfect yet, as
we are still not handling the case where a process running in the
background might look for STDIN (in which case it should get an
EOF). That's a random corner case, which we don't support right now.

Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmiserv_cb.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmiserv_cb.c	2011-01-12 09:21:12 UTC (rev 7693)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmiserv_cb.c	2011-01-12 10:08:14 UTC (rev 7694)
@@ -476,33 +476,20 @@
         int stdin_valid;
         struct HYD_pmcd_hdr hdr;
 
-        /* FIXME: The below stdin_valid check is somehow interfering
-         * in the case where the application is run in the background,
-         * but expects some STDIN. The correct behavior is to close
-         * the STDIN socket for the application in that case. However,
-         * mpiexec seems to hang. I'm still investigating this
-         * case. In the meanwhile, I have commented out the stdin
-         * validity check. PLEASE DO NOT DELETE. All other cases
-         * dealing with STDIN seem to be working correctly. */
-#if 0
         status = HYDT_dmx_stdin_valid(&stdin_valid);
         HYDU_ERR_POP(status, "unable to check if stdin is valid\n");
-#else
-        stdin_valid = 1;
-#endif
 
-        if (!stdin_valid) {
+        if (stdin_valid) {
+            status = HYDT_dmx_register_fd(1, &fd_stdin, HYD_POLLIN, proxy, control_cb);
+            HYDU_ERR_POP(status, "unable to register fd\n");
+        }
+        else {
             hdr.cmd = STDIN;
             hdr.buflen = 0;
-
             HYDU_sock_write(proxy->control_fd, &hdr, sizeof(hdr), &count, &closed);
             HYDU_ERR_POP(status, "error writing to control socket\n");
             HYDU_ASSERT(!closed, status);
         }
-        else {
-            status = HYDT_dmx_register_fd(1, &fd_stdin, HYD_POLLIN, proxy, control_cb);
-            HYDU_ERR_POP(status, "unable to register fd\n");
-        }
     }
 
   fn_exit:

Modified: mpich2/trunk/src/pm/hydra/tools/demux/demux.c
===================================================================
--- mpich2/trunk/src/pm/hydra/tools/demux/demux.c	2011-01-12 09:21:12 UTC (rev 7693)
+++ mpich2/trunk/src/pm/hydra/tools/demux/demux.c	2011-01-12 10:08:14 UTC (rev 7694)
@@ -235,7 +235,19 @@
     }
 #endif /* SIGTTIN and HAVE_ISATTY */
 
+    /* FIXME: The below read() check for STDIN validity is somehow
+     * interfering in the case where the application is run in the
+     * background, but expects some STDIN. The correct behavior is to
+     * close the STDIN socket for the application in that
+     * case. However, this seems to hang. I'm still investigating this
+     * case. In the meanwhile, I have commented out this check. PLEASE
+     * DO NOT DELETE. All other cases dealing with STDIN seem to be
+     * working correctly. */
+#if 0
     ret = read(STDIN_FILENO, NULL, 0);
+#else
+    ret = 0;
+#endif
     if (ret < 0 && errno == EINTR && got_sigttin)
         *out = 0;
     else



More information about the mpich2-commits mailing list