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,
41 displacements, MPI_INT,
45 int ni, na, nd, combiner;
50 MPI_Type_get_envelope(t, &ni, &na, &nd, &combiner);
51 MPI_Type_get_contents(t, ni, na, nd, i, a, d);
58 for (k=0; k < na; k++)
59 check(a[k] == (k * 8));
62 check(d[0] == MPI_INT);
70 printf("found %d errors\n", errs);
73 printf(" No errors\n");