[mpich2-commits] r8012 - mpich2/trunk/src/pm/hydra/pm/pmiserv

balaji at mcs.anl.gov balaji at mcs.anl.gov
Tue Feb 22 14:23:30 CST 2011


Author: balaji
Date: 2011-02-22 14:23:30 -0600 (Tue, 22 Feb 2011)
New Revision: 8012

Modified:
   mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.c
   mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.h
   mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_cb.c
   mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_utils.c
Log:
Keep track of forced cleanups. If we force-killed all processes, their
exit statuses are not useful.

No reviewer.

Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.c	2011-02-22 20:23:29 UTC (rev 8011)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.c	2011-02-22 20:23:30 UTC (rev 8012)
@@ -44,6 +44,7 @@
     HYD_pmcd_pmip.downstream.exit_status = NULL;
     HYD_pmcd_pmip.downstream.pmi_rank = NULL;
     HYD_pmcd_pmip.downstream.pmi_fd = NULL;
+    HYD_pmcd_pmip.downstream.forced_cleanup = 0;
 
     HYD_pmcd_pmip.local.id = -1;
     HYD_pmcd_pmip.local.pgid = -1;
@@ -237,13 +238,19 @@
         if (pid > 0)
             for (i = 0; i < HYD_pmcd_pmip.local.proxy_process_count; i++)
                 if (HYD_pmcd_pmip.downstream.pid[i] == pid) {
-                    /* We store the new return status if either the
-                     * exit status is uninitialized, or if the return
-                     * status is non-zero. If the return status is
-                     * zero, and the exit status has already been set
-                     * to a different value, we use that. */
-                    if (ret_status || HYD_pmcd_pmip.downstream.exit_status[i] == -1)
+                    if (HYD_pmcd_pmip.downstream.forced_cleanup) {
+                        /* If it is a forced cleanup, the exit status
+                         * is either already set or we have to ignore
+                         * it */
+                        if (HYD_pmcd_pmip.downstream.exit_status[i] == -1)
+                            HYD_pmcd_pmip.downstream.exit_status[i] = 0;
+                        else
+                            HYD_pmcd_pmip.downstream.exit_status[i] = ret_status;
+                    }
+                    else {
                         HYD_pmcd_pmip.downstream.exit_status[i] = ret_status;
+                    }
+
                     done++;
                 }
 

Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.h
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.h	2011-02-22 20:23:29 UTC (rev 8011)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip.h	2011-02-22 20:23:30 UTC (rev 8012)
@@ -54,6 +54,8 @@
         int *pmi_rank;
         int *pmi_fd;
         int *pmi_fd_active;
+
+        int forced_cleanup;
     } downstream;
 
     /* Proxy details */

Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_cb.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_cb.c	2011-02-22 20:23:29 UTC (rev 8011)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_cb.c	2011-02-22 20:23:30 UTC (rev 8012)
@@ -253,10 +253,11 @@
             status = HYDT_ftb_publish("FTB_MPI_PROCS_DEAD", ftb_event_payload);
             HYDU_ERR_POP(status, "FTB publish failed\n");
 
-            /* Store a temporary erroneous exit status. In case the
-             * application does not return a non-zero exit status, we
-             * will use this. */
-            HYD_pmcd_pmip.downstream.exit_status[pid] = 1;
+            /* If this is not a forced cleanup, store a temporary
+             * erroneous exit status. In case the application does not
+             * return a non-zero exit status, we will use this. */
+            if (HYD_pmcd_pmip.downstream.forced_cleanup == 0)
+                HYD_pmcd_pmip.downstream.exit_status[pid] = 1;
 
             /* Deregister failed socket */
             status = HYDT_dmx_deregister_fd(fd);

Modified: mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_utils.c
===================================================================
--- mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_utils.c	2011-02-22 20:23:29 UTC (rev 8011)
+++ mpich2/trunk/src/pm/hydra/pm/pmiserv/pmip_utils.c	2011-02-22 20:23:30 UTC (rev 8012)
@@ -27,6 +27,8 @@
         }
     }
 
+    HYD_pmcd_pmip.downstream.forced_cleanup = 1;
+
     HYDU_FUNC_EXIT();
 }
 



More information about the mpich2-commits mailing list