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

Service Account noreply at mpich.org
Thu Jul 9 10:53:20 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  6a5ec946e12304fe662b1ef8414557c2182b5b11 (commit)
      from  c77631474f072e86c9fe761c1328c3d4cb8cc4a5 (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/6a5ec946e12304fe662b1ef8414557c2182b5b11

commit 6a5ec946e12304fe662b1ef8414557c2182b5b11
Author: Min Si <msi at il.is.s.u-tokyo.ac.jp>
Date:   Thu Jul 2 16:39:41 2015 -0500

    Rewrote MTest collective wrapper routine.
    
    The MTest collective routine helps MPI coll tests generate blocking and
    non-blocking collective versions from single source code. Previous code
    used PMPI redirection to link coll calls to its nbc implementation. This
    patch rewrote it to avoid PMPI calls in test code.
    
    Coll test can use this routine following three steps.
    1. Include mpicolltest.h.
    2. Use MTest_Collective instead of MPI_Collective (i.e., MPI_Barrier ->
    MTest_Barrier).
    3. Set -DUSE_MTEST_NBC for nbc version in Makefile (see
    test/mpi/coll/Makefile.am).
    
    Signed-off-by: Junchao Zhang <jczhang at mcs.anl.gov>

diff --git a/test/mpi/coll/Makefile.am b/test/mpi/coll/Makefile.am
index 0c1c5e1..b668e6b 100644
--- a/test/mpi/coll/Makefile.am
+++ b/test/mpi/coll/Makefile.am
@@ -119,21 +119,15 @@ bcast_min_datatypes_SOURCES = bcast.c
 bcast_comm_world_CPPFLAGS = -DBCAST_COMM_WORLD_ONLY $(AM_CPPFLAGS)
 bcast_comm_world_SOURCES = bcast.c
 
-# Create tests of the nonblocking collectives by reusing the blocking tests,
-# using the MPI profiling interface to intercept the blocking call and
-# replace it with a MPI_Ixxx/MPI_Wait pair.
+# Generate tests of the nonblocking collectives by reusing the blocking tests.
 nballtoall1_SOURCES = alltoall1.c
-nballtoall1_LDADD   = $(LDADD) ../util/nbc_pmpi_adapter.$(OBJEXT)
+nballtoall1_CPPFLAGS  = -DUSE_MTEST_NBC $(AM_CPPFLAGS)
 nbredscat_SOURCES   = redscat.c
-nbredscat_LDADD     = $(LDADD) ../util/nbc_pmpi_adapter.$(OBJEXT)
+nbredscat_CPPFLAGS     = -DUSE_MTEST_NBC $(AM_CPPFLAGS)
 nbredscat3_SOURCES   = redscat3.c
-nbredscat3_LDADD     = $(LDADD) ../util/nbc_pmpi_adapter.$(OBJEXT)
+nbredscat3_CPPFLAGS     = -DUSE_MTEST_NBC $(AM_CPPFLAGS)
 nbredscatinter_SOURCES   = redscatinter.c
-nbredscatinter_LDADD     = $(LDADD) ../util/nbc_pmpi_adapter.$(OBJEXT)
+nbredscatinter_CPPFLAGS     = -DUSE_MTEST_NBC $(AM_CPPFLAGS)
 nbcoll2_SOURCES = coll2.c
-nbcoll2_LDADD   = $(LDADD) ../util/nbc_pmpi_adapter.$(OBJEXT)
+nbcoll2_CPPFLAGS   = -DUSE_MTEST_NBC $(AM_CPPFLAGS)
 
-# This is here instead of Makefile.mtest because it is only used in this 
-# set of tests
-$(top_builddir)/util/nbc_pmpi_adapter.$(OBJEXT): $(top_srcdir)/util/nbc_pmpi_adapter.c
-	(cd $(top_builddir)/util && $(MAKE) nbc_pmpi_adapter.$(OBJEXT))
diff --git a/test/mpi/coll/alltoall1.c b/test/mpi/coll/alltoall1.c
index cd6d3d8..c17f926 100644
--- a/test/mpi/coll/alltoall1.c
+++ b/test/mpi/coll/alltoall1.c
@@ -8,6 +8,7 @@
 #include <stdio.h>
 #include "mpitest.h"
 #include <stdlib.h>
+#include "mpicolltest.h"
 
 /*
 static char MTEST_Descrip[] = "";
@@ -63,7 +64,7 @@ int main( int argc, char *argv[] )
 		}
 	    }
 
-	    MPI_Alltoall( sendbuf, sendcount, sendtype,
+	    MTest_Alltoall( sendbuf, sendcount, sendtype,
 			  recvbuf, recvcount, recvtype, comm );
 
 	    p = recvbuf;
diff --git a/test/mpi/coll/coll2.c b/test/mpi/coll/coll2.c
index ae08c96..e89828b 100644
--- a/test/mpi/coll/coll2.c
+++ b/test/mpi/coll/coll2.c
@@ -6,6 +6,7 @@
 #include "mpi.h"
 #include <stdio.h>
 #include "mpitest.h"
+#include "mpicolltest.h"
 
 #define MAX_PROCESSES 10
 
@@ -47,7 +48,7 @@ int main( int argc, char **argv )
       /* inefficient allgather */
       for (i=0; i<participants; i++) {
         void *sendbuf = (i == rank ? MPI_IN_PLACE : &table[begin_row][0]);
-	MPI_Gather(sendbuf,              send_count, MPI_INT,
+        MTest_Gather(sendbuf,              send_count, MPI_INT,
 		   &table[0][0],         recv_count, MPI_INT, i, 
 		   MPI_COMM_WORLD );
       }
diff --git a/test/mpi/coll/redscat.c b/test/mpi/coll/redscat.c
index 9214c5d..46d59ba 100644
--- a/test/mpi/coll/redscat.c
+++ b/test/mpi/coll/redscat.c
@@ -15,6 +15,7 @@
 #include "mpi.h"
 #include <stdio.h>
 #include <stdlib.h>
+#include "mpicolltest.h"
 
 int main( int argc, char **argv )
 {
@@ -36,7 +37,7 @@ int main( int argc, char **argv )
     for (i=0; i<size; i++) 
 	recvcounts[i] = 1;
 
-    MPI_Reduce_scatter( sendbuf, &recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
+    MTest_Reduce_scatter( sendbuf, &recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
 
     sumval = size * rank + ((size - 1) * size)/2;
 /* recvbuf should be size * (rank + i) */
diff --git a/test/mpi/coll/redscat3.c b/test/mpi/coll/redscat3.c
index e6057cd..b76774d 100644
--- a/test/mpi/coll/redscat3.c
+++ b/test/mpi/coll/redscat3.c
@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "mpitest.h"
+#include "mpicolltest.h"
 
 /* Limit the number of error reports */
 #define MAX_ERRORS 10
@@ -65,7 +66,7 @@ int main( int argc, char **argv )
 	recvbuf[i] = -1;
     }
 
-    MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
+    MTest_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_INT, MPI_SUM, comm );
 
     sumval = size * rank + ((size - 1) * size)/2;
     /* recvbuf should be size * (rank + i) */
@@ -81,7 +82,7 @@ int main( int argc, char **argv )
     }
 
 #if MTEST_HAVE_MIN_MPI_VERSION(2,2)
-    MPI_Reduce_scatter( MPI_IN_PLACE, sendbuf, recvcounts, MPI_INT, MPI_SUM, 
+    MTest_Reduce_scatter( MPI_IN_PLACE, sendbuf, recvcounts, MPI_INT, MPI_SUM,
 			comm );
 
     sumval = size * rank + ((size - 1) * size)/2;
diff --git a/test/mpi/coll/redscatinter.c b/test/mpi/coll/redscatinter.c
index bebfd8a..38d7e8c 100644
--- a/test/mpi/coll/redscatinter.c
+++ b/test/mpi/coll/redscatinter.c
@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include "mpitest.h"
+#include "mpicolltest.h"
 
 int main( int argc, char **argv )
 {
@@ -83,7 +84,7 @@ int main( int argc, char **argv )
 	    recvbuf[i] = (long long)(-i);
 	}
 	
-	MPI_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_LONG_LONG, MPI_SUM,
+	MTest_Reduce_scatter( sendbuf, recvbuf, recvcounts, MPI_LONG_LONG, MPI_SUM,
 			    comm );
 
 	/* Check received data */
diff --git a/test/mpi/include/mpicolltest.h b/test/mpi/include/mpicolltest.h
new file mode 100644
index 0000000..4e24ab7
--- /dev/null
+++ b/test/mpi/include/mpicolltest.h
@@ -0,0 +1,377 @@
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ * (C) 2015 by Argonne National Laboratory.
+ *     See COPYRIGHT in top-level directory.
+ */
+
+#ifndef MPICOLLTEST_H_INCLUDED
+#define MPICOLLTEST_H_INCLUDED
+
+/* This file defines MTest wrapper functions for MPI collectives.
+ * Test uses MTest_Collective calls that are defined as blocking collective by
+ * default, or as non-blocking version by compiling with -DUSE_MTEST_NBC. */
+
+#include "mpi.h"
+#include "mpitestconf.h"
+
+/* Wrap up MTest_Collective calls by non-blocking collectives.
+ * It requires MPI_VERSION >= 3. */
+#if defined(USE_MTEST_NBC) && MPI_VERSION >= 3
+static inline int MTest_Barrier(MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Ibarrier(comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
+                              MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Ibcast(buffer, count, datatype, root, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                               void *recvbuf, int recvcount, MPI_Datatype recvtype, int root,
+                               MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype,
+                            root, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                                void *recvbuf, const int *recvcounts, const int *displs,
+                                MPI_Datatype recvtype, int root, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs,
+                             recvtype, root, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                                void *recvbuf, int recvcount, MPI_Datatype recvtype, int root,
+                                MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount,
+                             recvtype, root, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
+                                 MPI_Datatype sendtype, void *recvbuf, int recvcount,
+                                 MPI_Datatype recvtype, int root, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf,
+                              recvcount, recvtype, root, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                                  void *recvbuf, int recvcount, MPI_Datatype recvtype,
+                                  MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount,
+                               recvtype, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                                   void *recvbuf, const int *recvcounts, const int *displs,
+                                   MPI_Datatype recvtype, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
+                                displs, recvtype, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                                 void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount,
+                              recvtype, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispls,
+                                  MPI_Datatype sendtype, void *recvbuf, const int *recvcounts,
+                                  const int *rdispls, MPI_Datatype recvtype, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Ialltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf,
+                               recvcounts, rdispls, recvtype, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Alltoallw(const void *sendbuf, const int *sendcounts, const int *sdispls,
+                                  const MPI_Datatype * sendtypes, void *recvbuf,
+                                  const int *recvcounts, const int *rdispls,
+                                  const MPI_Datatype * recvtypes, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf,
+                               recvcounts, rdispls, recvtypes, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
+                               MPI_Op op, int root, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Allreduce(const void *sendbuf, void *recvbuf, int count,
+                                  MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Reduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts,
+                                       MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount,
+                                             MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
+                             MPI_Op op, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Iscan(sendbuf, recvbuf, count, datatype, op, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+
+static inline int MTest_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
+                               MPI_Op op, MPI_Comm comm)
+{
+    int mpi_errno;
+    MPI_Request req = MPI_REQUEST_NULL;
+
+    mpi_errno = MPI_Iexscan(sendbuf, recvbuf, count, datatype, op, comm, &req);
+    if (mpi_errno != MPI_SUCCESS)
+        return mpi_errno;
+    mpi_errno = MPI_Wait(&req, MPI_STATUS_IGNORE);
+    return mpi_errno;
+}
+#else
+/* If USE_MTEST_NBC is not specified, or MPI_VERSION is less than 3,
+ * wrap up MTest_Collective calls by traditional blocking collectives.*/
+
+static inline int MTest_Barrier(MPI_Comm comm)
+{
+    return MPI_Barrier(comm);
+}
+
+static inline int MTest_Bcast(void *buffer, int count, MPI_Datatype datatype, int root,
+                              MPI_Comm comm)
+{
+    return MPI_Bcast(buffer, count, datatype, root, comm);
+}
+
+static inline int MTest_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                               void *recvbuf, int recvcount, MPI_Datatype recvtype, int root,
+                               MPI_Comm comm)
+{
+    return MPI_Gather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
+}
+
+static inline int MTest_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                                void *recvbuf, const int *recvcounts, const int *displs,
+                                MPI_Datatype recvtype, int root, MPI_Comm comm)
+{
+    return MPI_Gatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs,
+                       recvtype, root, comm);
+}
+
+static inline int MTest_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                                void *recvbuf, int recvcount, MPI_Datatype recvtype, int root,
+                                MPI_Comm comm)
+{
+    return MPI_Scatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm);
+}
+
+static inline int MTest_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs,
+                                 MPI_Datatype sendtype, void *recvbuf, int recvcount,
+                                 MPI_Datatype recvtype, int root, MPI_Comm comm)
+{
+    return MPI_Scatterv(sendbuf, sendcounts, displs, sendtype, recvbuf,
+                        recvcount, recvtype, root, comm);
+}
+
+static inline int MTest_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                                  void *recvbuf, int recvcount, MPI_Datatype recvtype,
+                                  MPI_Comm comm)
+{
+    return MPI_Allgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
+}
+
+static inline int MTest_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                                   void *recvbuf, const int *recvcounts, const int *displs,
+                                   MPI_Datatype recvtype, MPI_Comm comm)
+{
+    return MPI_Allgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts,
+                          displs, recvtype, comm);
+}
+
+static inline int MTest_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
+                                 void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
+{
+    return MPI_Alltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm);
+}
+
+static inline int MTest_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispls,
+                                  MPI_Datatype sendtype, void *recvbuf, const int *recvcounts,
+                                  const int *rdispls, MPI_Datatype recvtype, MPI_Comm comm)
+{
+    return MPI_Alltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf,
+                         recvcounts, rdispls, recvtype, comm);
+}
+
+static inline int MTest_Alltoallw(const void *sendbuf, const int *sendcounts, const int *sdispls,
+                                  const MPI_Datatype * sendtypes, void *recvbuf,
+                                  const int *recvcounts, const int *rdispls,
+                                  const MPI_Datatype * recvtypes, MPI_Comm comm)
+{
+    return MPI_Alltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf,
+                         recvcounts, rdispls, recvtypes, comm);
+}
+
+static inline int MTest_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
+                               MPI_Op op, int root, MPI_Comm comm)
+{
+    return MPI_Reduce(sendbuf, recvbuf, count, datatype, op, root, comm);
+}
+
+static inline int MTest_Allreduce(const void *sendbuf, void *recvbuf, int count,
+                                  MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+    return MPI_Allreduce(sendbuf, recvbuf, count, datatype, op, comm);
+}
+
+static inline int MTest_Reduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts,
+                                       MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+    return MPI_Reduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm);
+}
+
+static inline int MTest_Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount,
+                                             MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
+{
+    return MPI_Reduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm);
+}
+
+static inline int MTest_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
+                             MPI_Op op, MPI_Comm comm)
+{
+    return MPI_Scan(sendbuf, recvbuf, count, datatype, op, comm);
+}
+
+static inline int MTest_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype,
+                               MPI_Op op, MPI_Comm comm)
+{
+    return MPI_Exscan(sendbuf, recvbuf, count, datatype, op, comm);
+}
+
+#endif /* USE_MTEST_NBC */
+#endif /* MPICOLLTEST_H_INCLUDED */
diff --git a/test/mpi/util/Makefile.am b/test/mpi/util/Makefile.am
index a31cc70..3a60e0b 100644
--- a/test/mpi/util/Makefile.am
+++ b/test/mpi/util/Makefile.am
@@ -4,16 +4,13 @@ AM_CPPFLAGS = -I${srcdir}/../include -I../include
 mtest.$(OBJEXT): mtest.c
 mtest_datatype.$(OBJEXT): mtest_datatype.c mtest_datatype.h
 dtypes.$(OBJEXT): dtypes.c
