1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2012 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
7 /* test based on a bug report from Lisandro Dalcin:
8 * http://lists.mcs.anl.gov/pipermail/mpich-dev/2012-October/000978.html */
13 /* USE_STRICT_MPI may be defined in mpitestconf.h */
14 #include "mpitestconf.h"
16 /* assert-like macro that bumps the err count and emits a message */
22 fprintf(stderr, "check failed: (%s), line %d\n", #x_, __LINE__); \
27 int main(int argc, char **argv)
34 MPI_Aint displacements[] = { 0, 8, 16, 24 };
36 MPI_Init(&argc, &argv);
37 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
40 MPI_Type_create_hindexed_block(count, blocklength, displacements, MPI_INT, &t);
43 int ni, na, nd, combiner;
48 MPI_Type_get_envelope(t, &ni, &na, &nd, &combiner);
49 MPI_Type_get_contents(t, ni, na, nd, i, a, d);
56 for (k = 0; k < na; k++)
57 check(a[k] == (k * 8));
60 check(d[0] == MPI_INT);
68 printf("found %d errors\n", errs);
71 printf(" No errors\n");