[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b4-36-g6f6a071
Service Account
noreply at mpich.org
Thu Jul 30 13:29:52 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 6f6a07100dacb5d2ee2e61d4829fd7fe20b8929c (commit)
via 1a576e2eb62151533818f8bc133bee9d530109f0 (commit)
via 6ac0076e57f668e585a741f68f250aadd24f95e0 (commit)
via 57d806d45e84c133688a274f1ca09480ebe4df0d (commit)
from 06ab9439f17e830334a716f9745cb40fef413ed6 (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/6f6a07100dacb5d2ee2e61d4829fd7fe20b8929c
commit 6f6a07100dacb5d2ee2e61d4829fd7fe20b8929c
Author: Min Si <msi at il.is.s.u-tokyo.ac.jp>
Date: Wed Jul 29 23:03:28 2015 -0500
Fixed compile warning in MTest datatype.
There was a format mismatch warning in mtest_datatype.c. This patch
fixed it.
Signed-off-by: Pavan Balaji <balaji at anl.gov>
diff --git a/test/mpi/util/mtest_datatype.c b/test/mpi/util/mtest_datatype.c
index c42d508..f0445eb 100644
--- a/test/mpi/util/mtest_datatype.c
+++ b/test/mpi/util/mtest_datatype.c
@@ -255,7 +255,7 @@ static int MTestTypeVectorCheckbuf(MTestDatatype * mtype)
if (p[byte_offset + j] != expected) {
err++;
if (mtype->printErrors && err < 10) {
- printf("Data expected = %x but got p[%d,%d] = %x\n", expected, i, j,
+ printf("Data expected = %x but got p[%d,%ld] = %x\n", expected, i, j,
p[byte_offset + j]);
fflush(stdout);
}
@@ -486,7 +486,7 @@ static int MTestTypeIndexedBlockCheckbuf(MTestDatatype * mtype)
if (p[offset + j] != expected) {
err++;
if (mtype->printErrors && err < 10) {
- printf("Data expected = %x but got p[%d,%d] = %x\n",
+ printf("Data expected = %x but got p[%d,%ld] = %x\n",
expected, i, j, p[offset + j]);
fflush(stdout);
}
http://git.mpich.org/mpich.git/commitdiff/1a576e2eb62151533818f8bc133bee9d530109f0
commit 1a576e2eb62151533818f8bc133bee9d530109f0
Author: Min Si <msi at il.is.s.u-tokyo.ac.jp>
Date: Wed Jul 29 22:46:03 2015 -0500
Revert "Added Duplicate function for MTest datatype objects".
This patch reverts commit 3ed5c1a234069cc719e8f54adc06a9d4b7b5a2f1.
Signed-off-by: Pavan Balaji <balaji at anl.gov>
diff --git a/test/mpi/include/mpitest.h b/test/mpi/include/mpitest.h
index 9fb1850..a773f28 100644
--- a/test/mpi/include/mpitest.h
+++ b/test/mpi/include/mpitest.h
@@ -40,8 +40,6 @@ typedef struct _MTestDatatype {
void *buf; /* buffer to use in communication */
MPI_Aint count; /* count to use for this datatype */
int isBasic; /* true if the type is predefined */
- int isDuped; /* true if the type is duplicated from
- * an existing derived datatype */
int printErrors; /* true if errors should be printed
(used by the CheckBuf routines) */
/* The following is optional data that is used by some of
@@ -57,7 +55,6 @@ typedef struct _MTestDatatype {
void *(*InitBuf)( struct _MTestDatatype * );
void *(*FreeBuf)( struct _MTestDatatype * );
int (*CheckBuf)( struct _MTestDatatype * );
- int (*Dup)( struct _MTestDatatype, struct _MTestDatatype * );
} MTestDatatype;
/* The max value of count must be very large to ensure that we
diff --git a/test/mpi/util/mtest_datatype.c b/test/mpi/util/mtest_datatype.c
index 6624b19..c42d508 100644
--- a/test/mpi/util/mtest_datatype.c
+++ b/test/mpi/util/mtest_datatype.c
@@ -37,19 +37,14 @@ static void *MTestTypeFree(MTestDatatype * mtype)
{
if (mtype->buf)
free(mtype->buf);
-
- /* Only free internal structures for created types. */
- if (!mtype->isBasic && !mtype->isDuped) {
- if (mtype->displs)
- free(mtype->displs);
- if (mtype->displ_in_bytes)
- free(mtype->displ_in_bytes);
- if (mtype->index)
- free(mtype->index);
- if (mtype->old_datatypes)
- free(mtype->old_datatypes);
- }
-
+ if (mtype->displs)
+ free(mtype->displs);
+ if (mtype->displ_in_bytes)
+ free(mtype->displ_in_bytes);
+ if (mtype->index)
+ free(mtype->index);
+ if (mtype->old_datatypes)
+ free(mtype->old_datatypes);
mtype->buf = NULL;
mtype->displs = NULL;
mtype->displ_in_bytes = NULL;
@@ -62,7 +57,6 @@ static void *MTestTypeFree(MTestDatatype * mtype)
static inline void MTestTypeReset(MTestDatatype * mtype)
{
mtype->isBasic = 0;
- mtype->isDuped = 0;
mtype->printErrors = 0;
mtype->buf = NULL;
@@ -91,52 +85,6 @@ static inline void MTestTypeReset(MTestDatatype * mtype)
mtype->InitBuf = NULL;
mtype->FreeBuf = NULL;
mtype->CheckBuf = NULL;
- mtype->Dup = NULL;
-}
-
-/*
- * Duplicate a MTest datatype object.
- *
- * Note that we only set all the structure pointers to the existing objects,
- * only the buffer is allocated separately.
- * */
-static int MTestTypeDup(MTestDatatype old_mtype, MTestDatatype * new_mtype)
-{
- int merr = 0;
-
- MTestTypeReset(new_mtype);
-
- new_mtype->isDuped = 1;
-
- /* Copy all internal structures from old type. */
- new_mtype->datatype = old_mtype.datatype;
- new_mtype->count = old_mtype.count;
- new_mtype->nblock = old_mtype.nblock;
- new_mtype->index = old_mtype.index;
-
- new_mtype->stride = old_mtype.stride;
- new_mtype->blksize = old_mtype.blksize;
- new_mtype->displ_in_bytes = old_mtype.displ_in_bytes;
-
- new_mtype->displs = old_mtype.displs;
- new_mtype->basesize = old_mtype.basesize;
-
- new_mtype->old_datatypes = old_mtype.old_datatypes;
-
- new_mtype->arr_sizes[0] = old_mtype.arr_sizes[0];
- new_mtype->arr_sizes[1] = old_mtype.arr_sizes[1];
- new_mtype->arr_subsizes[0] = old_mtype.arr_subsizes[0];
- new_mtype->arr_subsizes[1] = old_mtype.arr_subsizes[1];
- new_mtype->arr_starts[0] = old_mtype.arr_starts[0];
- new_mtype->arr_starts[1] = old_mtype.arr_starts[1];
- new_mtype->order = old_mtype.order;
-
- new_mtype->InitBuf = old_mtype.InitBuf;
- new_mtype->FreeBuf = old_mtype.FreeBuf;
- new_mtype->CheckBuf = old_mtype.CheckBuf;
- new_mtype->Dup = old_mtype.Dup;
-
- return merr;
}
/* ------------------------------------------------------------------------ */
@@ -732,7 +680,6 @@ static int MTestTypeContiguousCreate(int nblock, int blocklen, int stride, int l
mtype->InitBuf = MTestTypeContigInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeContigCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -782,7 +729,6 @@ static int MTestTypeVectorCreate(int nblock, int blocklen, int stride, int lb,
mtype->InitBuf = MTestTypeVectorInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeVectorCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -833,7 +779,6 @@ static int MTestTypeHvectorCreate(int nblock, int blocklen, int stride, int lb,
mtype->InitBuf = MTestTypeVectorInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeVectorCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -897,7 +842,6 @@ static int MTestTypeIndexedCreate(int nblock, int blocklen, int stride, int lb,
mtype->InitBuf = MTestTypeIndexedInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeIndexedCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -961,7 +905,6 @@ static inline int MTestTypeHindexedCreate(int nblock, int blocklen, int stride,
mtype->InitBuf = MTestTypeIndexedInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeIndexedCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -1026,7 +969,6 @@ static int MTestTypeIndexedBlockCreate(int nblock, int blocklen, int stride, int
mtype->InitBuf = MTestTypeIndexedBlockInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeIndexedBlockCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -1089,7 +1031,6 @@ static int MTestTypeHindexedBlockCreate(int nblock, int blocklen, int stride, in
mtype->InitBuf = MTestTypeIndexedBlockInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeIndexedBlockCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -1156,7 +1097,6 @@ static int MTestTypeStructCreate(int nblock, int blocklen, int stride, int lb,
mtype->InitBuf = MTestTypeIndexedInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeIndexedCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -1213,7 +1153,6 @@ static int MTestTypeSubArrayOrderCCreate(int nblock, int blocklen, int stride, i
mtype->InitBuf = MTestTypeSubarrayInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeSubarrayCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -1278,7 +1217,6 @@ static int MTestTypeSubArrayOrderFortranCreate(int nblock, int blocklen, int str
mtype->InitBuf = MTestTypeSubarrayInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeSubarrayCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -1305,7 +1243,6 @@ int MTestTypeBasicCreate(MPI_Datatype oldtype, MTestDatatype * mtype)
mtype->InitBuf = MTestTypeContigInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeContigCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
@@ -1336,7 +1273,6 @@ int MTestTypeDupCreate(MPI_Datatype oldtype, MTestDatatype * mtype)
mtype->InitBuf = MTestTypeContigInit;
mtype->FreeBuf = MTestTypeFree;
mtype->CheckBuf = MTestTypeContigCheckbuf;
- mtype->Dup = MTestTypeDup;
return merr;
}
diff --git a/test/mpi/util/mtest_datatype_gen.c b/test/mpi/util/mtest_datatype_gen.c
index 6b8a5e1..11eb0de 100644
--- a/test/mpi/util/mtest_datatype_gen.c
+++ b/test/mpi/util/mtest_datatype_gen.c
@@ -576,8 +576,8 @@ void MTestFreeDatatype(MTestDatatype * mtype)
if (mtype->FreeBuf) {
(mtype->FreeBuf) (mtype);
}
- /* Free the datatype itself if it was a created new datatype */
- if (!mtype->isBasic && !mtype->isDuped) {
+ /* Free the datatype itself if it was created */
+ if (!mtype->isBasic) {
merr = MPI_Type_free(&mtype->datatype);
if (merr)
MTestPrintError(merr);
http://git.mpich.org/mpich.git/commitdiff/6ac0076e57f668e585a741f68f250aadd24f95e0
commit 6ac0076e57f668e585a741f68f250aadd24f95e0
Author: Min Si <msi at il.is.s.u-tokyo.ac.jp>
Date: Wed Jul 29 20:59:10 2015 -0500
Revert "Support multiple dataset in MTest datatype routine".
This patch reverts commit b363a94ce709e60e554cdf86f03dc2121712c772.
Signed-off-by: Pavan Balaji <balaji at anl.gov>
diff --git a/test/mpi/include/mpitest.h b/test/mpi/include/mpitest.h
index 1cbeb42..9fb1850 100644
--- a/test/mpi/include/mpitest.h
+++ b/test/mpi/include/mpitest.h
@@ -27,12 +27,6 @@ int MTestReturnValue( int );
void MTestSleep( int );
void MTestGetDbgInfo(int *dbgflag, int *verbose);
-typedef enum _MTestDataset{
- MTEST_DATA_EMPTY,
- MTEST_DATA_SET1,
- MTEST_DATA_SET2
-} MTestDataset;
-
/*
* This structure contains the information used to test datatypes
* buf is set to null when an MTestDatatype is created; the
@@ -60,9 +54,9 @@ typedef struct _MTestDatatype {
/* used in subarray */
int arr_sizes[2], arr_subsizes[2], arr_starts[2], order;
- void *(*InitBuf)( struct _MTestDatatype *, MTestDataset );
+ void *(*InitBuf)( struct _MTestDatatype * );
void *(*FreeBuf)( struct _MTestDatatype * );
- int (*CheckBuf)( struct _MTestDatatype *, MTestDataset );
+ int (*CheckBuf)( struct _MTestDatatype * );
int (*Dup)( struct _MTestDatatype, struct _MTestDatatype * );
} MTestDatatype;
@@ -84,7 +78,7 @@ void MTestInitMinDatatypes(void);
* It generate tests for all basic datatypes. */
void MTestInitBasicDatatypes(void);
-int MTestCheckRecv( MPI_Status *, MTestDatatype *, MTestDataset );
+int MTestCheckRecv( MPI_Status *, MTestDatatype * );
int MTestGetDatatypes( MTestDatatype *, MTestDatatype *, MPI_Aint );
void MTestResetDatatypes( void );
void MTestFreeDatatype( MTestDatatype * );
diff --git a/test/mpi/util/mtest_datatype.c b/test/mpi/util/mtest_datatype.c
index 3877347..6624b19 100644
--- a/test/mpi/util/mtest_datatype.c
+++ b/test/mpi/util/mtest_datatype.c
@@ -30,69 +30,7 @@
/* ------------------------------------------------------------------------ */
-/* Internal functions */
-/* ------------------------------------------------------------------------ */
-
-/**
- * Decode a datatype object, return its extent, total space, and total size.
- */
-static inline void datatype_decode(MTestDatatype * mtype, MPI_Aint * extent,
- MPI_Aint * totspace, MPI_Aint * totsize)
-{
- int dt_size;
- MPI_Aint lb;
- int merr = 0;
-
- merr = MPI_Type_get_extent(mtype->datatype, &lb, extent);
- if (merr)
- MTestPrintError(merr);
-
- merr = MPI_Type_size(mtype->datatype, &dt_size);
- if (merr)
- MTestPrintError(merr);
-
- (*totspace) = lb + mtype->count * (*extent);
- (*totsize) = mtype->count * dt_size;
-}
-
-/**
- * Initialize parameters to generate a dataset.
- *
- * It returns data generating parameters to the upper function to generate value
- * for each element. The current version generates an arithmetic sequence with
- * following two parameters, this might be changed in future.
- * - init_term, the value of the first element.
- * - common_diff, the multiply for the next element.
- *
- * Note that we generate totally different sequence for each dataset, thus the
- * test can specify different datasets for multiple buffers, and check the
- * correctness of every byte in the receiving buffer. For example, in get_acc
- * test, the origin buffer, result buffer, and window buffer can have different
- * value, thus both result buffer and window buffer can be checked in single
- * execution.
- */
-static void init_dataset_params(MTestDataset dataset, MPI_Aint set_size,
- MPI_Aint * init_term, MPI_Aint * common_diff)
-{
- switch (dataset) {
- case MTEST_DATA_SET1:
- (*init_term) = 0;
- (*common_diff) = 1;
- break;
- case MTEST_DATA_SET2:
- (*init_term) = set_size;
- (*common_diff) = 1;
- break;
- case MTEST_DATA_EMPTY:
- default:
- (*init_term) = 0;
- (*common_diff) = 0;
- break;
- }
-}
-
-/* ------------------------------------------------------------------------ */
-/* General datatype routines */
+/* General datatype routines */
/* ------------------------------------------------------------------------ */
static void *MTestTypeFree(MTestDatatype * mtype)
@@ -207,22 +145,22 @@ static int MTestTypeDup(MTestDatatype old_mtype, MTestDatatype * new_mtype)
/*
* Initialize buffer of basic datatype
*/
-static void *MTestTypeContigInit(MTestDatatype * mtype, MTestDataset dataset)
+static void *MTestTypeContigInit(MTestDatatype * mtype)
{
- MPI_Aint totspace = 0, extent = 0;
- MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
+ MPI_Aint extent = 0, lb = 0, size;
+ int merr;
if (mtype->count > 0) {
unsigned char *p;
- MPI_Aint i;
+ MPI_Aint i, totsize;
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
- /* Get datatype information and dataset */
- datatype_decode(mtype, &extent, &totspace, &totsize);
- init_dataset_params(dataset, totsize, &init_term, &common_diff);
-
- /* Allocate buffer */
+ size = extent + lb;
+ totsize = size * mtype->count;
if (!mtype->buf) {
- mtype->buf = (void *) malloc(totspace);
+ mtype->buf = (void *) malloc(totsize);
}
p = (unsigned char *) (mtype->buf);
if (!p) {
@@ -230,11 +168,8 @@ static void *MTestTypeContigInit(MTestDatatype * mtype, MTestDataset dataset)
sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
MTestError(errmsg);
}
-
- /* Now, set value into actual elements. */
- data = init_term;
- for (i = 0; i < totspace; i++) {
- p[i] = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
+ for (i = 0; i < totsize; i++) {
+ p[i] = (unsigned char) (0xff ^ (i & 0xff));
}
}
else {
@@ -249,24 +184,23 @@ static void *MTestTypeContigInit(MTestDatatype * mtype, MTestDataset dataset)
/*
* Check value of received basic datatype buffer.
*/
-static int MTestTypeContigCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
+static int MTestTypeContigCheckbuf(MTestDatatype * mtype)
{
unsigned char *p;
unsigned char expected;
- int err = 0;
- MPI_Aint i, totspace = 0, extent = 0;
- MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
+ int err = 0, merr;
+ MPI_Aint i, totsize, size, extent = 0, lb = 0;
p = (unsigned char *) mtype->buf;
if (p) {
- /* Get datatype information and dataset */
- datatype_decode(mtype, &extent, &totspace, &totsize);
- init_dataset_params(dataset, totsize, &init_term, &common_diff);
-
- data = init_term;
- for (i = 0; i < totspace; i++) {
- expected = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
-
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
+
+ size = lb + extent;
+ totsize = size * mtype->count;
+ for (i = 0; i < totsize; i++) {
+ expected = (unsigned char) (0xff ^ (i & 0xff));
if (p[i] != expected) {
err++;
if (mtype->printErrors && err < 10) {
@@ -287,23 +221,24 @@ static int MTestTypeContigCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
/*
* Initialize buffer of vector datatype
*/
-static void *MTestTypeVectorInit(MTestDatatype * mtype, MTestDataset dataset)
+static void *MTestTypeVectorInit(MTestDatatype * mtype)
{
- MPI_Aint totspace = 0, extent = 0, dt_offset, byte_offset;
- MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
+ MPI_Aint extent = 0, lb = 0, size, totsize, dt_offset, byte_offset;
+ int merr;
if (mtype->count > 0) {
unsigned char *p;
MPI_Aint k, j;
- int i;
+ int i, nc;
- /* Get datatype information and dataset */
- datatype_decode(mtype, &extent, &totspace, &totsize);
- init_dataset_params(dataset, totsize, &init_term, &common_diff);
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
- /* Allocate buffer */
+ size = extent + lb;
+ totsize = mtype->count * size;
if (!mtype->buf) {
- mtype->buf = (void *) malloc(totspace);
+ mtype->buf = (void *) malloc(totsize);
}
p = (unsigned char *) (mtype->buf);
if (!p) {
@@ -313,16 +248,12 @@ static void *MTestTypeVectorInit(MTestDatatype * mtype, MTestDataset dataset)
}
/* First, set to -1 */
- for (k = 0; k < totspace; k++)
+ for (k = 0; k < totsize; k++)
p[k] = 0xff;
- /* For empty initialization, it is done. */
- if (dataset == MTEST_DATA_EMPTY)
- return mtype->buf;
-
- /* Now, set value into actual elements.
+ /* Now, set the actual elements to the successive values.
* We require that the base type is a contiguous type */
- data = init_term;
+ nc = 0;
dt_offset = 0;
/* For each datatype */
for (k = 0; k < mtype->count; k++) {
@@ -331,10 +262,11 @@ static void *MTestTypeVectorInit(MTestDatatype * mtype, MTestDataset dataset)
byte_offset = dt_offset + i * mtype->stride;
/* For each byte */
for (j = 0; j < mtype->blksize; j++) {
- p[byte_offset + j] = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
+ p[byte_offset + j] = (unsigned char) (0xff ^ (nc & 0xff));
+ nc++;
}
}
- dt_offset += extent;
+ dt_offset += size;
}
}
else {
@@ -346,24 +278,24 @@ static void *MTestTypeVectorInit(MTestDatatype * mtype, MTestDataset dataset)
/*
* Check value of received vector datatype buffer
*/
-static int MTestTypeVectorCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
+static int MTestTypeVectorCheckbuf(MTestDatatype * mtype)
{
unsigned char *p;
unsigned char expected;
- int i, err = 0;
- MPI_Aint totspace = 0, extent = 0, byte_offset, dt_offset;
- MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
+ int i, err = 0, merr;
+ MPI_Aint size = 0, byte_offset, dt_offset, extent, lb;
p = (unsigned char *) mtype->buf;
if (p) {
MPI_Aint k, j;
+ int nc;
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
- /* Get datatype information and dataset */
- datatype_decode(mtype, &extent, &totspace, &totsize);
- init_dataset_params(dataset, totsize, &init_term, &common_diff);
-
+ size = extent + lb;
+ nc = 0;
dt_offset = 0;
- data = init_term;
/* For each datatype */
for (k = 0; k < mtype->count; k++) {
/* For each block */
@@ -371,18 +303,19 @@ static int MTestTypeVectorCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
byte_offset = dt_offset + i * mtype->stride;
/* For each byte */
for (j = 0; j < mtype->blksize; j++) {
- expected = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
+ expected = (unsigned char) (0xff ^ (nc & 0xff));
if (p[byte_offset + j] != expected) {
err++;
if (mtype->printErrors && err < 10) {
- printf("Data expected = %x but got p[%d,%ld] = %x\n", expected, i, j,
+ printf("Data expected = %x but got p[%d,%d] = %x\n", expected, i, j,
p[byte_offset + j]);
fflush(stdout);
}
}
+ nc++;
}
}
- dt_offset += extent;
+ dt_offset += size;
}
}
return err;
@@ -396,23 +329,26 @@ static int MTestTypeVectorCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
/*
* Initialize buffer of indexed datatype
*/
-static void *MTestTypeIndexedInit(MTestDatatype * mtype, MTestDataset dataset)
+static void *MTestTypeIndexedInit(MTestDatatype * mtype)
{
- MPI_Aint totspace = 0, extent = 0, dt_offset, offset;
- MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
+ MPI_Aint extent = 0, lb = 0, size, totsize, dt_offset, offset;
+ int merr;
if (mtype->count > 0) {
unsigned char *p;
MPI_Aint k, b;
- int i, j;
-
- /* Get datatype information and dataset */
- datatype_decode(mtype, &extent, &totspace, &totsize);
- init_dataset_params(dataset, totsize, &init_term, &common_diff);
+ int i, j, nc;
/* Allocate buffer */
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
+
+ size = extent + lb;
+ totsize = size * mtype->count;
+
if (!mtype->buf) {
- mtype->buf = (void *) malloc(totspace);
+ mtype->buf = (void *) malloc(totsize);
}
p = (unsigned char *) (mtype->buf);
if (!p) {
@@ -422,16 +358,12 @@ static void *MTestTypeIndexedInit(MTestDatatype * mtype, MTestDataset dataset)
}
/* First, set to -1 */
- for (k = 0; k < totspace; k++)
+ for (k = 0; k < totsize; k++)
p[k] = 0xff;
- /* For empty initialization, it is done. */
- if (dataset == MTEST_DATA_EMPTY)
- return mtype->buf;
-
- /* Now, set value into actual elements.
+ /* Now, set the actual elements to the successive values.
* We require that the base type is a contiguous type */
- data = init_term;
+ nc = 0;
dt_offset = 0;
/* For each datatype */
for (k = 0; k < mtype->count; k++) {
@@ -443,11 +375,11 @@ static void *MTestTypeIndexedInit(MTestDatatype * mtype, MTestDataset dataset)
+ j * mtype->basesize;
/* For each byte in the element */
for (b = 0; b < mtype->basesize; b++) {
- p[offset + b] = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
+ p[offset + b] = (unsigned char) (0xff ^ (nc++ & 0xff));
}
}
}
- dt_offset += extent;
+ dt_offset += size;
}
}
else {
@@ -463,25 +395,24 @@ static void *MTestTypeIndexedInit(MTestDatatype * mtype, MTestDataset dataset)
/*
* Check value of received indexed datatype buffer
*/
-static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
+static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype)
{
unsigned char *p;
unsigned char expected;
- int err = 0;
- MPI_Aint totspace = 0, extent = 0, offset, dt_offset;
- MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
+ int err = 0, merr;
+ MPI_Aint size = 0, offset, dt_offset, extent = 0, lb = 0;
p = (unsigned char *) mtype->buf;
if (p) {
MPI_Aint k, b;
- int i, j;
-
- /* Get datatype information and dataset */
- datatype_decode(mtype, &extent, &totspace, &totsize);
- init_dataset_params(dataset, totsize, &init_term, &common_diff);
+ int i, j, nc;
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
+ size = lb + extent;
+ nc = 0;
dt_offset = 0;
- data = init_term;
/* For each datatype */
for (k = 0; k < mtype->count; k++) {
/* For each block */
@@ -492,7 +423,7 @@ static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
+ j * mtype->basesize;
/* For each byte in the element */
for (b = 0; b < mtype->basesize; b++) {
- expected = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
+ expected = (unsigned char) (0xff ^ (nc++ & 0xff));
if (p[offset + b] != expected) {
err++;
if (mtype->printErrors && err < 10) {
@@ -504,7 +435,7 @@ static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
}
}
}
- dt_offset += extent;
+ dt_offset += size;
}
}
return err;
@@ -517,23 +448,25 @@ static int MTestTypeIndexedCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
/*
* Initialize buffer of indexed-block datatype
*/
-static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype, MTestDataset dataset)
+static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype)
{
- MPI_Aint totspace = 0, extent = 0, offset, dt_offset;
- MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
+ MPI_Aint extent = 0, lb = 0, size, totsize, offset, dt_offset;
+ int merr;
if (mtype->count > 0) {
unsigned char *p;
MPI_Aint k, j;
- int i;
+ int i, nc;
- /* Get datatype information and dataset */
- datatype_decode(mtype, &extent, &totspace, &totsize);
- init_dataset_params(dataset, totsize, &init_term, &common_diff);
+ /* Allocate the send/recv buffer */
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
+ size = extent + lb;
+ totsize = size * mtype->count;
- /* Allocate buffer */
if (!mtype->buf) {
- mtype->buf = (void *) malloc(totspace);
+ mtype->buf = (void *) malloc(totsize);
}
p = (unsigned char *) (mtype->buf);
if (!p) {
@@ -543,16 +476,12 @@ static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype, MTestDataset datas
}
/* First, set to -1 */
- for (k = 0; k < totspace; k++)
+ for (k = 0; k < totsize; k++)
p[k] = 0xff;
- /* For empty initialization, it is done. */
- if (dataset == MTEST_DATA_EMPTY)
- return mtype->buf;
-
- /* Now, set value into actual elements.
+ /* Now, set the actual elements to the successive values.
* We require that the base type is a contiguous type */
- data = init_term;
+ nc = 0;
dt_offset = 0;
/* For each datatype */
for (k = 0; k < mtype->count; k++) {
@@ -561,10 +490,10 @@ static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype, MTestDataset datas
offset = dt_offset + mtype->displ_in_bytes[i];
/* For each byte in the block */
for (j = 0; j < mtype->blksize; j++) {
- p[offset + j] = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
+ p[offset + j] = (unsigned char) (0xff ^ (nc++ & 0xff));
}
}
- dt_offset += extent;
+ dt_offset += size;
}
}
else {
@@ -580,26 +509,24 @@ static void *MTestTypeIndexedBlockInit(MTestDatatype * mtype, MTestDataset datas
/*
* Check value of received indexed-block datatype buffer
*/
-static int MTestTypeIndexedBlockCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
+static int MTestTypeIndexedBlockCheckbuf(MTestDatatype * mtype)
{
unsigned char *p;
unsigned char expected;
- MPI_Aint dt_offset, offset;
- MPI_Aint totspace = 0, extent = 0;
- MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
- int err = 0;
+ int err = 0, merr;
+ MPI_Aint size = 0, offset, dt_offset, lb = 0, extent = 0;
p = (unsigned char *) mtype->buf;
if (p) {
MPI_Aint j, k;
- int i;
-
- /* Get datatype information and dataset */
- datatype_decode(mtype, &extent, &totspace, &totsize);
- init_dataset_params(dataset, totsize, &init_term, &common_diff);
+ int i, nc;
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
+ size = lb + extent;
+ nc = 0;
dt_offset = 0;
- data = init_term;
/* For each datatype */
for (k = 0; k < mtype->count; k++) {
/* For each block */
@@ -607,18 +534,18 @@ static int MTestTypeIndexedBlockCheckbuf(MTestDatatype * mtype, MTestDataset dat
offset = dt_offset + mtype->displ_in_bytes[i];
/* For each byte in the block */
for (j = 0; j < mtype->blksize; j++) {
- expected = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
+ expected = (unsigned char) (0xff ^ (nc++ & 0xff));
if (p[offset + j] != expected) {
err++;
if (mtype->printErrors && err < 10) {
- printf("Data expected = %x but got p[%d,%ld] = %x\n",
+ printf("Data expected = %x but got p[%d,%d] = %x\n",
expected, i, j, p[offset + j]);
fflush(stdout);
}
}
}
}
- dt_offset += extent;
+ dt_offset += size;
}
}
return err;
@@ -631,23 +558,26 @@ static int MTestTypeIndexedBlockCheckbuf(MTestDatatype * mtype, MTestDataset dat
/*
* Initialize buffer of subarray datatype.
*/
-static void *MTestTypeSubarrayInit(MTestDatatype * mtype, MTestDataset dataset)
+static void *MTestTypeSubarrayInit(MTestDatatype * mtype)
{
- MPI_Aint totspace = 0, extent = 0, offset, dt_offset, byte_offset;
- MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
+ MPI_Aint extent = 0, lb = 0, size, totsize, offset, dt_offset, byte_offset;
+ int merr;
if (mtype->count > 0) {
unsigned char *p;
MPI_Aint k;
- int j, b, i;
+ int j, b, i, nc;
- /* Get datatype information and dataset */
- datatype_decode(mtype, &extent, &totspace, &totsize);
- init_dataset_params(dataset, totsize, &init_term, &common_diff);
+ /* Allocate the send/recv buffer */
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
+
+ size = extent + lb;
+ totsize = size * mtype->count;
- /* Allocate buffer */
if (!mtype->buf) {
- mtype->buf = (void *) malloc(totspace);
+ mtype->buf = (void *) malloc(totsize);
}
p = (unsigned char *) (mtype->buf);
if (!p) {
@@ -657,14 +587,10 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype, MTestDataset dataset)
}
/* First, set to -1 */
- for (k = 0; k < totspace; k++)
+ for (k = 0; k < totsize; k++)
p[k] = 0xff;
- /* For empty initialization, it is done. */
- if (dataset == MTEST_DATA_EMPTY)
- return mtype->buf;
-
- /* Now, set value into actual elements.
+ /* Now, set the actual elements to the successive values.
* We require that the base type is a contiguous type. */
int ncol, sub_ncol, sub_nrow, sub_col_start, sub_row_start;
ncol = mtype->arr_sizes[1];
@@ -673,7 +599,7 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype, MTestDataset dataset)
sub_row_start = mtype->arr_starts[0];
sub_col_start = mtype->arr_starts[1];
- data = init_term;
+ nc = 0;
dt_offset = 0;
/* For each datatype */
for (k = 0; k < mtype->count; k++) {
@@ -685,11 +611,10 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype, MTestDataset dataset)
byte_offset = dt_offset + (offset + j) * mtype->basesize;
/* For each byte in element */
for (b = 0; b < mtype->basesize; b++)
- p[byte_offset + b] =
- (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
+ p[byte_offset + b] = (unsigned char) (0xff ^ (nc++ & 0xff));
}
}
- dt_offset += extent;
+ dt_offset += size;
}
}
else {
@@ -705,22 +630,22 @@ static void *MTestTypeSubarrayInit(MTestDatatype * mtype, MTestDataset dataset)
/*
* Check value of received subarray datatype buffer
*/
-static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype, MTestDataset dataset)
+static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype)
{
unsigned char *p;
unsigned char expected;
- int err = 0;
- MPI_Aint totspace = 0, extent = 0, offset, dt_offset, byte_offset;
- MPI_Aint init_term = 0, common_diff = 0, data = 0, totsize = 0;
+ int err = 0, merr;
+ MPI_Aint size, offset, dt_offset, byte_offset, lb = 0, extent = 0;
p = (unsigned char *) mtype->buf;
if (p) {
MPI_Aint k;
- int j, b, i;
+ int j, b, i, nc;
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
- /* Get datatype information and dataset */
- datatype_decode(mtype, &extent, &totspace, &totsize);
- init_dataset_params(dataset, totsize, &init_term, &common_diff);
+ size = lb + extent;
int ncol, sub_ncol, sub_nrow, sub_col_start, sub_row_start;
ncol = mtype->arr_sizes[1];
@@ -729,7 +654,7 @@ static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype, MTestDataset dataset
sub_row_start = mtype->arr_starts[0];
sub_col_start = mtype->arr_starts[1];
- data = init_term;
+ nc = 0;
dt_offset = 0;
/* For each datatype */
for (k = 0; k < mtype->count; k++) {
@@ -741,7 +666,7 @@ static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype, MTestDataset dataset
byte_offset = dt_offset + (offset + j) * mtype->basesize;
/* For each byte in element */
for (b = 0; b < mtype->basesize; b++) {
- expected = (unsigned char) (0xff ^ ((data++ * common_diff) & 0xff));
+ expected = (unsigned char) (0xff ^ (nc++ & 0xff));
if (p[byte_offset + b] != expected) {
err++;
if (mtype->printErrors && err < 10) {
@@ -753,7 +678,7 @@ static int MTestTypeSubarrayCheckbuf(MTestDatatype * mtype, MTestDataset dataset
}
}
}
- dt_offset += extent;
+ dt_offset += size;
}
}
if (err)
@@ -1416,6 +1341,48 @@ int MTestTypeDupCreate(MPI_Datatype oldtype, MTestDatatype * mtype)
return merr;
}
+
+/*
+ * General initialization for receive buffer.
+ * Allocate buffer and initialize for reception (e.g., set initial data to detect failure)
+ * Both basic and derived datatype can be handled by using extent as buffer size.
+ */
+void *MTestTypeInitRecv(MTestDatatype * mtype)
+{
+ MPI_Aint size, extent = 0, lb = 0;
+ int merr;
+
+ if (mtype->count > 0) {
+ signed char *p;
+ MPI_Aint i, totsize;
+ merr = MPI_Type_get_extent(mtype->datatype, &lb, &extent);
+ if (merr)
+ MTestPrintError(merr);
+
+ size = extent + lb;
+ totsize = size * mtype->count;
+ if (!mtype->buf) {
+ mtype->buf = (void *) malloc(totsize);
+ }
+ p = (signed char *) (mtype->buf);
+ if (!p) {
+ char errmsg[128] = { 0 };
+ sprintf(errmsg, "Out of memory in %s", __FUNCTION__);
+ MTestError(errmsg);
+ }
+ for (i = 0; i < totsize; i++) {
+ p[i] = 0xff;
+ }
+ }
+ else {
+ if (mtype->buf) {
+ free(mtype->buf);
+ }
+ mtype->buf = 0;
+ }
+ return mtype->buf;
+}
+
void MTestTypeCreatorInit(MTestDdtCreator * creators)
{
memset(creators, 0, sizeof(MTestDdtCreator) * MTEST_DDT_MAX);
diff --git a/test/mpi/util/mtest_datatype.h b/test/mpi/util/mtest_datatype.h
index 939df18..e549406 100644
--- a/test/mpi/util/mtest_datatype.h
+++ b/test/mpi/util/mtest_datatype.h
@@ -54,6 +54,7 @@ typedef int (*MTestDdtCreator) (int, int, int, int, MPI_Datatype, const char *,
extern void MTestTypeCreatorInit(MTestDdtCreator * creators);
extern void MTestTypeMinCreatorInit(MTestDdtCreator * creators);
+extern void *MTestTypeInitRecv(MTestDatatype * mtype);
extern int MTestTypeBasicCreate(MPI_Datatype oldtype, MTestDatatype * mtype);
extern int MTestTypeDupCreate(MPI_Datatype oldtype, MTestDatatype * mtype);
diff --git a/test/mpi/util/mtest_datatype_gen.c b/test/mpi/util/mtest_datatype_gen.c
index 12a3d57..6b8a5e1 100644
--- a/test/mpi/util/mtest_datatype_gen.c
+++ b/test/mpi/util/mtest_datatype_gen.c
@@ -521,6 +521,11 @@ int MTestGetDatatypes(MTestDatatype * sendtype, MTestDatatype * recvtype, MPI_Ai
datatype_index = -1;
}
+ if (datatype_index > 0) {
+ /* general initialization for receive buffer. */
+ recvtype->InitBuf = MTestTypeInitRecv;
+ }
+
datatype_index++;
if (verbose >= 2 && datatype_index > 0) {
@@ -579,11 +584,9 @@ void MTestFreeDatatype(MTestDatatype * mtype)
}
}
-/* Check that a message was received correctly.
- * - status may be NULL or MPI_STATUS_IGNORE;
- * - specify dataset used to be compared;
- * - returns the number of errors detected. */
-int MTestCheckRecv(MPI_Status * status, MTestDatatype * recvtype, MTestDataset dataset)
+/* Check that a message was received correctly. Returns the number of
+ errors detected. Status may be NULL or MPI_STATUS_IGNORE */
+int MTestCheckRecv(MPI_Status * status, MTestDatatype * recvtype)
{
int count;
int errs = 0, merr;
@@ -600,7 +603,7 @@ int MTestCheckRecv(MPI_Status * status, MTestDatatype * recvtype, MTestDataset d
}
/* Check received data */
- if (!errs && recvtype->CheckBuf(recvtype, dataset)) {
+ if (!errs && recvtype->CheckBuf(recvtype)) {
errs++;
}
return errs;
http://git.mpich.org/mpich.git/commitdiff/57d806d45e84c133688a274f1ca09480ebe4df0d
commit 57d806d45e84c133688a274f1ca09480ebe4df0d
Author: Min Si <msi at il.is.s.u-tokyo.ac.jp>
Date: Wed Jul 29 20:53:46 2015 -0500
Revert "Added MTest dataset param for init/check calls in MPI tests"
This patch reverts commit 8833a375f6685898e29ee12be743c6e348d63b15.
Signed-off-by: Pavan Balaji <balaji at anl.gov>
diff --git a/test/mpi/coll/bcast.c b/test/mpi/coll/bcast.c
index df5f01b..f465d01 100644
--- a/test/mpi/coll/bcast.c
+++ b/test/mpi/coll/bcast.c
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
for (root = 0; root < size; root++) {
if (rank == root) {
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
err = MPI_Bcast(sendtype.buf, sendtype.count,
sendtype.datatype, root, comm);
if (err) {
@@ -65,7 +65,7 @@ int main(int argc, char *argv[])
}
}
else {
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
err = MPI_Bcast(recvtype.buf, recvtype.count,
recvtype.datatype, root, comm);
if (err) {
@@ -74,7 +74,7 @@ int main(int argc, char *argv[])
MTestGetIntracommName(), MTestGetDatatypeName(&recvtype));
MTestPrintError(err);
}
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err) {
errs += errs;
}
diff --git a/test/mpi/pt2pt/pingping.c b/test/mpi/pt2pt/pingping.c
index 39ee9ce..d8646f7 100644
--- a/test/mpi/pt2pt/pingping.c
+++ b/test/mpi/pt2pt/pingping.c
@@ -63,10 +63,10 @@ int main( int argc, char *argv[] )
count, MTestGetDatatypeName( &sendtype ),
nbytes*count );
/* Make sure that everyone has a recv buffer */
- recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
+ recvtype.InitBuf( &recvtype );
if (rank == source) {
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+ sendtype.InitBuf( &sendtype );
for (nmsg=1; nmsg<maxmsg; nmsg++) {
err = MPI_Send( sendtype.buf, sendtype.count,
@@ -91,7 +91,7 @@ int main( int argc, char *argv[] )
}
}
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) {
if (errs < 10) {
printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d, message iteration %d of %d\n",
@@ -99,7 +99,7 @@ int main( int argc, char *argv[] )
MTestGetDatatypeName( &sendtype ),
count, nmsg, maxmsg );
recvtype.printErrors = 1;
- (void)MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ (void)MTestCheckRecv( 0, &recvtype );
}
errs += err;
}
diff --git a/test/mpi/pt2pt/sendrecv1.c b/test/mpi/pt2pt/sendrecv1.c
index 7c3cfa2..57059eb 100644
--- a/test/mpi/pt2pt/sendrecv1.c
+++ b/test/mpi/pt2pt/sendrecv1.c
@@ -42,10 +42,10 @@ int main( int argc, char *argv[] )
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
/* Make sure that everyone has a recv buffer */
- recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
+ recvtype.InitBuf( &recvtype );
if (rank == source) {
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+ sendtype.InitBuf( &sendtype );
err = MPI_Send( sendtype.buf, sendtype.count,
sendtype.datatype, dest, 0, comm);
@@ -66,7 +66,7 @@ int main( int argc, char *argv[] )
}
}
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) {
if (errs < 10) {
printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n",
@@ -74,7 +74,7 @@ int main( int argc, char *argv[] )
MTestGetDatatypeName( &sendtype ),
count );
recvtype.printErrors = 1;
- (void)MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ (void)MTestCheckRecv( 0, &recvtype );
}
errs += err;
}
diff --git a/test/mpi/pt2pt/sendself.c b/test/mpi/pt2pt/sendself.c
index 0af472c..6b1e261 100644
--- a/test/mpi/pt2pt/sendself.c
+++ b/test/mpi/pt2pt/sendself.c
@@ -34,8 +34,8 @@ int main( int argc, char *argv[] )
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
- recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
+ sendtype.InitBuf( &sendtype );
+ recvtype.InitBuf( &recvtype );
err = MPI_Irecv( recvtype.buf, recvtype.count,
recvtype.datatype, rank, 0, comm, &req );
@@ -55,7 +55,7 @@ int main( int argc, char *argv[] )
}
}
err = MPI_Wait( &req, MPI_STATUS_IGNORE );
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) {
if (errs < 10) {
printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n",
@@ -63,7 +63,7 @@ int main( int argc, char *argv[] )
MTestGetDatatypeName( &sendtype ),
count );
recvtype.printErrors = 1;
- (void)MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ (void)MTestCheckRecv( 0, &recvtype );
}
errs += err;
}
@@ -86,7 +86,7 @@ int main( int argc, char *argv[] )
}
}
err = MPI_Wait( &req, MPI_STATUS_IGNORE );
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) {
if (errs < 10) {
printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n",
@@ -94,7 +94,7 @@ int main( int argc, char *argv[] )
MTestGetDatatypeName( &sendtype ),
count );
recvtype.printErrors = 1;
- (void)MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ (void)MTestCheckRecv( 0, &recvtype );
}
errs += err;
}
@@ -117,7 +117,7 @@ int main( int argc, char *argv[] )
}
}
err = MPI_Wait( &req, MPI_STATUS_IGNORE );
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) {
if (errs < 10) {
printf( "Data in target buffer did not match for destination datatype %s and source datatype %s, count = %d\n",
@@ -125,7 +125,7 @@ int main( int argc, char *argv[] )
MTestGetDatatypeName( &sendtype ),
count );
recvtype.printErrors = 1;
- (void)MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ (void)MTestCheckRecv( 0, &recvtype );
}
errs += err;
}
diff --git a/test/mpi/rma/accfence1.c b/test/mpi/rma/accfence1.c
index b53d5a7..0ede7ab 100644
--- a/test/mpi/rma/accfence1.c
+++ b/test/mpi/rma/accfence1.c
@@ -39,14 +39,14 @@ int main( int argc, char *argv[] )
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
/* Make sure that everyone has a recv buffer */
- recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
+ recvtype.InitBuf( &recvtype );
MPI_Type_extent( recvtype.datatype, &extent );
MPI_Win_create( recvtype.buf, recvtype.count * extent,
(int)extent, MPI_INFO_NULL, comm, &win );
MPI_Win_fence( 0, win );
if (rank == source) {
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+ sendtype.InitBuf( &sendtype );
/* To improve reporting of problems about operations, we
change the error handler to errors return */
@@ -81,7 +81,7 @@ int main( int argc, char *argv[] )
MPI_Win_fence( 0, win );
/* This should have the same effect, in terms of
transfering data, as a send/recv pair */
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) {
errs += err;
}
diff --git a/test/mpi/rma/accpscw1.c b/test/mpi/rma/accpscw1.c
index 0f7a5fe..893a577 100644
--- a/test/mpi/rma/accpscw1.c
+++ b/test/mpi/rma/accpscw1.c
@@ -40,7 +40,7 @@ int main( int argc, char *argv[] )
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
/* Make sure that everyone has a recv buffer */
- recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
+ recvtype.InitBuf( &recvtype );
MPI_Type_extent( recvtype.datatype, &extent );
MPI_Win_create( recvtype.buf, recvtype.count * extent,
@@ -50,7 +50,7 @@ int main( int argc, char *argv[] )
/* To improve reporting of problems about operations, we
change the error handler to errors return */
MPI_Win_set_errhandler( win, MPI_ERRORS_RETURN );
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+ sendtype.InitBuf( &sendtype );
/* Neighbor is dest only */
MPI_Group_incl( wingroup, 1, &dest, &neighbors );
@@ -85,7 +85,7 @@ int main( int argc, char *argv[] )
MPI_Win_wait( win );
/* This should have the same effect, in terms of
transfering data, as a send/recv pair */
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) {
errs += errs;
}
diff --git a/test/mpi/rma/epochtest.c b/test/mpi/rma/epochtest.c
index d9c12d8..4504454 100644
--- a/test/mpi/rma/epochtest.c
+++ b/test/mpi/rma/epochtest.c
@@ -66,7 +66,7 @@ int main( int argc, char **argv )
MTestGetDatatypeName( &recvtype ) );
/* Make sure that everyone has a recv buffer */
- recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
+ recvtype.InitBuf( &recvtype );
MPI_Type_extent( recvtype.datatype, &extent );
MPI_Win_create( recvtype.buf, recvtype.count * extent,
@@ -82,7 +82,7 @@ int main( int argc, char **argv )
if (err) { if (errs++ < MAX_PERR) MTestPrintError(err); }
/* Source puts */
if (rank == source) {
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+ sendtype.InitBuf( &sendtype );
err = MPI_Put( sendtype.buf, sendtype.count,
sendtype.datatype, dest, 0,
@@ -95,12 +95,12 @@ int main( int argc, char **argv )
if (err) { if (errs++ < MAX_PERR) MTestPrintError(err); }
/* dest checks data, then Dest puts */
if (rank == dest) {
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) { if (errs++ < MAX_PERR) {
PrintRecvedError( "fence 2", &sendtype, &recvtype );
}
}
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+ sendtype.InitBuf( &sendtype );
err = MPI_Put( sendtype.buf, sendtype.count,
sendtype.datatype, source, 0,
@@ -113,12 +113,12 @@ int main( int argc, char **argv )
if (err) { if (errs++ < MAX_PERR) MTestPrintError(err); }
/* src checks data, then Src and dest puts*/
if (rank == source) {
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) { if (errs++ < MAX_PERR) {
PrintRecvedError( "fence 3", &sendtype, &recvtype );
}
}
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+ sendtype.InitBuf( &sendtype );
err = MPI_Put( sendtype.buf, sendtype.count,
sendtype.datatype, dest, 0,
@@ -126,7 +126,7 @@ int main( int argc, char **argv )
if (err) { if (errs++ < MAX_PERR) MTestPrintError(err); }
}
if (rank == dest) {
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+ sendtype.InitBuf( &sendtype );
err = MPI_Put( sendtype.buf, sendtype.count,
sendtype.datatype, source, 0,
@@ -139,14 +139,14 @@ int main( int argc, char **argv )
if (err) { if (errs++ < MAX_PERR) MTestPrintError(err); }
/* src and dest checks data */
if (rank == source) {
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) { if (errs++ < MAX_PERR) {
PrintRecvedError( "src fence4", &sendtype, &recvtype );
}
}
}
if (rank == dest) {
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) { if (errs++ < MAX_PERR) {
PrintRecvedError( "dest fence4", &sendtype, &recvtype );
}
@@ -186,6 +186,6 @@ int PrintRecvedError( const char *msg,
MTestGetDatatypeName( sendtypePtr ) );
/* Redo the test, with the errors printed */
recvtypePtr->printErrors = 1;
- (void)MTestCheckRecv( 0, recvtypePtr, MTEST_DATA_SET1 );
+ (void)MTestCheckRecv( 0, recvtypePtr );
return 0;
}
diff --git a/test/mpi/rma/getfence1.c b/test/mpi/rma/getfence1.c
index 10a3e57..80034df 100644
--- a/test/mpi/rma/getfence1.c
+++ b/test/mpi/rma/getfence1.c
@@ -30,8 +30,8 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
sendtype->count, MTestGetDatatypeName( sendtype ), recvtype->count,
MTestGetDatatypeName( recvtype ) );
/* Make sure that everyone has a recv buffer */
- recvtype->InitBuf( recvtype, MTEST_DATA_EMPTY );
- sendtype->InitBuf( sendtype, MTEST_DATA_SET1 );
+ recvtype->InitBuf( recvtype );
+ sendtype->InitBuf( sendtype );
/* By default, print information about errors */
recvtype->printErrors = 1;
sendtype->printErrors = 1;
@@ -69,7 +69,7 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
MTestPrintError( err );
}
}
- err = MTestCheckRecv( 0, recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, recvtype );
if (err) {
errs += err;
}
diff --git a/test/mpi/rma/lock_contention_dt.c b/test/mpi/rma/lock_contention_dt.c
index 97ddb2b..394f799 100644
--- a/test/mpi/rma/lock_contention_dt.c
+++ b/test/mpi/rma/lock_contention_dt.c
@@ -36,13 +36,13 @@ int main(int argc, char *argv[])
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
recvtype.printErrors = 1;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
(int) extent, MPI_INFO_NULL, comm, &win);
if (rank != target) {
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
MPI_Win_lock(MPI_LOCK_EXCLUSIVE, target, 0, win);
MPI_Accumulate(sendtype.buf, sendtype.count,
@@ -69,10 +69,10 @@ int main(int argc, char *argv[])
int err;
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Win_unlock(rank, win);
/*signal the source that checking and reinitialization is done */
@@ -80,7 +80,7 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_EXCLUSIVE, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
MPI_Win_unlock(rank, win);
diff --git a/test/mpi/rma/lock_dt.c b/test/mpi/rma/lock_dt.c
index d3429ec..f98d4f4 100644
--- a/test/mpi/rma/lock_dt.c
+++ b/test/mpi/rma/lock_dt.c
@@ -38,13 +38,13 @@ int main(int argc, char *argv[])
while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
recvtype.printErrors = 1;
/* Make sure that everyone has a recv buffer */
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
(int) extent, MPI_INFO_NULL, comm, &win);
if (rank == source) {
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
MPI_Accumulate(sendtype.buf, sendtype.count,
@@ -71,10 +71,10 @@ int main(int argc, char *argv[])
int err;
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Win_unlock(dest, win);
/*signal the source that checking and reinitialization is done */
@@ -82,7 +82,7 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
MPI_Win_unlock(dest, win);
diff --git a/test/mpi/rma/lock_dt_flush.c b/test/mpi/rma/lock_dt_flush.c
index 4f61232..336da04 100644
--- a/test/mpi/rma/lock_dt_flush.c
+++ b/test/mpi/rma/lock_dt_flush.c
@@ -37,13 +37,13 @@ int main(int argc, char *argv[])
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
recvtype.printErrors = 1;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
(int) extent, MPI_INFO_NULL, comm, &win);
if (rank == source) {
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
MPI_Accumulate(sendtype.buf, sendtype.count,
@@ -78,10 +78,10 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Barrier(comm);
MPI_Win_unlock(dest, win);
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
MPI_Barrier(comm);
diff --git a/test/mpi/rma/lock_dt_flushlocal.c b/test/mpi/rma/lock_dt_flushlocal.c
index f76bdfc..fe6db8a 100644
--- a/test/mpi/rma/lock_dt_flushlocal.c
+++ b/test/mpi/rma/lock_dt_flushlocal.c
@@ -39,7 +39,7 @@ int main(int argc, char *argv[])
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
recvtype.printErrors = 1;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
@@ -47,7 +47,7 @@ int main(int argc, char *argv[])
if (rank == source) {
MPI_Aint slb, sextent;
MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
MPI_Accumulate(sendtype.buf, sendtype.count,
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
MPI_Win_unlock(dest, win);
MPI_Barrier(comm);
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
/*wait for the destination to finish checking and reinitializing the buffer */
@@ -81,10 +81,10 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Win_unlock(dest, win);
/*signal the source that checking and reinitialization is done */
@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, dest, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
MPI_Win_unlock(dest, win);
diff --git a/test/mpi/rma/lockall_dt.c b/test/mpi/rma/lockall_dt.c
index 542b4ac..bdb7e97 100644
--- a/test/mpi/rma/lockall_dt.c
+++ b/test/mpi/rma/lockall_dt.c
@@ -36,14 +36,14 @@ int main(int argc, char *argv[])
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
recvtype.printErrors = 1;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
(int) extent, MPI_INFO_NULL, comm, &win);
if (rank == source) {
int dest;
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
MPI_Win_lock_all(0, win);
for (dest = 0; dest < size; dest++)
@@ -77,10 +77,10 @@ int main(int argc, char *argv[])
int err;
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Win_unlock(rank, win);
/*signal the source that checking and reinitialization is done */
@@ -88,7 +88,7 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
MPI_Win_unlock(rank, win);
diff --git a/test/mpi/rma/lockall_dt_flush.c b/test/mpi/rma/lockall_dt_flush.c
index e57dc40..f6ddde3 100644
--- a/test/mpi/rma/lockall_dt_flush.c
+++ b/test/mpi/rma/lockall_dt_flush.c
@@ -36,14 +36,14 @@ int main(int argc, char *argv[])
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
recvtype.printErrors = 1;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
(int) extent, MPI_INFO_NULL, comm, &win);
if (rank == source) {
int dest;
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
MPI_Win_lock_all(0, win);
@@ -85,10 +85,10 @@ int main(int argc, char *argv[])
int err;
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Barrier(comm);
MPI_Win_unlock(rank, win);
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
MPI_Barrier(comm);
diff --git a/test/mpi/rma/lockall_dt_flushall.c b/test/mpi/rma/lockall_dt_flushall.c
index 08b84a1..9fdf416 100644
--- a/test/mpi/rma/lockall_dt_flushall.c
+++ b/test/mpi/rma/lockall_dt_flushall.c
@@ -36,14 +36,14 @@ int main(int argc, char *argv[])
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
recvtype.printErrors = 1;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
(int) extent, MPI_INFO_NULL, comm, &win);
if (rank == source) {
int dest;
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
MPI_Win_lock_all(0, win);
for (dest = 0; dest < size; dest++)
@@ -86,10 +86,10 @@ int main(int argc, char *argv[])
int err;
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Barrier(comm);
MPI_Win_unlock(rank, win);
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
MPI_Barrier(comm);
diff --git a/test/mpi/rma/lockall_dt_flushlocal.c b/test/mpi/rma/lockall_dt_flushlocal.c
index d40e6bc..a3726b6 100644
--- a/test/mpi/rma/lockall_dt_flushlocal.c
+++ b/test/mpi/rma/lockall_dt_flushlocal.c
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
recvtype.printErrors = 1;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
int dest;
MPI_Aint slb, sextent;
MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
MPI_Win_lock_all(0, win);
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
MPI_Win_unlock_all(win);
MPI_Barrier(comm);
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
/*wait for the destinations to finish checking and reinitializing the buffers */
@@ -87,10 +87,10 @@ int main(int argc, char *argv[])
int err;
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Win_unlock(rank, win);
/*signal the source that checking and reinitialization is done */
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
MPI_Win_unlock(rank, win);
diff --git a/test/mpi/rma/lockall_dt_flushlocalall.c b/test/mpi/rma/lockall_dt_flushlocalall.c
index acd4853..9d662fa 100644
--- a/test/mpi/rma/lockall_dt_flushlocalall.c
+++ b/test/mpi/rma/lockall_dt_flushlocalall.c
@@ -37,7 +37,7 @@ int main(int argc, char *argv[])
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes(&sendtype, &recvtype, count)) {
recvtype.printErrors = 1;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Type_get_extent(recvtype.datatype, &lb, &extent);
MPI_Win_create(recvtype.buf, lb + recvtype.count * extent,
@@ -46,7 +46,7 @@ int main(int argc, char *argv[])
int dest;
MPI_Aint slb, sextent;
MPI_Type_get_extent(sendtype.datatype, &slb, &sextent);
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
MPI_Win_lock_all(0, win);
for (dest = 0; dest < size; dest++)
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
MPI_Win_unlock_all(win);
MPI_Barrier(comm);
- sendtype.InitBuf(&sendtype, MTEST_DATA_SET1);
+ sendtype.InitBuf(&sendtype);
char *resbuf = (char *) calloc(lb + extent * recvtype.count, sizeof(char));
/*wait for the destination to finish checking and reinitializing the buffer */
@@ -88,10 +88,10 @@ int main(int argc, char *argv[])
int err;
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
- recvtype.InitBuf(&recvtype, MTEST_DATA_EMPTY);
+ recvtype.InitBuf(&recvtype);
MPI_Win_unlock(rank, win);
/*signal the source that checking and reinitialization is done */
@@ -99,7 +99,7 @@ int main(int argc, char *argv[])
MPI_Barrier(comm);
MPI_Win_lock(MPI_LOCK_SHARED, rank, 0, win);
- err = MTestCheckRecv(0, &recvtype, MTEST_DATA_SET1);
+ err = MTestCheckRecv(0, &recvtype);
if (err)
errs++;
MPI_Win_unlock(rank, win);
diff --git a/test/mpi/rma/putfence1.c b/test/mpi/rma/putfence1.c
index b79a10a..de13720 100644
--- a/test/mpi/rma/putfence1.c
+++ b/test/mpi/rma/putfence1.c
@@ -30,7 +30,7 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
MTestGetDatatypeName( recvtype ) );
/* Make sure that everyone has a recv buffer */
- recvtype->InitBuf( recvtype, MTEST_DATA_EMPTY );
+ recvtype->InitBuf( recvtype );
MPI_Type_extent( recvtype->datatype, &extent );
MPI_Win_create( recvtype->buf, recvtype->count * extent,
extent, MPI_INFO_NULL, comm, &win );
@@ -40,7 +40,7 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
change the error handler to errors return */
MPI_Win_set_errhandler( win, MPI_ERRORS_RETURN );
- sendtype->InitBuf( sendtype, MTEST_DATA_SET1 );
+ sendtype->InitBuf( sendtype );
err = MPI_Put( sendtype->buf, sendtype->count,
sendtype->datatype, dest, 0,
@@ -63,7 +63,7 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
MPI_Win_fence( 0, win );
/* This should have the same effect, in terms of
transfering data, as a send/recv pair */
- err = MTestCheckRecv( 0, recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, recvtype );
if (err) {
if (errs < 10) {
printf( "Data in target buffer did not match for destination datatype %s (put with source datatype %s)\n",
@@ -71,7 +71,7 @@ static inline int test(MPI_Comm comm, int rank, int source, int dest,
MTestGetDatatypeName( sendtype ) );
/* Redo the test, with the errors printed */
recvtype->printErrors = 1;
- (void)MTestCheckRecv( 0, recvtype, MTEST_DATA_SET1 );
+ (void)MTestCheckRecv( 0, recvtype );
}
errs += err;
}
diff --git a/test/mpi/rma/putpscw1.c b/test/mpi/rma/putpscw1.c
index d8cc9ef..fb05df5 100644
--- a/test/mpi/rma/putpscw1.c
+++ b/test/mpi/rma/putpscw1.c
@@ -40,7 +40,7 @@ int main( int argc, char *argv[] )
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
/* Make sure that everyone has a recv buffer */
- recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
+ recvtype.InitBuf( &recvtype );
MPI_Type_extent( recvtype.datatype, &extent );
MPI_Win_create( recvtype.buf, recvtype.count * extent,
@@ -50,7 +50,7 @@ int main( int argc, char *argv[] )
/* To improve reporting of problems about operations, we
change the error handler to errors return */
MPI_Win_set_errhandler( win, MPI_ERRORS_RETURN );
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+ sendtype.InitBuf( &sendtype );
/* Neighbor is dest only */
MPI_Group_incl( wingroup, 1, &dest, &neighbors );
@@ -84,7 +84,7 @@ int main( int argc, char *argv[] )
MPI_Win_wait( win );
/* This should have the same effect, in terms of
transfering data, as a send/recv pair */
- err = MTestCheckRecv( 0, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( 0, &recvtype );
if (err) {
errs += errs;
}
diff --git a/test/mpi/template.c b/test/mpi/template.c
index a498f10..801fc5e 100644
--- a/test/mpi/template.c
+++ b/test/mpi/template.c
@@ -41,7 +41,7 @@ int main( int argc, char *argv[] )
MTEST_DATATYPE_FOR_EACH_COUNT(count) {
while (MTestGetDatatypes( &sendtype, &recvtype, count )) {
if (rank == source) {
- sendtype.InitBuf( &sendtype, MTEST_DATA_SET1 );
+ sendtype.InitBuf( &sendtype );
err = MPI_Send( sendtype.buf, sendtype.count,
sendtype.datatype, dest, 0, comm );
@@ -52,7 +52,7 @@ int main( int argc, char *argv[] )
MTestFreeDatatype( &sendtype );
}
else if (rank == dest) {
- recvtype.InitBuf( &recvtype, MTEST_DATA_EMPTY );
+ recvtype.InitBuf( &recvtype );
err = MPI_Recv( recvtype.buf, recvtype.count,
recvtype.datatype, source, 0, comm, &status );
if (err) {
@@ -62,7 +62,7 @@ int main( int argc, char *argv[] )
MTestGetDatatypeName( &recvtype ) );
MTestPrintError( err );
}
- err = MTestCheckRecv( &status, &recvtype, MTEST_DATA_SET1 );
+ err = MTestCheckRecv( &status, &recvtype );
if (err) {
errs += errs;
}
-----------------------------------------------------------------------
Summary of changes:
test/mpi/coll/bcast.c | 6 +-
test/mpi/include/mpitest.h | 15 +-
test/mpi/pt2pt/pingping.c | 8 +-
test/mpi/pt2pt/sendrecv1.c | 8 +-
test/mpi/pt2pt/sendself.c | 16 +-
test/mpi/rma/accfence1.c | 6 +-
test/mpi/rma/accpscw1.c | 6 +-
test/mpi/rma/epochtest.c | 20 +-
test/mpi/rma/getfence1.c | 6 +-
test/mpi/rma/lock_contention_dt.c | 10 +-
test/mpi/rma/lock_dt.c | 10 +-
test/mpi/rma/lock_dt_flush.c | 10 +-
test/mpi/rma/lock_dt_flushlocal.c | 12 +-
test/mpi/rma/lockall_dt.c | 10 +-
test/mpi/rma/lockall_dt_flush.c | 10 +-
test/mpi/rma/lockall_dt_flushall.c | 10 +-
test/mpi/rma/lockall_dt_flushlocal.c | 12 +-
test/mpi/rma/lockall_dt_flushlocalall.c | 12 +-
test/mpi/rma/putfence1.c | 8 +-
test/mpi/rma/putpscw1.c | 6 +-
test/mpi/template.c | 6 +-
test/mpi/util/mtest_datatype.c | 467 ++++++++++++-------------------
test/mpi/util/mtest_datatype.h | 1 +
test/mpi/util/mtest_datatype_gen.c | 19 +-
24 files changed, 296 insertions(+), 398 deletions(-)
hooks/post-receive
--
MPICH primary repository
More information about the commits
mailing list