[mpich2-commits] r5639 - mpich2/trunk/src/pm/mpd

goodell at mcs.anl.gov goodell at mcs.anl.gov
Fri Oct 30 17:56:01 CDT 2009


Author: goodell
Date: 2009-10-30 17:56:01 -0500 (Fri, 30 Oct 2009)
New Revision: 5639

Modified:
   mpich2/trunk/src/pm/mpd/mpd.py
Log:
Fix mpd process_mapping in another case (ticket #905).

This is yet another band-aid on mpd's process mapping support.  The
right fix is probably just to use hydra and remove this functionality
from mpd.

Reviewed by balaji at .


Modified: mpich2/trunk/src/pm/mpd/mpd.py
===================================================================
--- mpich2/trunk/src/pm/mpd/mpd.py	2009-10-30 21:40:24 UTC (rev 5638)
+++ mpich2/trunk/src/pm/mpd/mpd.py	2009-10-30 22:56:01 UTC (rev 5639)
@@ -864,7 +864,7 @@
         # we only handle two cases for now:
         # 1. block regular
         # 2. round-robin regular
-        # we do handle a "remainder node" that might not be full
+        # we do handle "remainder nodes" that might not be full
         delta = -1
         max_ranks_per_node = 0
         for node_id in node_to_ranks.keys():
@@ -888,6 +888,31 @@
                         return ''
                 last_rank = rank
 
+        # another check (case caught in ticket #905) for layouts like {0:A,1:A,2:B,3:B,4:B}
+        if len(node_to_ranks.keys()) > 1:
+            first_size = len(node_to_ranks[0])
+            last_size  = len(node_to_ranks[len(node_to_ranks.keys())-1])
+            if (last_size > first_size):
+                mpd_print(1, "irregular case C1 detected")
+                return ''
+            in_remainder = False
+            node_ids = node_to_ranks.keys()
+            node_ids.sort()
+            for node_id in node_ids:
+                node_size = len(node_to_ranks[node_id])
+                if not in_remainder:
+                    if node_size == first_size:
+                        pass # OK
+                    elif node_size == last_size:
+                        in_remainder = True
+                    else:
+                        mpd_print(1, "irregular case C2 detected")
+                        return ''
+                else: # in_remainder
+                    if node_size != last_size:
+                        mpd_print(1, "irregular case C3 detected")
+                        return ''
+
         num_nodes = len(node_to_ranks.keys())
         if delta == 1:
             return '(vector,(%d,%d,%d))' % (0,num_nodes,max_ranks_per_node)



More information about the mpich2-commits mailing list