- int tflag;
- MPI_Barrier( comm );
- MPI_Barrier( comm );
- MPI_Send( buf0, n0, MPI_INT, dest, 0, comm );
- MPI_Isend( buf2, n2, MPI_INT, dest, 2, comm, &r[1] );
- MPI_Isend( buf1, n1, MPI_INT, dest, 4, comm, &r[0] );
- MPI_Cancel( &r[0] );
- memset( s, -3, sizeof(s) );
- s[0].MPI_ERROR = -3;
- s[1].MPI_ERROR = -3;
- MPI_Testall( 2, r, &tflag, s );
- if (tflag) {
- MPI_Test_cancelled( &s[0], &flag );
- if (!flag) {
- errs++;
- printf( "send request 0 was not cancelled!\n" );
- }
- MPI_Test_cancelled( &s[1], &flag );
- if (flag) {
- errs++;
- printf( "send request 1 was cancelled!\n" );
- }
- }
- else {
- /* If all requests are not complete, then neither r nor s
- may be changed */
- if ( (s[0].MPI_ERROR) != -3) {
- errs++;
- printf( "Send request status 0 modified. s[0].MPI_ERROR = %x\n",
- s[0].MPI_ERROR );
- }
- if ( (s[1].MPI_ERROR) != -3) {
- errs++;
- printf( "Send request status 1 modified. s[1].MPI_ERROR = %x\n",
- s[1].MPI_ERROR );
- }
- }
- MPI_Barrier( comm );
- while (!tflag) {
- MPI_Testall( 2, r, &tflag, s );
- }
- MPI_Test_cancelled( &s[0], &flag );
- if (!flag) {
- errs++;
- printf( "send request 0 was not cancelled!\n" );
- }
- MPI_Test_cancelled( &s[1], &flag );
- if (flag) {
- errs++;
- printf( "send request 1 was cancelled!\n" );
- }
+ int tflag;
+ MPI_Barrier(comm);
+ MPI_Barrier(comm);
+ MPI_Send(buf0, n0, MPI_INT, dest, 0, comm);
+ MPI_Isend(buf2, n2, MPI_INT, dest, 2, comm, &r[1]);
+ MPI_Isend(buf1, n1, MPI_INT, dest, 4, comm, &r[0]);
+ MPI_Cancel(&r[0]);
+ memset(s, -3, sizeof(s));
+ s[0].MPI_ERROR = -3;
+ s[1].MPI_ERROR = -3;
+ MPI_Testall(2, r, &tflag, s);
+ if (tflag) {
+ MPI_Test_cancelled(&s[0], &flag);
+ if (!flag) {
+ errs++;
+ printf("send request 0 was not cancelled!\n");
+ }
+ MPI_Test_cancelled(&s[1], &flag);
+ if (flag) {
+ errs++;
+ printf("send request 1 was cancelled!\n");
+ }
+ }
+ else {
+ /* If all requests are not complete, then neither r nor s
+ * may be changed */
+ if ((s[0].MPI_ERROR) != -3) {
+ errs++;
+ printf("Send request status 0 modified. s[0].MPI_ERROR = %d\n", s[0].MPI_ERROR);
+ }
+ if ((s[1].MPI_ERROR) != -3) {
+ errs++;
+ printf("Send request status 1 modified. s[1].MPI_ERROR = %d\n", s[1].MPI_ERROR);
+ }
+ }
+ MPI_Barrier(comm);
+ while (!tflag) {
+ MPI_Testall(2, r, &tflag, s);
+ }
+ MPI_Test_cancelled(&s[0], &flag);
+ if (!flag) {
+ errs++;
+ printf("send request 0 was not cancelled!\n");
+ }
+ MPI_Test_cancelled(&s[1], &flag);
+ if (flag) {
+ errs++;
+ printf("send request 1 was cancelled!\n");
+ }