[dcmf] [PATCH 1/2] Issue 4085: Remove the periods list from the topo routines.

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


These were never used, but only written to.  There really was not a point to having them around.  They were not even correctly initialized, but that doesn't help.  They are only valid in a few cases, and they still wouldn't affect the outcome.

Signed-off-by: Joe Ratterman <jratt at us.ibm.com>
---
 .../src/mpid/dcmf/src/comm/topo/mpid_cart_map.c    |    2 +-
 .../mpich2/src/mpid/dcmf/src/comm/topo/mpid_topo.h |    7 ++++---
 .../mpid/dcmf/src/comm/topo/mpidi_dims_create.c    |    2 +-
 .../mpid/dcmf/src/comm/topo/mpidi_physical_cart.c  |    4 ----
 .../mpid/dcmf/src/comm/topo/mpidi_virtual_cart.c   |    6 +-----
 5 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpid_cart_map.c b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpid_cart_map.c
index 782d8a6..2e56c4b 100644
--- a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpid_cart_map.c
+++ b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpid_cart_map.c
@@ -33,7 +33,7 @@ static int MPIDI_Cart_map_work( const MPID_Comm *comm_ptr,
           goto fn_fail;
       }
 
-    MPIDI_VirtualCart_init( vir_cart, ndims, dims, periods );
+    MPIDI_VirtualCart_init( vir_cart, ndims, dims );
     if (vir_cart->size  > phy_cart->size)
       goto fn_fail;
 
diff --git a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpid_topo.h b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpid_topo.h
index bcab9a9..35e62df 100644
--- a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpid_topo.h
+++ b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpid_topo.h
@@ -32,7 +32,6 @@ typedef struct MPIDI_PhysicalCart_s
     int ndims; /* 3 or 4 */
     int start  [DCMF_CART_MAX_NDIMS];
     int dims   [DCMF_CART_MAX_NDIMS];
-    int periods[DCMF_CART_MAX_NDIMS];
     int coord  [DCMF_CART_MAX_NDIMS];
 
 } MPIDI_PhysicalCart;
@@ -48,13 +47,12 @@ typedef struct MPIDI_VirtualCart_s
     int size;
     int ndims;
     int dims   [DCMF_CART_MAX_NDIMS];
-    int periods[DCMF_CART_MAX_NDIMS];
 
 } MPIDI_VirtualCart;
 
 MPIDI_VirtualCart * MPIDI_VirtualCart_new();
 void                MPIDI_VirtualCart_free( MPIDI_VirtualCart *cart );
-int                 MPIDI_VirtualCart_init( MPIDI_VirtualCart *cart, int ndims, const int dims[], const int periods[] );
+int                 MPIDI_VirtualCart_init( MPIDI_VirtualCart *cart, int ndims, const int dims[] );
 
 /* utilities */
 void                MPIDI_Cart_dims_sort( int ndims, int dims[], int perm[] );
@@ -83,4 +81,7 @@ int MPIDI_Cart_map_1D_snake( MPIDI_VirtualCart *vir_cart,
 int MPIDI_Dims_create_work  ( int nnodes, int ndims, int *dims );
 int MPIDI_Dims_create_nofold( MPIDI_VirtualCart *vir_cart, MPIDI_PhysicalCart *phy_cart );
 
+void MPIDI_PhysicalCart_printf( MPIDI_PhysicalCart *c );
+void MPIDI_VirtualCart_printf( MPIDI_VirtualCart *c );
+
 #endif /* __mpidi_topo_h__ */
diff --git a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_dims_create.c b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_dims_create.c
index 1eca1ac..2b1f987 100644
--- a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_dims_create.c
+++ b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_dims_create.c
@@ -173,7 +173,7 @@ int MPIDI_Dims_create_work( int nnodes, int ndims, int *dims )
     if (ndims  > DCMF_CART_MAX_NDIMS) goto fn_return;
     if (nnodes > phy_cart->size ) goto fn_return;
 
-    MPIDI_VirtualCart_init( vir_cart, ndims, dims, periods );
+    MPIDI_VirtualCart_init( vir_cart, ndims, dims);
     vir_cart->size = nnodes;
     vir_cart->ndims = ndims;
     for(i=0; i<ndims; ++i)
diff --git a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_physical_cart.c b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_physical_cart.c
index 7feb614..28422b4 100644
--- a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_physical_cart.c
+++ b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_physical_cart.c
@@ -97,12 +97,10 @@ int MPIDI_PhysicalCart_init( MPIDI_PhysicalCart *cart, const MPID_Comm *comm )
         for (j=1; j<DCMF_CART_MAX_NDIMS; ++j) {
           cart->start  [j-1] = cart->start  [j];
           cart->dims   [j-1] = cart->dims   [j];
-          cart->periods[j-1] = cart->periods[j];
           cart->coord  [j-1] = cart->coord  [j];
         }
         cart->start  [j-1] = 0;
         cart->dims   [j-1] = 0;
-        cart->periods[j-1] = 0;
         cart->coord  [j-1] = 0;
       }
     else
