1 #include <stdio.h>
2 #include <mpi.h>
3 
main(int nargs,char ** args)4 main(int nargs, char **args)
5 {
6    MPI_Datatype Dtype, Dt;
7    int i, j, ierr;
8 
9    MPI_Init(&nargs, &args);
10    printf( "If this routine does not complete, you should set SYSERRORS = -DZeroByteTypeBug.\n");
11 
12    i = 0;
13    j = 1;
14    ierr = MPI_Type_indexed(1, &i, &j, MPI_INT, &Dtype);
15    if (ierr == MPI_SUCCESS)
16    {
17       MPI_Type_commit(&Dtype);
18       ierr = MPI_Type_vector(0, 1, 1, MPI_INT, &Dt);
19       if (ierr != MPI_SUCCESS)
20          printf("MPI_Type_vector returned %d, set SYSERRORS = -DZeroByteTypeBug\n", ierr);
21       else MPI_Type_commit(&Dt);
22    }
23    else printf("MPI_Type_commit returned %d, set SYSERRORS = -DZeroByteTypeBug\n", ierr);
24    if (ierr == MPI_SUCCESS) printf("Leave SYSERRORS blank for this system.\n");
25 
26    MPI_Finalize();
27 }
28