diff --git a/src/H5Smpio.c b/src/H5Smpio.c index dd58f279cc..946c863c00 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -50,7 +50,7 @@ static intn interface_initialize_g = FALSE; *------------------------------------------------------------------------- */ herr_t -H5S_mpio_all_type( const H5S_t *space, const hsize_t elmt_size, +H5S_mpio_all_type( const H5S_t *space, const size_t elmt_size, /* out: */ MPI_Datatype *new_type, hsize_t *count, @@ -65,7 +65,7 @@ H5S_mpio_all_type( const H5S_t *space, const hsize_t elmt_size, assert (space); /* Just treat the entire extent as a block of bytes */ - total_bytes = elmt_size; + total_bytes = (hsize_t)elmt_size; for (i=0; iextent.u.simple.rank; ++i) { total_bytes *= space->extent.u.simple.size[i]; } @@ -100,7 +100,7 @@ H5S_mpio_all_type( const H5S_t *space, const hsize_t elmt_size, *------------------------------------------------------------------------- */ herr_t -H5S_mpio_hyper_type( const H5S_t *space, const hsize_t elmt_size, +H5S_mpio_hyper_type( const H5S_t *space, const size_t elmt_size, /* out: */ MPI_Datatype *new_type, hsize_t *count, @@ -131,9 +131,6 @@ H5S_mpio_hyper_type( const H5S_t *space, const hsize_t elmt_size, assert (rank >= 0); /* make a local copy of the dimension info so we can transform them */ -#ifdef H5Smpi_DEBUG - fprintf(stdout, "rank=%d ", rank ); -#endif assert(rank<=32); /* within array bounds */ for ( i=0; iextent.u.simple.size[i]; #ifdef H5Smpi_DEBUG fprintf(stdout, - "hyper_type: start=%lld count=%lld stride=%lld block=%lld xtent=%lld\n", - d[i].start, d[i].count, d[i].strid, d[i].block, d[i].xtent ); + "hyper_type: start=%lld stride=%lld count=%lld block=%lld xtent=%lld", + d[i].start, d[i].strid, d[i].count, d[i].block, d[i].xtent ); + if (i==0) fprintf(stdout, " rank=%d\n", rank ); + else fprintf(stdout, "\n" ); #endif } @@ -175,44 +174,52 @@ H5S_mpio_hyper_type( const H5S_t *space, const hsize_t elmt_size, /* figure out how many dimensions we can eliminate */ /* This loop examines contiguity from the inside out. */ for ( i=0; iextent.u.simple.size[rank-i]) { + (d[rank-i-1].count*d[rank-i-1].block) != space->extent.u.simple.size[rank-i-1]) { break; } } /* end for */ - num_to_collapse = (i)? i-1: 0; + num_to_collapse = i; + + num_to_collapse = 0; /* rky 980827 DEBUG Temporary change + to prevent coalescing until I get it correct. */ + assert(0<=num_to_collapse && num_to_collapse=new_rank; --i) { + d[i-1].block *= d[i].strid; + d[i-1].strid *= d[i].strid; + d[i-1].xtent *= d[i].strid; + assert( d[i].start == 0 ); + /* d[i-1].start stays unchanged */ + /* d[i-1].count stays unchanged */ } + /* check for possibility to coalesce blocks of the uncoalesced dimensions */ + /* rky 980827 DEBUG + Temporarily comment this out to preclude coalescing until it's fixed. for (i=0; ishared->lf, f->shared->access_parms, xfer_mode, &addr, mpi_count, buf ); - if (err) HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,"MPI write failed"); + if (err) { + HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,"MPI write failed"); + } } else { err = H5F_low_read ( f->shared->lf, f->shared->access_parms, xfer_mode, &addr, mpi_count, buf ); - if (err) HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,"MPI read failed"); + if (err) { + HRETURN_ERROR(H5E_IO, H5E_READERROR, FAIL,"MPI read failed"); + } } /* free the MPI buf and file types */