[dcmf] [PATCH 2/2] Issue 4085: Fix the topo routines.

Joe Ratterman jratt at us.ibm.com
Tue Feb 12 14:57:19 CST 2008


The permutation array was hanging around in a place it didn't belong.

When embedding the T dimension into another real dimension (3D virt over 4D phys), the t-start was not correctly subtracted from the t-coord.

The folding routines *never* subtracted the starting coordinates.

Signed-off-by: Joe Ratterman <jratt at us.ibm.com>
---
 .../mpid/dcmf/src/comm/topo/mpidi_cart_map_fold.c  |    6 +++---
 .../dcmf/src/comm/topo/mpidi_cart_map_nofold.c     |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_cart_map_fold.c b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_cart_map_fold.c
index 335c43d..092e447 100644
--- a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_cart_map_fold.c
+++ b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_cart_map_fold.c
@@ -421,7 +421,7 @@ int MPIDI_Cart_map_fold( MPIDI_VirtualCart *vir_cart,
             for (j=0; j<vir_cart->ndims; j++) if (j!=i) d1[j] = vir_cart->dims[vir_perm[j]];
 
             for (j=0; j<3; j++) {
-                c2[j] = phy_cart->coord[phy_perm[j]];
+                c2[j] = phy_cart->coord[phy_perm[j]] - phy_cart->start[phy_perm[j]];
                 d2[j] = phy_cart->dims [phy_perm[j]];
                 c1[j] = 0;
             }
@@ -429,7 +429,7 @@ int MPIDI_Cart_map_fold( MPIDI_VirtualCart *vir_cart,
             if (perm_dims_match( vir_cart->ndims, d1, c1, 3, d2, c2 )) continue;
 
             for (j=0; j<3; j++) if (j!=i) cc[vir_perm[j]] = c1[j];
-            cc[vir_perm[i]] = c1[i] * 2 + phy_cart->coord[3];
+            cc[vir_perm[i]] = c1[i] * 2 + (phy_cart->coord[3] - phy_cart->start[3]);
             notdone = 0;
             break;
         }
@@ -453,7 +453,7 @@ int MPIDI_Cart_map_fold( MPIDI_VirtualCart *vir_cart,
 
         for (j=0; j<vir_ndims; j++) d1[j] = vir_cart->dims[vir_perm[j]];
         for (j=0; j<3; j++) {
-            c2[j] = phy_cart->coord[phy_perm[j]];
+            c2[j] = phy_cart->coord[phy_perm[j]] - phy_cart->start[phy_perm[j]];
             d2[j] = phy_cart->dims [phy_perm[j]];
             c1[j] = 0;
         }
diff --git a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_cart_map_nofold.c b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_cart_map_nofold.c
index 4532649..1d59498 100644
--- a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_cart_map_nofold.c
+++ b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_cart_map_nofold.c
@@ -86,9 +86,9 @@ int MPIDI_Cart_map_nofold( MPIDI_VirtualCart *vir_cart,
             {
               int temp[DCMF_CART_MAX_NDIMS];
               for (i=0; i<vir_cart->ndims; i++)
-                  temp[ i ] = phy_cart->coord[ i+1 ] - phy_cart->start[ phy_perm[i]+1 ];
+                  temp[ i ] = phy_cart->coord[ i+1 ] - phy_cart->start[ i+1 ];
               /* fill the T dimension in here */
-              temp[ thedim ] = temp[ thedim ] * phy_cart->dims[0] + phy_cart->coord[0];
+              temp[ thedim ] = temp[ thedim ] * phy_cart->dims[0] + (phy_cart->coord[0] - phy_cart->start[0]);
               for (i=0; i<vir_cart->ndims; i++)
                   rcoord[ vir_perm[i] ] = temp[ phy_perm[i] ];
             }
-- 
1.5.4




More information about the dcmf mailing list