1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2006 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
10 void foo(void *sendbuf, MPI_Datatype sendtype, void *recvbuf, MPI_Datatype recvtype);
11 void foo(void *sendbuf, MPI_Datatype sendtype, void *recvbuf, MPI_Datatype recvtype)
14 MPI_Aint struct_displs[2];
15 MPI_Datatype types[2], tmp_type;
18 MPI_Get_address(sendbuf, &struct_displs[0]);
21 MPI_Get_address(recvbuf, &struct_displs[1]);
24 MPI_Type_create_struct(2, blocks, struct_displs, types, &tmp_type);
25 MPI_Type_commit(&tmp_type);
26 MPI_Type_free(&tmp_type);
29 int main(int argc, char **argv)
33 MTest_Init(&argc, &argv);
35 foo((void *) 0x1, MPI_FLOAT_INT, (void *) 0x2, MPI_BYTE);
36 foo((void *) 0x1, MPI_DOUBLE_INT, (void *) 0x2, MPI_BYTE);
37 foo((void *) 0x1, MPI_LONG_INT, (void *) 0x2, MPI_BYTE);
38 foo((void *) 0x1, MPI_SHORT_INT, (void *) 0x2, MPI_BYTE);
39 foo((void *) 0x1, MPI_2INT, (void *) 0x2, MPI_BYTE);
40 #ifdef HAVE_LONG_DOUBLE
41 /* Optional type may be NULL */
42 if (MPI_LONG_DOUBLE_INT != MPI_DATATYPE_NULL) {
43 foo((void *) 0x1, MPI_LONG_DOUBLE_INT, (void *) 0x2, MPI_BYTE);