[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b2-42-gb6b638a

Service Account noreply at mpich.org
Fri May 22 11:27:06 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  b6b638afede62b245d307d7dfa7dab67364ee8f7 (commit)
       via  465684106f7545d7cd3bf068c021dc218bc0bb2b (commit)
      from  f08d09bc32bde098cdf1a8ac32a2e876e466ebe0 (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/b6b638afede62b245d307d7dfa7dab67364ee8f7

commit b6b638afede62b245d307d7dfa7dab67364ee8f7
Author: Antonio J. Pena <apenya at mcs.anl.gov>
Date:   Thu May 21 13:41:15 2015 -0500

    Fixed the test threads/spawn/th_taskmaster
    
    According to the standard, collectives using the same communicator must
    implement thread safety in the application level. So, if using
    MPI_Comm_spawn in THREAD_MULTIPLE safety level, it must use different
    communicators.
    
    I've modified the test to use different communicators per thread so that
    we can still test its thread safety.
    
    Fixes #2256

diff --git a/test/mpi/threads/spawn/th_taskmaster.c b/test/mpi/threads/spawn/th_taskmaster.c
index a8f6536..3bb3f58 100644
--- a/test/mpi/threads/spawn/th_taskmaster.c
+++ b/test/mpi/threads/spawn/th_taskmaster.c
@@ -14,6 +14,9 @@
 
 int comm_world_rank;
 int comm_world_size;
+#ifdef USE_THREADS
+MPI_Comm th_comms[DEFAULT_TASK_WINDOW];
+#endif
 
 #define CHECK_SUCCESS(status) \
 { \
@@ -28,7 +31,7 @@ void process_spawn(MPI_Comm * comm, int thread_id)
 {
     CHECK_SUCCESS(MPI_Comm_spawn((char*)"./th_taskmaster", (char **)NULL,
 				 1, MPI_INFO_NULL, 0,
-				 MPI_COMM_WORLD, comm, NULL));
+                                 th_comms[thread_id], comm, NULL));
 }
 
 void process_disconnect(MPI_Comm * comm, int thread_id);
@@ -101,6 +104,10 @@ int main(int argc, char *argv[])
 #endif /* USE_THREADS */
 
 #ifdef USE_THREADS
+        /* We need different communicators per thread */
+        for (i = 0; i < DEFAULT_TASK_WINDOW; i++)
+            CHECK_SUCCESS(MPI_Comm_dup(MPI_COMM_WORLD, &th_comms[i]));
+
 	/* Create a thread for each task. Each thread will spawn a
 	 * child process to perform its task. */
 	for (i = 0; i < tasks;) {
@@ -110,6 +117,9 @@ int main(int argc, char *argv[])
         MTest_Join_threads();
 	    i += DEFAULT_TASK_WINDOW;
 	}
+
+        for (i = 0; i < DEFAULT_TASK_WINDOW; i++)
+            CHECK_SUCCESS(MPI_Comm_free(&th_comms[i]));
 #else
 	/* Directly spawn a child process to perform each task */
 	for (i = 0; i < tasks;) {

http://git.mpich.org/mpich.git/commitdiff/465684106f7545d7cd3bf068c021dc218bc0bb2b

commit 465684106f7545d7cd3bf068c021dc218bc0bb2b
Author: Antonio J. Pena <apenya at mcs.anl.gov>
Date:   Thu May 21 16:34:36 2015 -0500

    Destroy the handle mutex on finalize
    
    It was created but never destroyed.

diff --git a/src/mpi/init/initthread.c b/src/mpi/init/initthread.c
index aaf20c8..6be0c7b 100644
--- a/src/mpi/init/initthread.c
+++ b/src/mpi/init/initthread.c
@@ -250,6 +250,8 @@ int MPIR_Thread_CS_Finalize( void )
 /* There is a single, global lock, held for the duration of an MPI call */
     MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.global_mutex, &err);
     MPIU_Assert(err == 0);
+    MPID_Thread_mutex_destroy(&MPIR_ThreadInfo.handle_mutex, &err);
+    MPIU_Assert(err == 0);
 
 #elif MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT
     /* MPIU_THREAD_GRANULARITY_PER_OBJECT: There are multiple locks,

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

Summary of changes:
 src/mpi/init/initthread.c              |    2 ++
 test/mpi/threads/spawn/th_taskmaster.c |   12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list