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,
11 MPI_Datatype recvtype);
12 void foo(void *sendbuf, MPI_Datatype sendtype, void *recvbuf,
13 MPI_Datatype recvtype)
16 MPI_Aint struct_displs[2];
17 MPI_Datatype types[2], tmp_type;
20 MPI_Get_address( sendbuf, &struct_displs[0] );
23 MPI_Get_address( recvbuf, &struct_displs[1] );
26 MPI_Type_create_struct(2, blocks, struct_displs, types, &tmp_type);
27 MPI_Type_commit(&tmp_type);
28 MPI_Type_free(&tmp_type);
31 int main(int argc, char **argv)
35 MTest_Init(&argc, &argv);
37 foo((void*) 0x1, MPI_FLOAT_INT, (void*) 0x2, MPI_BYTE);
38 foo((void*) 0x1, MPI_DOUBLE_INT, (void*) 0x2, MPI_BYTE);
39 foo((void*) 0x1, MPI_LONG_INT, (void*) 0x2, MPI_BYTE);
40 foo((void*) 0x1, MPI_SHORT_INT, (void*) 0x2, MPI_BYTE);
41 foo((void*) 0x1, MPI_2INT, (void*) 0x2, MPI_BYTE);
42 #ifdef HAVE_LONG_DOUBLE
43 /* Optional type may be NULL */
44 if (MPI_LONG_DOUBLE_INT != MPI_DATATYPE_NULL) {
45 foo((void*) 0x1, MPI_LONG_DOUBLE_INT, (void*) 0x2, MPI_BYTE);