- while (MTestGetIntracomm( &comm, 2 )) {
- if (comm == MPI_COMM_NULL) continue;
- MPI_Comm_rank( comm, &rank );
- MPI_Comm_size( comm, &np );
- if (np < 2) continue;
- tag++;
- for (j=0; j<ntype; j++) {
- MPI_Type_get_name( types[j], myname, &mynamelen );
- if (world_rank == 0)
- MTestPrintfMsg( 10, "Testing type %s\n", myname );
- if (rank == 0) {
- MPI_Get_address( inbufs[j], &displ );
- blen = 1;
- MPI_Type_create_struct( 1, &blen, &displ, types + j,
- &offsettype );
- MPI_Type_commit( &offsettype );
- /* Warning: if the type has an explicit MPI_UB, then using a
- simple shift of the offset won't work. For now, we skip
- types whose extents are negative; the correct solution is
- to add, where required, an explicit MPI_UB */
- MPI_Type_extent( offsettype, &extent );
- if (extent < 0) {
- if (world_rank == 0)
- MTestPrintfMsg( 10,
- "... skipping (appears to have explicit MPI_UB\n" );
- MPI_Type_free( &offsettype );
- continue;
- }
- MPI_Type_extent( types[j], &natural_extent );
- if (natural_extent != extent) {
- MPI_Type_free( &offsettype );
- continue;
- }
- partner = np - 1;
- MPI_Send( MPI_BOTTOM, counts[j], offsettype, partner, tag,
- comm );
- MPI_Type_free( &offsettype );
+ while (MTestGetIntracomm(&comm, 2)) {
+ if (comm == MPI_COMM_NULL)
+ continue;
+ MPI_Comm_rank(comm, &rank);
+ MPI_Comm_size(comm, &np);
+ if (np < 2)
+ continue;
+ tag++;
+ for (j = 0; j < ntype; j++) {
+ MPI_Type_get_name(types[j], myname, &mynamelen);
+ if (world_rank == 0)
+ MTestPrintfMsg(10, "Testing type %s\n", myname);
+ if (rank == 0) {
+ MPI_Get_address(inbufs[j], &displ);
+ blen = 1;
+ MPI_Type_create_struct(1, &blen, &displ, types + j, &offsettype);
+ MPI_Type_commit(&offsettype);
+ /* Warning: if the type has an explicit MPI_UB, then using a
+ * simple shift of the offset won't work. For now, we skip
+ * types whose extents are negative; the correct solution is
+ * to add, where required, an explicit MPI_UB */
+ MPI_Type_extent(offsettype, &extent);
+ if (extent < 0) {
+ if (world_rank == 0)
+ MTestPrintfMsg(10, "... skipping (appears to have explicit MPI_UB\n");
+ MPI_Type_free(&offsettype);
+ continue;
+ }
+ MPI_Type_extent(types[j], &natural_extent);
+ if (natural_extent != extent) {
+ MPI_Type_free(&offsettype);
+ continue;
+ }
+ partner = np - 1;
+ MPI_Send(MPI_BOTTOM, counts[j], offsettype, partner, tag, comm);
+ MPI_Type_free(&offsettype);