@@ -119,14 +117,12 @@ void MPIDI_PhysicalCart_printf( MPIDI_PhysicalCart *c )
     {
       printf("  p dims   =<%d,%d,%d,%d>\n",c->dims[0],   c->dims[1],   c->dims[2],   c->dims[3]   );
       printf("  p coord  =<%d,%d,%d,%d>\n",c->coord[0],  c->coord[1],  c->coord[2],  c->coord[3]  );
-      printf("  p periods=<%d,%d,%d,%d>\n",c->periods[0],c->periods[1],c->periods[2],c->periods[3]);
       printf("  p start  =<%d,%d,%d,%d>\n",c->start[0],  c->start[1],  c->start[2],  c->start[3]  );
     }
   else
     {
       printf("  p dims   =<%d,%d,%d>\n",c->dims[0],   c->dims[1],   c->dims[2]   );
       printf("  p coord  =<%d,%d,%d>\n",c->coord[0],  c->coord[1],  c->coord[2]  );
-      printf("  p periods=<%d,%d,%d>\n",c->periods[0],c->periods[1],c->periods[2]);
       printf("  p start  =<%d,%d,%d>\n",c->start[0],  c->start[1],  c->start[2]  );
     }
 }
diff --git a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_virtual_cart.c b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_virtual_cart.c
index 931f7de..693144d 100644
--- a/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_virtual_cart.c
+++ b/lib/mpi/mpich2/src/mpid/dcmf/src/comm/topo/mpidi_virtual_cart.c
@@ -23,7 +23,7 @@ void MPIDI_VirtualCart_free( MPIDI_VirtualCart *cart )
     if (cart != NULL) MPIU_Free (cart);
 }
 
-int MPIDI_VirtualCart_init( MPIDI_VirtualCart *cart, int ndims, const int dims[], const int periods[] )
+int MPIDI_VirtualCart_init( MPIDI_VirtualCart *cart, int ndims, const int dims[] )
 {
     int i;
 
@@ -33,7 +33,6 @@ int MPIDI_VirtualCart_init( MPIDI_VirtualCart *cart, int ndims, const int dims[]
     for (i=0; i<ndims; i++) {
         if (dims[i] > 1) {
             cart->dims   [cart->ndims] = dims[i];
-            cart->periods[cart->ndims] = periods[i];
             cart->size                *= dims[i];
             cart->ndims ++;
         }
@@ -42,7 +41,6 @@ int MPIDI_VirtualCart_init( MPIDI_VirtualCart *cart, int ndims, const int dims[]
     /* fill the garbage space with useful thing */
     for (i=cart->ndims; i<4; i++) {
         cart->dims[i]    = 1;
-        cart->periods[i] = 0;
     }
 
     return 0;
@@ -75,11 +73,9 @@ void MPIDI_VirtualCart_printf( MPIDI_VirtualCart *c )
   if (c->ndims == 4)
     {
       printf("  v dims   =<%d,%d,%d,%d>\n",c->dims[0],   c->dims[1],   c->dims[2],   c->dims[3]   );
-      printf("  v periods=<%d,%d,%d,%d>\n",c->periods[0],c->periods[1],c->periods[2],c->periods[3]);
     }
   else
     {
       printf("  v dims   =<%d,%d,%d>\n",c->dims[0],   c->dims[1],   c->dims[2]   );
-      printf("  v periods=<%d,%d,%d>\n",c->periods[0],c->periods[1],c->periods[2]);
     }
 }
-- 
1.5.4




More information about the dcmf mailing list