3 > so, my second question:
5 > 2. what is the output of that MPI program?
7 > i think it should be 42 -1 42 -1.
9 > but compiling with mpich-1.1.0 an running on solaris machines
10 > (ch_p4) writes : 42 -1 42 0.
16 > -------------------------------------------------------
23 int main( int argc, char **argv )
25 int my_rank, i, data[6];
28 int errs = 0, toterrs;
30 MPI_Init(&argc, &argv);
31 MPI_Comm_rank(MPI_COMM_WORLD, &my_rank);
33 MPI_Type_vector(2, 1, 2, MPI_INT, &my_type);
34 MPI_Type_commit(&my_type);
37 data[0]=42;data[1]=42;
38 MPI_Send(&(data[0]), 2, MPI_INT, 1, 42, MPI_COMM_WORLD);
42 MPI_Recv(&(data[0]), 2, my_type, 0, 42, MPI_COMM_WORLD, &status);
43 /* Check for correct receipt */
44 if (data[0] != 42 || data[1] != -1 || data[2] != 42 || data[3] != -1
45 || data[4] != -1 || data[5] != -1) {
48 printf("%i ",data[i]);
52 MPI_Allreduce( &errs, &toterrs, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD );
54 if (toterrs > 0) printf( "Found %d errors\n", toterrs );
55 else printf( " No Errors\n" );
58 MPI_Type_free( &my_type );