1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
3 * (C) 2008 by Argonne National Laboratory.
4 * See COPYRIGHT in top-level directory.
15 char s_buf[EL_COUNT * SIZE];
16 char r_buf[EL_COUNT * SIZE];
18 int main(int argc, char **argv)
23 MPI_Datatype struct_type, type1[COUNT];
24 MPI_Aint disp1[COUNT] = { 0, 0, 332, 340 };
25 int block1[COUNT] = { 1, 56, 2, 1 };
27 MPI_Init(&argc, &argv);
28 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
29 MPI_Comm_size(MPI_COMM_WORLD, &size);
36 MPI_Type_struct(4, block1, disp1, type1, &struct_type);
38 ret = MPI_Type_commit(&struct_type);
39 if (ret != MPI_SUCCESS) {
40 fprintf(stderr, "Could not make struct type."), fflush(stderr);
41 MPI_Abort(MPI_COMM_WORLD, 1);
44 memset(s_buf, 0, EL_COUNT * SIZE);
45 memset(r_buf, 0, EL_COUNT * SIZE);
47 MPI_Isend(s_buf, EL_COUNT, struct_type, 0, 4, MPI_COMM_WORLD, &request);
48 MPI_Recv(r_buf, EL_COUNT, struct_type, 0, 4, MPI_COMM_WORLD, &Status);
49 MPI_Wait(&request, &Status);
51 MPI_Type_free(&struct_type);
55 printf(" No Errors\n");