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

Service Account noreply at mpich.org
Fri Aug 14 13:37:30 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  79c28e9386b6b39e2e4451b8a6e06e30b930f386 (commit)
       via  16b8736ec8a487e49ba48e31ed2c3c0c6849a495 (commit)
      from  26988c6a5a3e67e5170da9c9abc828d0e23604b8 (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/79c28e9386b6b39e2e4451b8a6e06e30b930f386

commit 79c28e9386b6b39e2e4451b8a6e06e30b930f386
Author: Lena Oden <loden at anl.gov>
Date:   Thu Aug 6 13:20:33 2015 -0500

    Add a new test overlapping comm_idup with comm_create_group
    
    Since comm_create_group is not a collective operation,
    it is allowed to overlap and interleave it with comm_idup.
    This adds a test for this scenario.
    
    Signed-off-by: Huiwei Lu <huiweilu at mcs.anl.gov>

diff --git a/test/mpi/comm/Makefile.am b/test/mpi/comm/Makefile.am
index 033d400..a864eab 100644
--- a/test/mpi/comm/Makefile.am
+++ b/test/mpi/comm/Makefile.am
@@ -42,4 +42,5 @@ noinst_PROGRAMS =     \
     comm_idup_iallreduce \
     comm_idup_comm    \
     comm_idup_comm2   \
+    comm_create_group_idup \
     comm_info
diff --git a/test/mpi/comm/comm_create_group_idup.c b/test/mpi/comm/comm_create_group_idup.c
new file mode 100644
index 0000000..91de325
--- /dev/null
+++ b/test/mpi/comm/comm_create_group_idup.c
@@ -0,0 +1,54 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2015 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include "mpitestconf.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <assert.h>
+
+int main(int argc, char *argv[])
+{
+    int size, rank;
+    MPI_Group world_group;
+    MPI_Comm group_comm, idup_comm;
+    MPI_Request req;
+    MPI_Init(&argc, &argv);
+
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+    if (size % 2) {
+        fprintf(stderr, "this program requires even number of processes\n");
+        MPI_Abort(MPI_COMM_WORLD, 1);
+    }
+
+    /* Create some groups */
+    MPI_Comm_group(MPI_COMM_WORLD, &world_group);
+
+    if (rank % 2 == 0) {
+        MPI_Comm_create_group(MPI_COMM_WORLD, world_group, 0, &group_comm);
+        MPI_Comm_idup(MPI_COMM_WORLD, &idup_comm, &req);
+    }
+    else {
+        MPI_Comm_idup(MPI_COMM_WORLD, &idup_comm, &req);
+        MPI_Comm_create_group(MPI_COMM_WORLD, world_group, 0, &group_comm);
+    }
+
+    MPI_Wait(&req, MPI_STATUSES_IGNORE);
+    /*Test new comm with a barrier */
+    MPI_Barrier(idup_comm);
+    MPI_Barrier(group_comm);
+
+    MPI_Group_free(&world_group);
+    MPI_Comm_free(&idup_comm);
+    MPI_Comm_free(&group_comm);
+    if (rank == 0)
+        printf(" No errors\n");
+
+    MPI_Finalize();
+    return 0;
+}
diff --git a/test/mpi/comm/testlist b/test/mpi/comm/testlist
index 416237b..c14e078 100644
--- a/test/mpi/comm/testlist
+++ b/test/mpi/comm/testlist
@@ -38,3 +38,4 @@ dup_with_info 2 mpiversion=3.0
 dup_with_info 4 mpiversion=3.0
 dup_with_info 9 mpiversion=3.0
 comm_info 6 mpiversion=3.0
+comm_create_group_idup 4 mpiversion=3.0

http://git.mpich.org/mpich.git/commitdiff/16b8736ec8a487e49ba48e31ed2c3c0c6849a495

commit 16b8736ec8a487e49ba48e31ed2c3c0c6849a495
Author: Lena Oden <loden at anl.gov>
Date:   Wed Aug 5 22:17:21 2015 -0500

    Create new test for multithreaded Comm_create_group
    
    According to the MPI3 standart it is allowed to call MPI_Comm_create_group
    parallel from multiple threads using the same Communicator, as long as
    different tags are used. This is tested by the new test.
    
    Signed-off-by: Huiwei Lu <huiweilu at mcs.anl.gov>

diff --git a/test/mpi/threads/comm/Makefile.am b/test/mpi/threads/comm/Makefile.am
index efc7545..5d0d916 100644
--- a/test/mpi/threads/comm/Makefile.am
+++ b/test/mpi/threads/comm/Makefile.am
@@ -9,5 +9,15 @@ include $(top_srcdir)/threads/Makefile_threads.mtest
 
 EXTRA_DIST = testlist.in
 
-noinst_PROGRAMS = ctxdup dup_leak_test comm_dup_deadlock comm_create_threads comm_create_group_threads comm_idup ctxidup idup_nb idup_comm_gen
+noinst_PROGRAMS =                       \
+            ctxdup                      \
+            dup_leak_test               \
+            comm_dup_deadlock           \
+            comm_create_threads         \
+            comm_create_group_threads   \
+            comm_create_group_threads2  \
+            comm_idup                   \
+            ctxidup                     \
+            idup_nb                     \
+            idup_comm_gen
 
diff --git a/test/mpi/threads/comm/comm_create_group_threads2.c b/test/mpi/threads/comm/comm_create_group_threads2.c
new file mode 100644
index 0000000..9e0a890
--- /dev/null
+++ b/test/mpi/threads/comm/comm_create_group_threads2.c
@@ -0,0 +1,106 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* This test test MPI_Comm_create_group tests calling by multiple threads
+   in parallel, using the same communicator but different tags */
+
+#include <stdio.h>
+#include <mpi.h>
+#include "mpitest.h"
+#include "mpithreadtest.h"
+
+#define NUM_THREADS 4
+#define NUM_ITER    100
+
+#define check(X_)       \
+    do {                \
+        if (!(X_)) {    \
+            printf("[%s:%d] -- Assertion failed: %s\n", __FILE__, __LINE__, #X_);\
+            MPI_Abort(MPI_COMM_WORLD, 1); \
+        }               \
+    } while (0)
+
+MPI_Group global_group;
+
+int rank, size;
+int verbose = 0;
+
+MTEST_THREAD_RETURN_TYPE test_comm_create_group(void *arg)
+{
+    int i;
+    MPI_Group half_group, full_group;
+    int range[1][3];
+    MPI_Comm comm;
+
+    range[0][0] = 0;
+    range[0][1] = size / 2;
+    range[0][2] = 1;
+
+    for (i = 0; i < NUM_ITER; i++) {
+
+        MPI_Comm_group(MPI_COMM_WORLD, &full_group);
+        MPI_Group_range_incl(full_group, 1, range, &half_group);
+        /* Every thread paticipates in a distinct MPI_Comm_create_group,
+         * distinguished by its thread-id (used as the tag).
+         */
+        if (verbose)
+            printf("%d: Thread %d - Comm_create_group %d start\n", rank, *(int *) arg, i);
+        if(rank <= size / 2){
+            MPI_Comm_create_group(MPI_COMM_WORLD, half_group, *(int *) arg /* tag */ , &comm);
+            MPI_Barrier(comm);
+            MPI_Comm_free(&comm);
+        }
+        if (verbose)
+            printf("%d: Thread %d - Comm_create_group %d finish\n", rank, *(int *) arg, i);
+        MPI_Group_free(&half_group);
+        MPI_Group_free(&full_group);
+
+        /* Repeat the test, using the same group */
+        if (verbose)
+            printf("%d: Thread %d - Comm_create_group %d start\n", rank, *(int *) arg, i);
+        MPI_Comm_create_group(MPI_COMM_WORLD, global_group, *(int *) arg /* tag */ , &comm);
+        MPI_Barrier(comm);
+        MPI_Comm_free(&comm);
+        if (verbose)
+            printf("%d: Thread %d - Comm_create_group %d finish\n", rank, *(int *) arg, i);
+
+    }
+
+    if (verbose)
+        printf("%d: Thread %d - Done.\n", rank, *(int *) arg);
+    return NULL;
+}
+
+
+int main(int argc, char **argv)
+{
+    int thread_args[NUM_THREADS];
+    int i, err, provided;
+
+    MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
+
+    check(provided == MPI_THREAD_MULTIPLE);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+
+    MPI_Comm_group(MPI_COMM_WORLD, &global_group);
+
+    for (i = 0; i < NUM_THREADS; i++) {
+        thread_args[i] = i;
+        MTest_Start_thread(test_comm_create_group, (void *) &thread_args[i]);
+    }
+
+    err = MTest_Join_threads();
+
+    MPI_Group_free(&global_group);
+
+    MTest_Finalize(err);
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/test/mpi/threads/comm/testlist.in b/test/mpi/threads/comm/testlist.in
index bbc7f8a..7457ad2 100644
--- a/test/mpi/threads/comm/testlist.in
+++ b/test/mpi/threads/comm/testlist.in
@@ -3,6 +3,7 @@ dup_leak_test 2
 comm_dup_deadlock 4
 comm_create_threads 4
 comm_create_group_threads 4 mpiversion=3.0
+comm_create_group_threads2 4 mpiversion=3.0
 @comm_overlap@ comm_idup 4 mpiversion=3.0
 @comm_overlap@ ctxidup 4 mpiversion=3.0
 idup_nb 4 mpiversion=3.0

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

Summary of changes:
 test/mpi/comm/Makefile.am                          |    1 +
 test/mpi/comm/comm_create_group_idup.c             |   54 +++++++++++++++
 test/mpi/comm/testlist                             |    1 +
 test/mpi/threads/comm/Makefile.am                  |   12 +++-
 ...roup_threads.c => comm_create_group_threads2.c} |   71 +++++++++-----------
 test/mpi/threads/comm/testlist.in                  |    1 +
 6 files changed, 101 insertions(+), 39 deletions(-)
 create mode 100644 test/mpi/comm/comm_create_group_idup.c
 copy test/mpi/threads/comm/{comm_create_group_threads.c => comm_create_group_threads2.c} (54%)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list