[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1rc2-108-g8705856

mysql vizuser noreply at mpich.org
Fri Dec 20 10:44:53 CST 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  870585656310bffa1704f326e8e3aa27f3de478f (commit)
       via  d61dca4b6544480fc23e212192f5fac00f4ae4be (commit)
       via  5b5ddec8d94b0e98a46fce776191b5195deb0a71 (commit)
       via  e212f88ffedd8f0f5250bc7e7bc838ba5d2cb72d (commit)
      from  7c09449967020cbd95a1d2bb8d98ea166b1925a6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/870585656310bffa1704f326e8e3aa27f3de478f

commit 870585656310bffa1704f326e8e3aa27f3de478f
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date:   Fri Dec 20 08:10:36 2013 +0800

    White-space cleanup for redability.

diff --git a/test/mpi/topo/dims3.c b/test/mpi/topo/dims3.c
index a3b51aa..6d25064 100644
--- a/test/mpi/topo/dims3.c
+++ b/test/mpi/topo/dims3.c
@@ -7,31 +7,34 @@
 #include <stdio.h>
 #include "mpitest.h"
 
-static inline void print_err(int *dims, int ndims) {
+static inline void print_err(int *dims, int ndims)
+{
     int i;
 
     printf("[ ");
-    for(i=0; i<ndims; i++) printf("%d ", dims[i]);
+    for (i = 0; i < ndims; i++)
+        printf("%d ", dims[i]);
     printf("] Suboptimal distribution!\n");
 }
 
-
-int main(int argc, char **argv) {
+int main(int argc, char **argv)
+{
     int errs = 0;
     int dims[4], ndims, nnodes;
 
     MTest_Init(&argc, &argv);
 
-    for(ndims=3; ndims <=4; ndims++) {
-        for(nnodes=2; nnodes<=4096; nnodes*=2) {
+    for (ndims = 3; ndims <= 4; ndims++) {
+        for (nnodes = 2; nnodes <= 4096; nnodes *= 2) {
             int i;
-            for(i=0; i<ndims; i++) dims[i] = 0;
+            for (i = 0; i < ndims; i++)
+                dims[i] = 0;
 
             MPI_Dims_create(nnodes, ndims, dims);
 
             /* Checking */
-            for(i=0; i<ndims-1; i++)
-                if(dims[i] / 2 > dims[i+1]) {
+            for (i = 0; i < ndims - 1; i++)
+                if (dims[i] / 2 > dims[i + 1]) {
                     print_err(dims, ndims);
                     ++errs;
                     break;
@@ -39,7 +42,8 @@ int main(int argc, char **argv) {
         }
     }
 
-    MTest_Finalize( errs );
+    MTest_Finalize(errs);
     MPI_Finalize();
+
     return 0;
 }

http://git.mpich.org/mpich.git/commitdiff/d61dca4b6544480fc23e212192f5fac00f4ae4be

commit d61dca4b6544480fc23e212192f5fac00f4ae4be
Author: Antonio J. Pena <apenya at mcs.anl.gov>
Date:   Mon Nov 4 13:34:44 2013 -0600

    Added regression test for ticket #1765
    
    Signed-off-by: Pavan Balaji <balaji at mcs.anl.gov>

diff --git a/test/mpi/topo/Makefile.am b/test/mpi/topo/Makefile.am
index e8bd234..04d0877 100644
--- a/test/mpi/topo/Makefile.am
+++ b/test/mpi/topo/Makefile.am
@@ -20,6 +20,7 @@ noinst_PROGRAMS = \
     cartcreates   \
     dims1         \
     dims2         \
+    dims3         \
     graphmap1     \
     topotest      \
     topodup       \
diff --git a/test/mpi/topo/dims3.c b/test/mpi/topo/dims3.c
new file mode 100644
index 0000000..a3b51aa
--- /dev/null
+++ b/test/mpi/topo/dims3.c
@@ -0,0 +1,45 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+static inline void print_err(int *dims, int ndims) {
+    int i;
+
+    printf("[ ");
+    for(i=0; i<ndims; i++) printf("%d ", dims[i]);
+    printf("] Suboptimal distribution!\n");
+}
+
+
+int main(int argc, char **argv) {
+    int errs = 0;
+    int dims[4], ndims, nnodes;
+
+    MTest_Init(&argc, &argv);
+
+    for(ndims=3; ndims <=4; ndims++) {
+        for(nnodes=2; nnodes<=4096; nnodes*=2) {
+            int i;
+            for(i=0; i<ndims; i++) dims[i] = 0;
+
+            MPI_Dims_create(nnodes, ndims, dims);
+
+            /* Checking */
+            for(i=0; i<ndims-1; i++)
+                if(dims[i] / 2 > dims[i+1]) {
+                    print_err(dims, ndims);
+                    ++errs;
+                    break;
+                }
+        }
+    }
+
+    MTest_Finalize( errs );
+    MPI_Finalize();
+    return 0;
+}
diff --git a/test/mpi/topo/testlist b/test/mpi/topo/testlist
index 8454137..f98ad38 100644
--- a/test/mpi/topo/testlist
+++ b/test/mpi/topo/testlist
@@ -5,6 +5,7 @@ cartsuball 4
 cartcreates 4
 dims1 4
 dims2 1
+dims3 1
 graphmap1 4
 topotest 4
 topodup 4

http://git.mpich.org/mpich.git/commitdiff/5b5ddec8d94b0e98a46fce776191b5195deb0a71

commit 5b5ddec8d94b0e98a46fce776191b5195deb0a71
Author: Antonio J. Pena <apenya at mcs.anl.gov>
Date:   Mon Nov 4 13:33:29 2013 -0600

    Fixed suboptimal distributions in MPI_Dims_create
    
    Fixes #1765. Patch contributed to mpich-discuss by Ian Hutchinson with minor
    style fixes.
    
    Signed-off-by: Pavan Balaji <balaji at mcs.anl.gov>

diff --git a/src/mpi/topo/dims_create.c b/src/mpi/topo/dims_create.c
index b0ea440..6615c11 100644
--- a/src/mpi/topo/dims_create.c
+++ b/src/mpi/topo/dims_create.c
@@ -308,33 +308,23 @@ int MPIR_Dims_create( int nnodes, int ndims, int dims[] )
 	/* We must combine some of the factors */
 	if (nfactors == 1) {
 	    /* Special case for k**n, such as powers of 2 */
-	    int factor = factors[0].val;
-	    int cnt    = factors[0].cnt; /* Numver of factors left */
-	    int cnteach = ( cnt + dims_needed - 1 ) / dims_needed;
-	    int factor_each;
-	    
-	    factor_each = factor;
-	    for (i=1; i<cnteach; i++) factor_each *= factor;
-
-	    for (i=0; i<ndims; i++) {
-		if (dims[i] == 0) {
-		    if (cnt > cnteach) {
-			dims[i] = factor_each;
-			cnt -= cnteach;
-		    }
-		    else if (cnt > 0) {
-			factor_each = factor;
-			for (j=1; j<cnt; j++) 
-			    factor_each *= factor;
-			dims[i] = factor_each;
-			cnt = 0;
-		    }
-		    else {
-			dims[i] = 1;
-		    }
-		}
-	    }
-	}	    
+            int factor = factors[0].val;
+            int cnt    = factors[0].cnt; /* Number of factors left */
+
+            for (i=0;i<ndims;i++)
+                if(dims[i]==0)dims[i]=-1;
+
+            i=0;
+            while (cnt > 0) {
+                if (dims[i] < 0) {
+                    dims[i] = dims[i] * factor;
+                    --cnt;
+                }
+                if (++i >= ndims) i=0;
+            }
+            for (i=0; i<ndims; i++)
+                if (dims[i] < 0) dims[i] = -dims[i];
+        }
 	else {
 	    /* Here is the general case.  */
 	    MPIR_ChooseFactors( nfactors, factors, nnodes, dims_needed, 

http://git.mpich.org/mpich.git/commitdiff/e212f88ffedd8f0f5250bc7e7bc838ba5d2cb72d

commit e212f88ffedd8f0f5250bc7e7bc838ba5d2cb72d
Author: Antonio J. Pena <apenya at mcs.anl.gov>
Date:   Wed Dec 18 09:32:17 2013 -0600

    Removed ancient comments in dims_create.c
    
    Signed-off-by: Pavan Balaji <balaji at mcs.anl.gov>

diff --git a/src/mpi/topo/dims_create.c b/src/mpi/topo/dims_create.c
index bc4863f..b0ea440 100644
--- a/src/mpi/topo/dims_create.c
+++ b/src/mpi/topo/dims_create.c
@@ -306,11 +306,6 @@ int MPIR_Dims_create( int nnodes, int ndims, int dims[] )
     }
     else {
 	/* We must combine some of the factors */
-	/* This is what the fancy code is for in the MPICH-1 code.
-	   If the number of distinct factors is 1 (e.g., a power of 2),
-	   then this code can be much simpler */
-	/* NOT DONE */
-	/* FIXME */
 	if (nfactors == 1) {
 	    /* Special case for k**n, such as powers of 2 */
 	    int factor = factors[0].val;

-----------------------------------------------------------------------

Summary of changes:
 src/mpi/topo/dims_create.c |   47 ++++++++++++++---------------------------
 test/mpi/topo/Makefile.am  |    1 +
 test/mpi/topo/dims3.c      |   49 ++++++++++++++++++++++++++++++++++++++++++++
 test/mpi/topo/testlist     |    1 +
 4 files changed, 67 insertions(+), 31 deletions(-)
 create mode 100644 test/mpi/topo/dims3.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list