[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b3-250-gc0ae22e

Service Account noreply at mpich.org
Thu Jul 16 11:20:29 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  c0ae22e5aed7adb132f5e75f8f542240b51b14d4 (commit)
      from  352e1a4696dd54f07fc6ce506ee9931317a24655 (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/c0ae22e5aed7adb132f5e75f8f542240b51b14d4

commit c0ae22e5aed7adb132f5e75f8f542240b51b14d4
Author: Huiwei Lu <huiweilu at mcs.anl.gov>
Date:   Thu Jul 16 09:17:39 2015 -0500

    Adds tests for threaded collective operations
    
    A new test directory test/mpi/threads/coll is created and two new tests
    are added to this directory. The new tests will test threaded overlapped
    collective operations.
    
    A comprehensive test of these two new test case is still needed. For now,
    the new tests are known to fail with ch3:socket so they are marked as xfail.
    Refs #2108
    
    Signed-off-by: Lena Oden <loden at anl.gov>

diff --git a/test/mpi/.gitignore b/test/mpi/.gitignore
index 86babec..8b72685 100644
--- a/test/mpi/.gitignore
+++ b/test/mpi/.gitignore
@@ -1084,6 +1084,8 @@
 /threads/pt2pt/threads
 /threads/spawn/multispawn
 /threads/spawn/th_taskmaster
+/threads/coll/iallred
+/threads/coll/allred
 /topo/cartcreates
 /topo/cartzero
 /topo/dgraph_unwgt
diff --git a/test/mpi/configure.ac b/test/mpi/configure.ac
index 9408bc1..acc04bf 100644
--- a/test/mpi/configure.ac
+++ b/test/mpi/configure.ac
@@ -1624,6 +1624,7 @@ AC_OUTPUT(maint/testmerge \
           threads/mpi_t/Makefile \
           threads/spawn/Makefile \
           threads/rma/Makefile \
+          threads/coll/Makefile \
           errors/Makefile \
           errors/attr/Makefile \
           errors/basic/Makefile \
diff --git a/test/mpi/threads/Makefile.am b/test/mpi/threads/Makefile.am
index 421d45b..5c4cd47 100644
--- a/test/mpi/threads/Makefile.am
+++ b/test/mpi/threads/Makefile.am
@@ -9,5 +9,5 @@ include $(top_srcdir)/Makefile.mtest
 
 EXTRA_DIST = testlist.in
 
-SUBDIRS = util pt2pt comm init mpi_t $(spawndir) rma
-DIST_SUBDIRS = util pt2pt comm init mpi_t spawn rma
+SUBDIRS = util pt2pt comm init mpi_t $(spawndir) rma coll
+DIST_SUBDIRS = util pt2pt comm init mpi_t spawn rma coll
diff --git a/test/mpi/threads/coll/Makefile.am b/test/mpi/threads/coll/Makefile.am
new file mode 100644
index 0000000..82c994e
--- /dev/null
+++ b/test/mpi/threads/coll/Makefile.am
@@ -0,0 +1,13 @@
+## -*- Mode: Makefile; -*-
+## vim: set ft=automake :
+##
+## (C) 2011 by Argonne National Laboratory.
+##     See COPYRIGHT in top-level directory.
+##
+
+include $(top_srcdir)/threads/Makefile_threads.mtest
+
+EXTRA_DIST = testlist
+
+noinst_PROGRAMS = iallred allred
+
diff --git a/test/mpi/threads/coll/allred.c b/test/mpi/threads/coll/allred.c
new file mode 100644
index 0000000..1e00c78
--- /dev/null
+++ b/test/mpi/threads/coll/allred.c
@@ -0,0 +1,80 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/*
+ * Test threaded overlapped collective operations.
+ *
+ * Create one communicator for each thread, then do collective operation
+ * on the communicator. For different threads on different processes, try to
+ * do the collective in a overlapped order.
+ */
+
+#include <stdio.h>
+#include <mpi.h>
+#include "mpitest.h"
+#include "mpithreadtest.h"
+
+#define NUM_THREADS 2
+#define BUF_SIZE 1024
+
+#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_Comm               comms[NUM_THREADS];
+int                    rank, size;
+
+MTEST_THREAD_RETURN_TYPE test_iallred(void *arg)
+{
+    MPI_Request req;
+    int tid = *(int *) arg;
+    int buf[BUF_SIZE];
+
+    if (tid == rank)
+        MTestSleep(1);
+    MPI_Allreduce(MPI_IN_PLACE, buf, BUF_SIZE, MPI_INT, MPI_BAND, comms[tid]);
+
+    return (MTEST_THREAD_RETURN_TYPE)0;
+}
+
+
+int main(int argc, char **argv)
+{
+    int         thread_args[NUM_THREADS];
+    int         i, provided;
+    int         errs = 0;
+
+    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);
+
+    for (i = 0; i < NUM_THREADS; i++) {
+        MPI_Comm_dup(MPI_COMM_WORLD, &comms[i]);
+    }
+
+    for (i = 0; i < NUM_THREADS; i++) {
+        thread_args[i] = i;
+        MTest_Start_thread( test_iallred, (void *)&thread_args[i] );
+    }
+
+    errs = MTest_Join_threads();
+
+    for (i = 0; i < NUM_THREADS; i++) {
+        MPI_Comm_free(&comms[i]);
+    }
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/test/mpi/threads/coll/iallred.c b/test/mpi/threads/coll/iallred.c
new file mode 100644
index 0000000..e80cfc5
--- /dev/null
+++ b/test/mpi/threads/coll/iallred.c
@@ -0,0 +1,81 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *  (C) 2012 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/*
+ * Test threaded overlapped nonblocking collective operations.
+ *
+ * Create one communicator for each thread, then do collective operation
+ * on the communicator. For different threads on different processes, try to
+ * do the collective in a overlapped order.
+ */
+
+#include <stdio.h>
+#include <mpi.h>
+#include "mpitest.h"
+#include "mpithreadtest.h"
+
+#define NUM_THREADS 2
+#define BUF_SIZE 1024
+
+#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_Comm               comms[NUM_THREADS];
+int                    rank, size;
+
+MTEST_THREAD_RETURN_TYPE test_iallred(void *arg)
+{
+    MPI_Request req;
+    int tid = *(int *) arg;
+    int buf[BUF_SIZE];
+
+    if (tid == rank)
+        MTestSleep(1);
+    MPI_Iallreduce(MPI_IN_PLACE, buf, BUF_SIZE, MPI_INT, MPI_BAND, comms[tid], &req);
+    MPI_Wait(&req, MPI_STATUS_IGNORE);
+
+    return (MTEST_THREAD_RETURN_TYPE)0;
+}
+
+
+int main(int argc, char **argv)
+{
+    int         thread_args[NUM_THREADS];
+    int         i, provided;
+    int         errs = 0;
+
+    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);
+
+    for (i = 0; i < NUM_THREADS; i++) {
+        MPI_Comm_dup(MPI_COMM_WORLD, &comms[i]);
+    }
+
+    for (i = 0; i < NUM_THREADS; i++) {
+        thread_args[i] = i;
+        MTest_Start_thread( test_iallred, (void *)&thread_args[i] );
+    }
+
+    errs = MTest_Join_threads();
+
+    for (i = 0; i < NUM_THREADS; i++) {
+        MPI_Comm_free(&comms[i]);
+    }
+
+    MTest_Finalize(errs);
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/test/mpi/threads/coll/testlist b/test/mpi/threads/coll/testlist
new file mode 100644
index 0000000..f66e46b
--- /dev/null
+++ b/test/mpi/threads/coll/testlist
@@ -0,0 +1,2 @@
+allred 2 xfail=ticket2108
+iallred 2 xfail=ticket2108
diff --git a/test/mpi/threads/testlist.in b/test/mpi/threads/testlist.in
index ac3f3cc..41993e1 100644
--- a/test/mpi/threads/testlist.in
+++ b/test/mpi/threads/testlist.in
@@ -4,3 +4,4 @@ init
 mpi_t
 @spawndir@
 @rmadir@
+coll

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

Summary of changes:
 test/mpi/.gitignore                                |    2 +
 test/mpi/configure.ac                              |    1 +
 test/mpi/threads/Makefile.am                       |    4 +-
 test/mpi/threads/{mpi_t => coll}/Makefile.am       |    2 +-
 .../{comm/comm_create_threads.c => coll/allred.c}  |   52 +++++++++-----------
 .../{comm/comm_create_threads.c => coll/iallred.c} |   53 +++++++++-----------
 test/mpi/threads/coll/testlist                     |    2 +
 test/mpi/threads/testlist.in                       |    1 +
 8 files changed, 56 insertions(+), 61 deletions(-)
 copy test/mpi/threads/{mpi_t => coll}/Makefile.am (87%)
 copy test/mpi/threads/{comm/comm_create_threads.c => coll/allred.c} (58%)
 copy test/mpi/threads/{comm/comm_create_threads.c => coll/iallred.c} (58%)
 create mode 100644 test/mpi/threads/coll/testlist


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list