4 #if defined(NEEDS_STDLIB_PROTOTYPES)
9 int main( int argc, char *argv[] )
20 MPI_Init(&argc, &argv);
21 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
22 MPI_Comm_size(MPI_COMM_WORLD, &size);
24 /* This test depends on a working wtime. Make a simple check */
26 if (t0 == 0 && MPI_Wtime() == 0) {
27 int loopcount = 1000000;
28 /* This test is too severe (systems with fast
29 processors and large MPI_Wtick values can
30 fail. Try harder to test MPI_Wtime */
31 while (loopcount-- && MPI_Wtime() == 0) ;
34 "MPI_WTIME is returning 0; a working value is needed\n\
36 MPI_Abort( MPI_COMM_WORLD, 1 );
43 MPI_Barrier( MPI_COMM_WORLD );
46 MPI_Irecv(&a, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &request);
47 MPI_Recv(&b, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &status);
48 MPI_Wait(&request, &status);
49 /* Check for correct values: */
50 if (a == 1 && b == 2) {
51 printf( " No Errors\n" );
54 printf("rank = %d, a = %d, b = %d\n", rank, a, b);
61 //while (MPI_Wtime() - t1 < easy) ;
64 MPI_Send(&a, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);
65 MPI_Send(&b, 1, MPI_INT, 0, 0, MPI_COMM_WORLD);