[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1-2-gd5b73df
Service Account
noreply at mpich.org
Thu Feb 20 13:54:42 CST 2014
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 d5b73dfd501b59baecb718dfbe7c09b632ed1e2a (commit)
via df03ffd5bb1387633e9d53016bd60a9034d8bc40 (commit)
from 82f13590e34c406d76fc6ce6648cefa8d708d300 (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/d5b73dfd501b59baecb718dfbe7c09b632ed1e2a
commit d5b73dfd501b59baecb718dfbe7c09b632ed1e2a
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date: Tue Feb 18 15:58:15 2014 -0600
Added a new test for Reduce_scatter_block in C++.
Signed-off-by: Wesley Bland <wbland at mcs.anl.gov>
diff --git a/test/mpi/cxx/coll/Makefile.am b/test/mpi/cxx/coll/Makefile.am
index 2bd72a9..a2723b0 100644
--- a/test/mpi/cxx/coll/Makefile.am
+++ b/test/mpi/cxx/coll/Makefile.am
@@ -28,7 +28,8 @@ noinst_PROGRAMS = \
icreducex \
icalltoallx \
alltoallw2x \
- reduceboolx
+ reduceboolx \
+ redscatblk
arcomplex_SOURCES = arcomplex.cxx
uallredx_SOURCES = uallredx.cxx
@@ -49,4 +50,4 @@ icreducex_SOURCES = icreducex.cxx
icalltoallx_SOURCES = icalltoallx.cxx
alltoallw2x_SOURCES = alltoallw2x.cxx
reduceboolx_SOURCES = reduceboolx.cxx
-
+redscatblk_SOURCES = redscatblk.cxx
diff --git a/test/mpi/cxx/coll/redscatblk.cxx b/test/mpi/cxx/coll/redscatblk.cxx
new file mode 100644
index 0000000..edfa71f
--- /dev/null
+++ b/test/mpi/cxx/coll/redscatblk.cxx
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ * (C) 2014 by Argonne National Laboratory.
+ * See COPYRIGHT in top-level directory.
+ */
+/*
+ * Test of reduce scatter with large data (needed in MPICH to trigger the
+ * long-data algorithm)
+ *
+ * Each processor contributes its rank + the index to the reduction,
+ * then receives the ith sum
+ *
+ * Can be called with any number of processors.
+ */
+
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(int argc, char **argv)
+{
+ int err = 0;
+ int *sendbuf, *recvbuf;
+ int size, rank, i, j, idx, mycount, sumval;
+
+ MPI::Init();
+
+ size = MPI::COMM_WORLD.Get_size();
+ rank = MPI::COMM_WORLD.Get_rank();
+
+ mycount = (1024 * 1024) / size;
+
+ sendbuf = new int[mycount * size];
+ idx = 0;
+ for (i = 0; i < size; i++) {
+ for (j = 0; j < mycount; j++) {
+ sendbuf[idx++] = rank + i;
+ }
+ }
+ recvbuf = new int[mycount];
+
+ MPI::COMM_WORLD.Reduce_scatter_block(sendbuf, recvbuf, mycount, MPI::INT, MPI::SUM);
+
+ sumval = size * rank + ((size - 1) * size) / 2;
+ /* recvbuf should be size * (rank + i) */
+ for (i = 0; i < mycount; i++) {
+ if (recvbuf[i] != sumval) {
+ err++;
+ fprintf(stdout, "Did not get expected value for reduce scatter\n");
+ fprintf(stdout, "[%d] Got %d expected %d\n", rank, recvbuf[i], sumval);
+ }
+ }
+
+ MPI::COMM_WORLD.Reduce_scatter_block(MPI_IN_PLACE, sendbuf, mycount, MPI::INT, MPI::SUM);
+
+ sumval = size * rank + ((size - 1) * size) / 2;
+ /* recv'ed values for my process should be size * (rank + i) */
+ for (i = 0; i < mycount; i++) {
+ if (sendbuf[rank * mycount + i] != sumval) {
+ err++;
+ fprintf(stdout, "Did not get expected value for reduce scatter (in place)\n");
+ fprintf(stdout, "[%d] Got %d expected %d\n", rank, sendbuf[rank * mycount + i], sumval);
+ }
+ }
+
+ delete [] sendbuf;
+ delete [] recvbuf;
+
+ MPI_Finalize();
+
+ if (err == 0 && rank == 0)
+ printf(" No Errors\n");
+
+ return 0;
+}
diff --git a/test/mpi/cxx/coll/testlist b/test/mpi/cxx/coll/testlist
index cf7f7bf..2c0b9e1 100644
--- a/test/mpi/cxx/coll/testlist
+++ b/test/mpi/cxx/coll/testlist
@@ -18,3 +18,4 @@ icgathervx 5
icscattervx 5
icalltoallx 5
reduceboolx 5
+redscatblk 4 mpiversion=2.2
http://git.mpich.org/mpich.git/commitdiff/df03ffd5bb1387633e9d53016bd60a9034d8bc40
commit df03ffd5bb1387633e9d53016bd60a9034d8bc40
Author: Pavan Balaji <balaji at mcs.anl.gov>
Date: Fri Feb 14 13:23:24 2014 -0600
Remove MPIX_ usage for program internal function names.
MPIX_ is used for non-MPI functionality exposed by MPICH.
Signed-off-by: Wesley Bland <wbland at mcs.anl.gov>
diff --git a/test/mpi/datatype/large_type_sendrec.c b/test/mpi/datatype/large_type_sendrec.c
index f6500fb..4b56f37 100644
--- a/test/mpi/datatype/large_type_sendrec.c
+++ b/test/mpi/datatype/large_type_sendrec.c
@@ -18,7 +18,7 @@
#include <mpi.h>
#include <assert.h>
-static void MPIX_Verbose_abort(int errorcode)
+static void verbose_abort(int errorcode)
{
/* We do not check error codes here
* because if MPI is in a really sorry state,
@@ -44,9 +44,9 @@ static void MPIX_Verbose_abort(int errorcode)
return;
}
#define MPI_ASSERT(rc) \
- ((void) ((rc==MPI_SUCCESS) ? 0 : MPIX_Verbose_abort(rc) ))
+ ((void) ((rc==MPI_SUCCESS) ? 0 : verbose_abort(rc) ))
-int MPIX_Type_contiguous_x(MPI_Count count, MPI_Datatype oldtype,
+int Type_contiguous_x(MPI_Count count, MPI_Datatype oldtype,
MPI_Datatype * newtype);
#define BIGMPI_MAX INT_MAX
@@ -54,7 +54,7 @@ int MPIX_Type_contiguous_x(MPI_Count count, MPI_Datatype oldtype,
/*
* Synopsis
*
- * int MPIX_Type_contiguous_x(MPI_Count count,
+ * int Type_contiguous_x(MPI_Count count,
* MPI_Datatype oldtype,
* MPI_Datatype * newtype)
*
@@ -68,7 +68,7 @@ int MPIX_Type_contiguous_x(MPI_Count count, MPI_Datatype oldtype,
* newtype new datatype (handle)
*
*/
-int MPIX_Type_contiguous_x(MPI_Count count, MPI_Datatype oldtype, MPI_Datatype * newtype)
+int Type_contiguous_x(MPI_Count count, MPI_Datatype oldtype, MPI_Datatype * newtype)
{
MPI_Count c = count/BIGMPI_MAX;
MPI_Count r = count%BIGMPI_MAX;
@@ -116,7 +116,7 @@ int main(int argc, char * argv[])
size_t count = (size_t)1<<logn; /* explicit cast required */
MPI_Datatype bigtype;
- MPI_ASSERT(MPIX_Type_contiguous_x( (MPI_Count)count, MPI_CHAR, &bigtype));
+ MPI_ASSERT(Type_contiguous_x( (MPI_Count)count, MPI_CHAR, &bigtype));
MPI_ASSERT(MPI_Type_commit(&bigtype));
MPI_Request requests[2];
-----------------------------------------------------------------------
Summary of changes:
test/mpi/cxx/coll/Makefile.am | 5 +-
test/mpi/cxx/coll/redscatblk.cxx | 75 ++++++++++++++++++++++++++++++++
test/mpi/cxx/coll/testlist | 1 +
test/mpi/datatype/large_type_sendrec.c | 12 +++---
4 files changed, 85 insertions(+), 8 deletions(-)
create mode 100644 test/mpi/cxx/coll/redscatblk.cxx
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list