1 /* -*- Mode: c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2012 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
7 /* This test checks for the existence of four new C++ named predefined datatypes
8 * that should be accessible from C (and Fortran, not tested here). */
15 /* assert-like macro that bumps the err count and emits a message */
21 fprintf(stderr, "check failed: (%s), line %d\n", #x_, __LINE__); \
26 int main(int argc, char *argv[])
32 MPI_Init(&argc, &argv);
33 MPI_Comm_rank(MPI_COMM_WORLD, &wrank);
34 MPI_Comm_size(MPI_COMM_WORLD, &wsize);
36 /* perhaps the MPI library has no CXX support, in which case let's assume
37 * that these constants exist and were set to MPI_DATATYPE_NULL (standard
39 #define check_type(type_) \
42 if (type_ != MPI_DATATYPE_NULL) { \
43 MPI_Type_size(type_, &size); \
48 check_type(MPI_CXX_BOOL);
49 check_type(MPI_CXX_FLOAT_COMPLEX);
50 check_type(MPI_CXX_DOUBLE_COMPLEX);
51 check_type(MPI_CXX_LONG_DOUBLE_COMPLEX);
53 MPI_Reduce((wrank == 0 ? MPI_IN_PLACE : &errs), &errs, 1, MPI_INT, MPI_SUM, 0, MPI_COMM_WORLD);
56 printf("found %d errors\n", errs);
59 printf(" No errors\n");