-nbc_pmpi_adapter.$(OBJEXT): nbc_pmpi_adapter.c
-all-local: mtest.$(OBJEXT) dtypes.$(OBJEXT) nbc_pmpi_adapter.$(OBJEXT)
+all-local: mtest.$(OBJEXT) dtypes.$(OBJEXT)
 
 EXTRA_PROGRAMS = mtestcheck dtypes
 mtestcheck_SOURCES = mtestcheck.c mtest.c
 
-# exploiting the NBC PMPI adapter is still very much a manual process...
-# mtest_datatype.c and mtest_datatype_gen.c also needed
 # FIXME: mtest_datatype.h belongs with the other include files, in
 # ../include
-EXTRA_DIST = nbc_pmpi_adapter.c mtest_datatype.c mtest_datatype.h \
+EXTRA_DIST = mtest_datatype.c mtest_datatype.h \
 	mtest_datatype_gen.c
 
diff --git a/test/mpi/util/nbc_pmpi_adapter.c b/test/mpi/util/nbc_pmpi_adapter.c
deleted file mode 100644
index 17e6b77..0000000
--- a/test/mpi/util/nbc_pmpi_adapter.c
+++ /dev/null
@@ -1,211 +0,0 @@
-/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
-/*
- *  (C) 2011 by Argonne National Laboratory.
- *      See COPYRIGHT in top-level directory.
- */
-
-/* A PMPI-based "adapter" that intercepts the traditional blocking collective
- * operations and implements them via PMPI_Icollective/PMPI_Wait.  This permits
- * the use of a wide variety of MPI collective test suites and benchmarking
- * programs with the newer nonblocking collectives.
- *
- * Author: Dave Goodell <goodell at mcs.anl.gov>
- */
-
-#include "mpi.h"
-#include "mpitest.h"
-
-/* The test on the MPI_VERISON is needed to check for pre MPI-3 versions
-   of MPICH, which will not include const in declarations or 
-   the non-blocking collectives.  
- */
-#if !defined(USE_STRICT_MPI) && defined(MPICH) && MPI_VERSION >= 3
-
-int MPI_Barrier(MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Ibarrier(comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Bcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Ibcast(buffer, count, datatype, root, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Gather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Igather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Gatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Igatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, root, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Scatter(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Iscatter(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, root, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Scatterv(const void *sendbuf, const int *sendcounts, const int *displs, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Iscatterv(sendbuf, sendcounts, displs, sendtype, recvbuf, recvcount, recvtype, root, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Iallgather(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Allgatherv(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *displs, MPI_Datatype recvtype, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Iallgatherv(sendbuf, sendcount, sendtype, recvbuf, recvcounts, displs, recvtype, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Alltoall(const void *sendbuf, int sendcount, MPI_Datatype sendtype, void *recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Ialltoall(sendbuf, sendcount, sendtype, recvbuf, recvcount, recvtype, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Alltoallv(const void *sendbuf, const int *sendcounts, const int *sdispls, MPI_Datatype sendtype, void *recvbuf, const int *recvcounts, const int *rdispls, MPI_Datatype recvtype, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Ialltoallv(sendbuf, sendcounts, sdispls, sendtype, recvbuf, recvcounts, rdispls, recvtype, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Alltoallw(const void *sendbuf, const int *sendcounts, const int *sdispls, const MPI_Datatype *sendtypes, void *recvbuf, const int *recvcounts, const int *rdispls, const MPI_Datatype *recvtypes, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Ialltoallw(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Reduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Ireduce(sendbuf, recvbuf, count, datatype, op, root, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Allreduce(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Iallreduce(sendbuf, recvbuf, count, datatype, op, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Reduce_scatter(const void *sendbuf, void *recvbuf, const int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Ireduce_scatter(sendbuf, recvbuf, recvcounts, datatype, op, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Reduce_scatter_block(const void *sendbuf, void *recvbuf, int recvcount, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Ireduce_scatter_block(sendbuf, recvbuf, recvcount, datatype, op, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Scan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Iscan(sendbuf, recvbuf, count, datatype, op, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-int MPI_Exscan(const void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)
-{
-    int mpi_errno;
-    MPI_Request req = MPI_REQUEST_NULL;
-
-    mpi_errno = PMPI_Iexscan(sendbuf, recvbuf, count, datatype, op, comm, &req);
-    if (mpi_errno != MPI_SUCCESS) return mpi_errno;
-    mpi_errno = PMPI_Wait(&req, MPI_STATUS_IGNORE);
-    return mpi_errno;
-}
-
-#endif

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

Summary of changes:
 test/mpi/coll/Makefile.am        |   18 +--
 test/mpi/coll/alltoall1.c        |    3 +-
 test/mpi/coll/coll2.c            |    3 +-
 test/mpi/coll/redscat.c          |    3 +-
 test/mpi/coll/redscat3.c         |    5 +-
 test/mpi/coll/redscatinter.c     |    3 +-
 test/mpi/include/mpicolltest.h   |  377 ++++++++++++++++++++++++++++++++++++++
 test/mpi/util/Makefile.am        |    7 +-
 test/mpi/util/nbc_pmpi_adapter.c |  211 ---------------------
 9 files changed, 396 insertions(+), 234 deletions(-)
 create mode 100644 test/mpi/include/mpicolltest.h
 delete mode 100644 test/mpi/util/nbc_pmpi_adapter.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list