- status.MPI_SOURCE = -1;
- status.MPI_TAG = -1;
- MPI_Request_get_status( req, &flag, &status );
- if (flag) {
- if (status.MPI_TAG != 10) {
- errs++;
- fprintf( stderr, "Tag value %d should be 10\n", status.MPI_TAG );
- }
- if (status.MPI_SOURCE != source) {
- errs++;
- fprintf( stderr, "Source value %d should be %d\n", status.MPI_SOURCE, source );
- }
- MPI_Get_count( &status, MPI_INT, &count );
- if (count != 2) {
- errs++;
- fprintf( stderr, "Count value %d should be 2\n", count );
- }
- }
- else {
- errs++;
- fprintf( stderr, "Unexpected flag value from get_status\n" );
- }
- /* Now, complete the request */
- MPI_Wait( &req, &status2 );
- /* Check that the status is correct */
- if (status2.MPI_TAG != 10) {
- errs++;
- fprintf( stderr, "(wait)Tag value %d should be 10\n", status2.MPI_TAG );
- }
- if (status2.MPI_SOURCE != source) {
- errs++;
- fprintf( stderr, "(wait)Source value %d should be %d\n", status2.MPI_SOURCE, source );
- }
- MPI_Get_count( &status2, MPI_INT, &count );
- if (count != 2) {
- errs++;
- fprintf( stderr, "(wait)Count value %d should be 2\n", count );
- }
+ status.MPI_SOURCE = -1;
+ status.MPI_TAG = -1;
+ MPI_Request_get_status(req, &flag, &status);
+ if (flag) {
+ if (status.MPI_TAG != 10) {
+ errs++;
+ fprintf(stderr, "Tag value %d should be 10\n", status.MPI_TAG);
+ }
+ if (status.MPI_SOURCE != source) {
+ errs++;
+ fprintf(stderr, "Source value %d should be %d\n", status.MPI_SOURCE, source);
+ }
+ MPI_Get_count(&status, MPI_INT, &count);
+ if (count != 2) {
+ errs++;
+ fprintf(stderr, "Count value %d should be 2\n", count);
+ }
+ }
+ else {
+ errs++;
+ fprintf(stderr, "Unexpected flag value from get_status\n");
+ }
+ /* Now, complete the request */
+ MPI_Wait(&req, &status2);
+ /* Check that the status is correct */
+ if (status2.MPI_TAG != 10) {
+ errs++;
+ fprintf(stderr, "(wait)Tag value %d should be 10\n", status2.MPI_TAG);
+ }
+ if (status2.MPI_SOURCE != source) {
+ errs++;
+ fprintf(stderr, "(wait)Source value %d should be %d\n", status2.MPI_SOURCE, source);
+ }
+ MPI_Get_count(&status2, MPI_INT, &count);
+ if (count != 2) {
+ errs++;
+ fprintf(stderr, "(wait)Count value %d should be 2\n", count);
+ }