[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.0.2-81-g317b2f3

mysql vizuser noreply at mpich.org
Thu Mar 21 15:41:13 CDT 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  317b2f3e7ab4efb58b20cf51e35871d4e88f630e (commit)
       via  a0e9eb583b383f234bedd58a7af9d132dcdd45bf (commit)
       via  803fda10de941c79e2dc1bfbcfe65d0cb68e328f (commit)
      from  5ac51edf49d664d33b4a88fc6a5cebeb51950149 (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/317b2f3e7ab4efb58b20cf51e35871d4e88f630e

commit 317b2f3e7ab4efb58b20cf51e35871d4e88f630e
Author: James Dinan <dinan at mcs.anl.gov>
Date:   Thu Mar 21 11:35:27 2013 -0500

    Fix coll6 test hanging with more than 10 processes
    
    This closes ticket #1798.  Patch provided by Jeff Hammond.
    
    Reviewer: dinan

diff --git a/test/mpi/coll/coll6.c b/test/mpi/coll/coll6.c
index 5691357..6e8ea36 100644
--- a/test/mpi/coll/coll6.c
+++ b/test/mpi/coll/coll6.c
@@ -17,21 +17,23 @@ int main( int argc, char **argv )
     int              participants;
     int              displs[MAX_PROCESSES];
     int              recv_counts[MAX_PROCESSES];
+    MPI_Comm         test_comm;
 
     MTest_Init( &argc, &argv );
     MPI_Comm_rank( MPI_COMM_WORLD, &rank );
     MPI_Comm_size( MPI_COMM_WORLD, &size );
 
     /* A maximum of MAX_PROCESSES processes can participate */
-    if ( size > MAX_PROCESSES ) participants = MAX_PROCESSES;
-    else              participants = size;
-    /* while (MAX_PROCESSES % participants) participants--; */
+    participants = ( size > MAX_PROCESSES ) ? MAX_PROCESSES : size;
+
     if (MAX_PROCESSES % participants) {
 	fprintf( stderr, "Number of processors must divide %d\n",
 		MAX_PROCESSES );
 	MPI_Abort( MPI_COMM_WORLD, 1 );
 	}
-    if ( (rank < participants) ) {
+    MPI_Comm_split(MPI_COMM_WORLD, rank<participants, rank, &test_comm);
+
+    if ( rank < participants ) {
 
       /* Determine what rows are my responsibility */
       int block_size = MAX_PROCESSES / participants;
@@ -53,7 +55,7 @@ int main( int argc, char **argv )
       /* Everybody gets the gathered data */
       MPI_Allgatherv(&table[begin_row][0], send_count, MPI_INT, 
 		     &table[0][0], recv_counts, displs, 
-		     MPI_INT, MPI_COMM_WORLD);
+                     MPI_INT, test_comm);
 
       /* Everybody should have the same table now.
 
@@ -80,6 +82,8 @@ int main( int argc, char **argv )
     } 
 
     MTest_Finalize( errors );
+
+    MPI_Comm_free(&test_comm);
     MPI_Finalize();
     return MTestReturnValue( errors );
 }

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

commit a0e9eb583b383f234bedd58a7af9d132dcdd45bf
Author: James Dinan <dinan at mcs.anl.gov>
Date:   Thu Mar 21 09:23:43 2013 -0500

    Replace calls to sleep with MTestSleep in tests
    
    This replaces calls to non-portable (to e.g. Windows) sleep with calls
    to MTestSleep.  Submitted by Jeff Hammond.  Where possible, dependencies
    on unistd.h have been removed.
    
    Reviewer: dinan

diff --git a/test/mpi/basic/wtime.c b/test/mpi/basic/wtime.c
index bcad008..ec09cb3 100644
--- a/test/mpi/basic/wtime.c
+++ b/test/mpi/basic/wtime.c
@@ -5,7 +5,7 @@
  */
 #include "mpi.h"
 #include <stdio.h>
-#include <unistd.h>
+#include "mpitest.h"
 
 int main(int argc, char *argv[])
 {
@@ -16,7 +16,7 @@ int main(int argc, char *argv[])
 	MPI_Comm_rank(MPI_COMM_WORLD, &i);
 
 	dStart = MPI_Wtime();
-	sleep(1);
+    MTestSleep(1);
 	dFinish = MPI_Wtime();
 	dDuration = dFinish - dStart;
 
diff --git a/test/mpi/errors/faults/pt2ptf2.c b/test/mpi/errors/faults/pt2ptf2.c
index 248eb28..0808ac2 100644
--- a/test/mpi/errors/faults/pt2ptf2.c
+++ b/test/mpi/errors/faults/pt2ptf2.c
@@ -7,7 +7,6 @@
 #include "mpi.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include "mpitest.h"
 
 /*
@@ -49,7 +48,7 @@ int main( int argc, char *argv[] )
     else {
 	/* To improve the chance that the "faulted" processes will have
 	   exited, wait for 1 second */
-	sleep( 1 );
+        MTestSleep( 1 );
     }
     
     /* Can we still use newcomm? */
diff --git a/test/mpi/group/gtranksperf.c b/test/mpi/group/gtranksperf.c
index 9dfb52e..98b79d2 100644
--- a/test/mpi/group/gtranksperf.c
+++ b/test/mpi/group/gtranksperf.c
@@ -9,9 +9,6 @@
 #include "mpitest.h"
 
 #include <math.h> /* for fabs(3) */
-#ifdef HAVE_UNISTD_H
-#include <unistd.h> /* for sleep(3) */
-#endif
 
 /* Measure and compare the relative performance of MPI_Group_translate_ranks
  * with small and large group2 sizes but a constant number of ranks.  This
@@ -89,10 +86,10 @@ int main( int argc, char *argv[] )
     MPI_Barrier(comm);
 
     if (rank != 0) {
-        sleep(10);
+        MTestSleep(10);
     }
     else /* rank==0 */ {
-        sleep(1); /* try to avoid timing while everyone else is making syscalls */
+        MTestSleep(1); /* try to avoid timing while everyone else is making syscalls */
 
         MPI_Group_translate_ranks(grev, size, ranks, gworld, ranksout); /*throwaway iter*/
         start = MPI_Wtime();
diff --git a/test/mpi/manual/mpi_t/nem_fbox_fallback_to_queue_count.c b/test/mpi/manual/mpi_t/nem_fbox_fallback_to_queue_count.c
index c6dec0b..04c1cba 100644
--- a/test/mpi/manual/mpi_t/nem_fbox_fallback_to_queue_count.c
+++ b/test/mpi/manual/mpi_t/nem_fbox_fallback_to_queue_count.c
@@ -19,10 +19,6 @@
 #include <stdio.h>
 #include "mpitest.h"
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
 #define TRY(func)                           \
     do {                                    \
         err = (func);                       \
@@ -41,7 +37,6 @@ MPI_T_pvar_handle fbox_handle;
 /* Check that we can successfuly write to the variable. */
 void blank_test()
 {
-    int i;
     uint64_t temp[2] = { -1 };
 
     temp[0] = 0x1234; temp[1] = 0xABCD;
@@ -92,13 +87,13 @@ void send_first_test()
          * FIXME: Ideally this should use a barrier, but that uses messages
          *        internally and hence will sometimes screw up the asserts above.
          */
-        sleep(1);   
+        MTestSleep(1);
 
     } else if (rank == 1) {
         char recv_buf[BUF_COUNT];
         MPI_Status status;
 
-        sleep(1);   /* see above */
+        MTestSleep(1);   /* see above */
 
         MPI_Recv(recv_buf, BUF_COUNT, MPI_CHAR, 0, 0, MPI_COMM_WORLD, &status);
         MPI_Recv(recv_buf, BUF_COUNT, MPI_CHAR, 0, 0, MPI_COMM_WORLD, &status);
diff --git a/test/mpi/manual/spawntest_master.c b/test/mpi/manual/spawntest_master.c
index 62e87fd..b576649 100644
--- a/test/mpi/manual/spawntest_master.c
+++ b/test/mpi/manual/spawntest_master.c
@@ -11,7 +11,7 @@
 #include "mpi.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
+#include "mpitest.h"
 
 #define NUM_SPAWNS 4
 
@@ -48,11 +48,11 @@ int main( int argc, char *argv[] ) {
   MPI_Comm_free( &allcomm );
   MPI_Comm_disconnect( &intercomm );
 
-  fprintf(stdout, "%s:%d: Sleep starting; children should exit\n",
+  fprintf(stdout, "%s:%d: MTestSleep starting; children should exit\n",
           __FILE__, __LINE__ );fflush(stdout);
-  sleep(30);
+  MTestSleep(30);
   fprintf(stdout, 
-          "%s:%d: Sleep done; all children should have already exited\n", 
+          "%s:%d: MTestSleep done; all children should have already exited\n",
           __FILE__, __LINE__ );fflush(stdout);
 
   MPI_Finalize();
diff --git a/test/mpi/manual/testconnectserial.c b/test/mpi/manual/testconnectserial.c
index 88d3bf4..8e3fc69 100644
--- a/test/mpi/manual/testconnectserial.c
+++ b/test/mpi/manual/testconnectserial.c
@@ -11,6 +11,7 @@
 #include <string.h>
 #include <time.h>
 #include <unistd.h>
+#include "mpitest.h"
 
 #include "connectstuff.h"
 
@@ -119,7 +120,7 @@ int main( int argc, char ** argv ) {
     if( expectedRank == 0 ) {
 
         /* Cleanup on rank zero - delete some files */
-        sleep( 4 );
+        MTestSleep( 4 );
         unlink( actualFname );
         free( actualFname );
         unlink( globalFname );
diff --git a/test/mpi/threads/comm/comm_dup_deadlock.c b/test/mpi/threads/comm/comm_dup_deadlock.c
index c44b8fd..1bfc29a 100644
--- a/test/mpi/threads/comm/comm_dup_deadlock.c
+++ b/test/mpi/threads/comm/comm_dup_deadlock.c
@@ -4,7 +4,6 @@
  *      See COPYRIGHT in top-level directory.
  */
 
-#include <unistd.h>
 #include <stdio.h>
 #include <mpi.h>
 #include "mpitest.h"
@@ -21,10 +20,6 @@
         }               \
     } while (0)
 
-#ifdef HAVE_WINDOWS_H
-#define sleep(a) Sleep(a*1000)
-#endif
-
 MPI_Comm               comms[NUM_THREADS];
 MTEST_THREAD_LOCK_TYPE comm_lock;
 int                    rank, size;
@@ -41,7 +36,7 @@ MTEST_THREAD_RETURN_TYPE test_comm_dup(void *arg)
         MPI_Comm    comm, self_dup;
 
         if (*(int*)arg == rank) {
-            sleep(1);
+            MTestSleep(1);
         }
 
         MTest_thread_lock(&comm_lock);
@@ -66,7 +61,7 @@ MTEST_THREAD_RETURN_TYPE test_comm_dup(void *arg)
 int main(int argc, char **argv)
 {
     int         thread_args[NUM_THREADS];
-    int         i, err, provided;
+    int         i, provided;
 
     MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
 
diff --git a/test/mpi/threads/comm/ctxdup.c b/test/mpi/threads/comm/ctxdup.c
index 3f3a9b3..6d3aaa8 100644
--- a/test/mpi/threads/comm/ctxdup.c
+++ b/test/mpi/threads/comm/ctxdup.c
@@ -7,7 +7,6 @@
 #include "mpi.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include "mpitest.h"
 #include "mpithreadtest.h"
 
@@ -15,10 +14,6 @@
 static char MTEST_Descrip[] = "Creating communications concurrently in different threads";
 */
 
-#ifdef HAVE_WINDOWS_H
-#define sleep(a) Sleep(a*1000)
-#endif
-
 MTEST_THREAD_RETURN_TYPE dup_thread(void *);
 
 MTEST_THREAD_RETURN_TYPE dup_thread(void *p)
@@ -88,7 +83,7 @@ int main( int argc, char *argv[] )
     /* If we're odd, send to our new thread and then delay */
     if (rank & 0x1) {
 	MPI_Ssend( buffer, 0, MPI_INT, rank, 0, MPI_COMM_WORLD );
-	sleep(1);
+	MTestSleep(1);
     }
     MPI_Comm_dup( comm1, &comm4 );
 

http://git.mpich.org/mpich.git/commitdiff/803fda10de941c79e2dc1bfbcfe65d0cb68e328f

commit 803fda10de941c79e2dc1bfbcfe65d0cb68e328f
Author: James Dinan <dinan at mcs.anl.gov>
Date:   Tue Mar 19 20:31:46 2013 -0500

    Fix Irecv race in wait/test_all/any/some err tests
    
    This fixes a race in the ERR_IN_STATUS tests for wait/test_all/any/some
    tests.  In these tests, there was a race that could cause the tested
    error to occur within the Irecv call, rather than the wait/test call
    (expected behavior).  This race was happening when MPICH_ASYNC_PROGRESS
    was enabled.  It should be noted that tests tests still rely on
    non-standard behavior, in particular some/any calls are expected to
    complete all operations.  This closes ticket #1802.
    
    Reviewer: balaji

diff --git a/test/mpi/errors/pt2pt/errinstatta.c b/test/mpi/errors/pt2pt/errinstatta.c
index 861507f..49929bd 100644
--- a/test/mpi/errors/pt2pt/errinstatta.c
+++ b/test/mpi/errors/pt2pt/errinstatta.c
@@ -47,7 +47,19 @@ int main( int argc, char *argv[] )
 	    printf( "Error returned from Irecv\n" );
 	}
 
-	/* synchronize */
+        /* Wait for Irecvs to be posted before the sender calls send.  This
+         * prevents the operation from completing and returning an error in the
+         * Irecv. */
+        errval = MPI_Recv(NULL, 0, MPI_INT, src, 100, comm, MPI_STATUS_IGNORE);
+        if (errval) {
+            errs++;
+            MTestPrintError( errval );
+            printf( "Error returned from Recv\n" );
+        }
+
+        /* Wait for sends to complete at the sender before proceeding */
+        /* WARNING: This does not guarantee that the sends are ready to
+         * complete at the receiver. */
 	errval = MPI_Recv(NULL, 0, MPI_INT, src, 10, comm, MPI_STATUS_IGNORE);
 	if (errval) {
 	    errs++;
@@ -57,6 +69,9 @@ int main( int argc, char *argv[] )
 	for (i=0; i<2; i++) {
 	    s[i].MPI_ERROR = -1;
 	}
+
+        /* WARNING: The following assumes that Testall will complete both
+         * send/irecv pairs.  This is *not* guaranteed by the MPI standard. */
 	errval = MPI_Testall( 2, r, &flag, s );
 	MPI_Error_class( errval, &errclass );
 	if (errclass != MPI_ERR_IN_STATUS) {
@@ -84,12 +99,15 @@ int main( int argc, char *argv[] )
 
     }
     else if (rank == src) {
+        /* Wait for Irecvs to be posted before the sender calls send */
+        MPI_Ssend( NULL, 0, MPI_INT, dest, 100, comm );
+
 	/* Send test messages, then send another message so that the test does
 	   not start until we are sure that the sends have begun */
 	MPI_Send( b1, 10, MPI_INT, dest, 0, comm );
 	MPI_Send( b2, 11, MPI_INT, dest, 10, comm );
 
-	/* synchronize */
+        /* Wait for sends to complete before proceeding to the testsome. */
 	MPI_Ssend( NULL, 0, MPI_INT, dest, 10, comm );
     }
 
diff --git a/test/mpi/errors/pt2pt/errinstatts.c b/test/mpi/errors/pt2pt/errinstatts.c
index e588373..dd247f2 100644
--- a/test/mpi/errors/pt2pt/errinstatts.c
+++ b/test/mpi/errors/pt2pt/errinstatts.c
@@ -49,7 +49,19 @@ int main( int argc, char *argv[] )
 	    printf( "Error returned from Irecv\n" );
 	}
 
-	/* synchronize */
+        /* Wait for Irecvs to be posted before the sender calls send.  This
+         * prevents the operation from completing and returning an error in the
+         * Irecv. */
+        errval = MPI_Recv(NULL, 0, MPI_INT, src, 100, comm, MPI_STATUS_IGNORE);
+        if (errval) {
+            errs++;
+            MTestPrintError( errval );
+            printf( "Error returned from Recv\n" );
+        }
+
+        /* Wait for sends to complete at the sender before proceeding */
+        /* WARNING: This does not guarantee that the sends are ready to
+         * complete at the receiver. */
 	errval = MPI_Recv(NULL, 0, MPI_INT, src, 10, comm, MPI_STATUS_IGNORE);
 	if (errval) {
 	    errs++;
@@ -59,6 +71,9 @@ int main( int argc, char *argv[] )
 	for (i=0; i<2; i++) {
 	    s[i].MPI_ERROR = -1;
 	}
+
+        /* WARNING: The following assumes that Testsome will complete both
+         * send/irecv pairs.  This is *not* guaranteed by the MPI standard. */
 	errval = MPI_Testsome( 2, r, &outcount, indices, s );
 	MPI_Error_class( errval, &errclass );
 	if (errclass != MPI_ERR_IN_STATUS) {
@@ -89,12 +104,15 @@ int main( int argc, char *argv[] )
 
     }
     else if (rank == src) {
+        /* Wait for Irecvs to be posted before the sender calls send */
+        MPI_Ssend( NULL, 0, MPI_INT, dest, 100, comm );
+
 	/* Send test messages, then send another message so that the test does
 	   not start until we are sure that the sends have begun */
 	MPI_Send( b1, 10, MPI_INT, dest, 0, comm );
 	MPI_Send( b2, 11, MPI_INT, dest, 10, comm );
 
-	/* synchronize */
+        /* Wait for sends to complete before proceeding to the testsome. */
 	MPI_Ssend( NULL, 0, MPI_INT, dest, 10, comm );
     }
 
diff --git a/test/mpi/errors/pt2pt/errinstatwa.c b/test/mpi/errors/pt2pt/errinstatwa.c
index 98a70ec..99308e4 100644
--- a/test/mpi/errors/pt2pt/errinstatwa.c
+++ b/test/mpi/errors/pt2pt/errinstatwa.c
@@ -48,7 +48,16 @@ int main( int argc, char *argv[] )
 	    printf( "Error returned from Irecv\n" );
 	}
 
-	errval = MPI_Barrier(comm);
+        /* Wait for Irecvs to be posted before the sender calls send.  This
+         * prevents the operation from completing and returning an error in the
+         * Irecv. */
+        errval = MPI_Recv(NULL, 0, MPI_INT, src, 100, comm, MPI_STATUS_IGNORE);
+        if (errval) {
+            errs++;
+            MTestPrintError( errval );
+            printf( "Error returned from Recv\n" );
+        }
+
 	if (errval) {
 	    errs++;
 	    MTestPrintError( errval );
@@ -89,14 +98,11 @@ int main( int argc, char *argv[] )
 
     }
     else if (rank == src) {
-	/* Send messages, then barrier so that the wait does not start 
-	   until we are sure that the sends have begun */
+        /* Wait for Irecvs to be posted before the sender calls send */
+        MPI_Ssend( NULL, 0, MPI_INT, dest, 100, comm );
+
 	MPI_Send( b1, 10, MPI_INT, dest, 0, comm );
 	MPI_Send( b2, 11, MPI_INT, dest, 10, comm );
-	MPI_Barrier(comm);
-    }
-    else {
-	MPI_Barrier(comm);
     }
 
     MTest_Finalize( errs );
diff --git a/test/mpi/errors/pt2pt/errinstatws.c b/test/mpi/errors/pt2pt/errinstatws.c
index 21f0243..002d781 100644
--- a/test/mpi/errors/pt2pt/errinstatws.c
+++ b/test/mpi/errors/pt2pt/errinstatws.c
@@ -49,7 +49,19 @@ int main( int argc, char *argv[] )
 	    printf( "Error returned from Irecv\n" );
 	}
 
-	/* synchronize */
+        /* Wait for Irecvs to be posted before the sender calls send.  This
+         * prevents the operation from completing and returning an error in the
+         * Irecv. */
+        errval = MPI_Recv(NULL, 0, MPI_INT, src, 100, comm, MPI_STATUS_IGNORE);
+        if (errval) {
+            errs++;
+            MTestPrintError( errval );
+            printf( "Error returned from Recv\n" );
+        }
+
+        /* Wait for sends to complete at the sender before proceeding */
+        /* WARNING: This does not guarantee that the sends are ready to
+         * complete at the receiver. */
 	errval = MPI_Recv(NULL, 0, MPI_INT, src, 10, comm, MPI_STATUS_IGNORE);
 	if (errval) {
 	    errs++;
@@ -59,6 +71,9 @@ int main( int argc, char *argv[] )
 	for (i=0; i<2; i++) {
 	    s[i].MPI_ERROR = -1;
 	}
+
+        /* WARNING: The following assumes that Waitsome will complete both
+         * send/irecv pairs.  This is *not* guaranteed by the MPI standard. */
 	errval = MPI_Waitsome( 2, r, &outcount, indices, s );
 	MPI_Error_class( errval, &errclass );
 	if (errclass != MPI_ERR_IN_STATUS) {
@@ -88,12 +103,15 @@ int main( int argc, char *argv[] )
 
     }
     else if (rank == src) {
+        /* Wait for Irecvs to be posted before the sender calls send */
+        MPI_Ssend( NULL, 0, MPI_INT, dest, 100, comm );
+
 	/* Send test messages, then send another message so that the test does
 	   not start until we are sure that the sends have begun */
 	MPI_Send( b1, 10, MPI_INT, dest, 0, comm );
 	MPI_Send( b2, 11, MPI_INT, dest, 10, comm );
 
-	/* synchronize */
+        /* Wait for sends to complete before proceeding to the testsome. */
 	MPI_Ssend( NULL, 0, MPI_INT, dest, 10, comm );
     }
 

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

Summary of changes:
 test/mpi/basic/wtime.c                             |    4 +-
 test/mpi/coll/coll6.c                              |   14 ++++++++----
 test/mpi/errors/faults/pt2ptf2.c                   |    3 +-
 test/mpi/errors/pt2pt/errinstatta.c                |   22 ++++++++++++++++++-
 test/mpi/errors/pt2pt/errinstatts.c                |   22 ++++++++++++++++++-
 test/mpi/errors/pt2pt/errinstatwa.c                |   20 +++++++++++------
 test/mpi/errors/pt2pt/errinstatws.c                |   22 ++++++++++++++++++-
 test/mpi/group/gtranksperf.c                       |    7 +----
 .../mpi_t/nem_fbox_fallback_to_queue_count.c       |    9 +------
 test/mpi/manual/spawntest_master.c                 |    8 +++---
 test/mpi/manual/testconnectserial.c                |    3 +-
 test/mpi/threads/comm/comm_dup_deadlock.c          |    9 +------
 test/mpi/threads/comm/ctxdup.c                     |    7 +-----
 13 files changed, 98 insertions(+), 52 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list