[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b4-21-gbc2d576

Service Account noreply at mpich.org
Wed Jul 29 17:46:28 CDT 2015


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  bc2d5761d6bb2b6e863cf6d3fd292e1db2c95072 (commit)
       via  c489333460740ed23e7ff3a6464792581157110d (commit)
      from  9bdaca745b20664c33338811ab603a92c2f8416a (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/bc2d5761d6bb2b6e863cf6d3fd292e1db2c95072

commit bc2d5761d6bb2b6e863cf6d3fd292e1db2c95072
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed Jul 29 15:57:33 2015 -0500

    tsuite: add iterations to threaded alltoall test
    
    Help consistently reproduce a bug related to canceling MPI_ANY_SOURCE
    receives from a matching netmod.
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/test/mpi/threads/pt2pt/alltoall.c b/test/mpi/threads/pt2pt/alltoall.c
index b5c5676..bd33b29 100644
--- a/test/mpi/threads/pt2pt/alltoall.c
+++ b/test/mpi/threads/pt2pt/alltoall.c
@@ -17,6 +17,8 @@
 #define DEBUG(_a)
 #endif
 
+#define NUM_ITER 10000
+
 const int REQ_TAG = 111;
 const int ANS_TAG = 222;
 
@@ -66,7 +68,7 @@ MTEST_THREAD_RETURN_TYPE listener(void *extra)
 int main(int argc, char *argv[])
 {
     int buf = 0;
-    long int i;
+    long int i, j;
 
     MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
 
@@ -78,22 +80,23 @@ int main(int argc, char *argv[])
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
     MPI_Comm_size(MPI_COMM_WORLD, &size);
 
-#ifdef USE_BARRIER
-    MPI_Barrier(MPI_COMM_WORLD);
-#endif
+    for (i = 0; i < NUM_ITER; i++) {
+        /* create listener thread */
+        MTest_Start_thread(listener, NULL);
 
-    /* create listener thread */
-    MTest_Start_thread(listener, NULL);
+        /* no more requests to send
+         * inform other in the group that we have finished */
+        buf = -1;
+        for (j = 0; j < size; ++j) {
+            MPI_Send(&buf, 1, MPI_INT, j, REQ_TAG, MPI_COMM_WORLD);
+        }
 
-    /* no more requests to send
-     * inform other in the group that we have finished */
-    buf = -1;
-    for (i = 0; i < size; ++i) {
-        MPI_Send(&buf, 1, MPI_INT, i, REQ_TAG, MPI_COMM_WORLD);
-    }
+        /* and wait for others to do the same */
+        MTest_Join_threads();
 
-    /* and wait for others to do the same */
-    MTest_Join_threads();
+        /* barrier to avoid deadlock */
+        MPI_Barrier(MPI_COMM_WORLD);
+    }
 
     MPI_Finalize();
 

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

commit c489333460740ed23e7ff3a6464792581157110d
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed Jul 29 15:17:19 2015 -0500

    tsuite: whitespace cleanup
    
    Signed-off-by: Halim Amer <aamer at anl.gov>

diff --git a/test/mpi/threads/pt2pt/alltoall.c b/test/mpi/threads/pt2pt/alltoall.c
index 45200be..b5c5676 100644
--- a/test/mpi/threads/pt2pt/alltoall.c
+++ b/test/mpi/threads/pt2pt/alltoall.c
@@ -1,5 +1,5 @@
 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*  
+/*
  *  (C) 2006 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
@@ -7,7 +7,7 @@
 #include "mpitest.h"
 #include "mpithreadtest.h"
 #ifdef HAVE_UNISTD_H
-    #include <unistd.h>
+#include <unistd.h>
 #endif
 #include <stdio.h>
 
@@ -23,70 +23,73 @@ const int ANS_TAG = 222;
 /* MPI environment description */
 int rank, size, provided;
 
-MTEST_THREAD_RETURN_TYPE listener(void*);
+MTEST_THREAD_RETURN_TYPE listener(void *);
 
-/* 
+/*
    LISTENER THREAD
    it waits for communication from any source (including calling thread)
    messages which it receives have tag REQ_TAG
    thread runs infinite loop which will stop only if every node in the
-   MPI_COMM_WORLD send request containing -1 
+   MPI_COMM_WORLD send request containing -1
 */
-MTEST_THREAD_RETURN_TYPE listener(void*extra) {
+MTEST_THREAD_RETURN_TYPE listener(void *extra)
+{
     int req;
     int source;
     MPI_Status stat;
 
-    int no_fins = 0; /* this must be equal to size to break loop below */
+    int no_fins = 0;            /* this must be equal to size to break loop below */
 
     while (1) {
-	/* wait for request */
-	MPI_Recv(&req, 1, MPI_INT, 
-	 	 MPI_ANY_SOURCE, REQ_TAG, MPI_COMM_WORLD, &stat);
+        /* wait for request */
+        MPI_Recv(&req, 1, MPI_INT, MPI_ANY_SOURCE, REQ_TAG, MPI_COMM_WORLD, &stat);
 
-	/* get request source */
-	source = stat.MPI_SOURCE;
+        /* get request source */
+        source = stat.MPI_SOURCE;
 
-	DEBUG(printf( "node %d got request %d from %d\n", rank, req, source ));
+        DEBUG(printf("node %d got request %d from %d\n", rank, req, source));
+
+        if (req == -1)
+            ++no_fins;  /* one more node finished requesting */
+
+        /* no more requests can arrive */
+        if (no_fins == size)
+            break;
 
-	if (req == -1) ++no_fins; /* one more node finished requesting */
-	
-	/* no more requests can arrive */
-	if (no_fins == size) break;
-	
     }
 
-    DEBUG(printf( "node %d has stopped listener\n", rank ));
+    DEBUG(printf("node %d has stopped listener\n", rank));
     return MTEST_THREAD_RETVAL_IGN;
-} 
+}
 
 
-int main(int argc, char* argv[]) {
+int main(int argc, char *argv[])
+{
     int buf = 0;
     long int i;
-    
+
     MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
 
     if (provided != MPI_THREAD_MULTIPLE) {
-	printf( "This test requires MPI_THREAD_MULTIPLE\n" );
-	MPI_Abort( MPI_COMM_WORLD, 1 );
+        printf("This test requires MPI_THREAD_MULTIPLE\n");
+        MPI_Abort(MPI_COMM_WORLD, 1);
     }
 
     MPI_Comm_rank(MPI_COMM_WORLD, &rank);
     MPI_Comm_size(MPI_COMM_WORLD, &size);
 
 #ifdef USE_BARRIER
-    MPI_Barrier( MPI_COMM_WORLD );
+    MPI_Barrier(MPI_COMM_WORLD);
 #endif
 
     /* create listener thread */
     MTest_Start_thread(listener, NULL);
 
     /* no more requests to send
-       inform other in the group that we have finished */
+     * inform other in the group that we have finished */
     buf = -1;
     for (i = 0; i < size; ++i) {
-	MPI_Send(&buf, 1, MPI_INT, i, REQ_TAG, MPI_COMM_WORLD);
+        MPI_Send(&buf, 1, MPI_INT, i, REQ_TAG, MPI_COMM_WORLD);
     }
 
     /* and wait for others to do the same */
@@ -96,8 +99,8 @@ int main(int argc, char* argv[]) {
 
     /* This program works if it gets here */
     if (rank == 0) {
-	printf( " No Errors\n" );
+        printf(" No Errors\n");
     }
 
     return 0;
-} 
+}

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

Summary of changes:
 test/mpi/threads/pt2pt/alltoall.c |   86 ++++++++++++++++++++-----------------
 1 files changed, 46 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list