5 #if defined(NEEDS_STDLIB_PROTOTYPES)
10 This is a very simple MPI program which can be used to check things
11 like the behavior of the ADI or heterogeneous code
13 int main( int argc, char **argv )
22 MPI_Init( &argc, &argv );
23 MPI_Comm_size( MPI_COMM_WORLD, &size );
24 MPI_Comm_rank( MPI_COMM_WORLD, &rank );
26 MPI_Abort( MPI_COMM_WORLD, 1 );
32 strcpy( msg, "MPICH!" );
33 MPI_Send( msg, 7, MPI_CHAR, dest, 10, MPI_COMM_WORLD );
36 MPI_Recv( smsg, 10, MPI_CHAR, src, 10, MPI_COMM_WORLD, &status );
37 if (status.MPI_TAG != 10) {
38 fprintf( stderr, "Error in status tag!\n" );
40 if (status.MPI_SOURCE != src) {
41 fprintf( stderr, "Error in status source!\n" );
43 MPI_Get_count( &status, MPI_CHAR, &count );
45 fprintf( stderr, "Error in count, got %d expected 7\n", count );
47 if (strcmp( smsg, "MPICH!" )) {
48 fprintf( stderr, "Got wrong msg (%s), expected \"MPICH!\"\n", smsg );