diff -ruN Original/mpich2-1.0.8p1/src/mpi/romio/adio/ad_pvfs2/ad_pvfs2_read.c mpich2-1.0.8p1/src/mpi/romio/adio/ad_pvfs2/ad_pvfs2_read.c --- Original/mpich2-1.0.8p1/src/mpi/romio/adio/ad_pvfs2/ad_pvfs2_read.c 2007-11-02 17:50:19.000000000 -0500 +++ mpich2-1.0.8p1/src/mpi/romio/adio/ad_pvfs2/ad_pvfs2_read.c 2009-05-31 00:48:35.000000000 -0500 @@ -474,7 +474,7 @@ file_list_count = extra_blks; if(!i) { file_offsets[0] = offset; - file_lengths[0] = st_frd_size; + file_lengths[0] = ADIOI_MIN(st_frd_size, bufsize); } for (k=0; kfp_ind = file_offsets[file_list_count-1]+file_lengths[file_list_count-1]; ADIOI_Free(file_offsets); ADIOI_Free(file_lengths); - /* Other ADIO routines will convert absolute bytes into counts of datatypes */ - /* when incrementing fp_ind, need to also take into account the file type: - * consider an N-element 1-d subarray with a lb and ub: ( |---xxxxx-----| - * if we wrote N elements, offset needs to point at beginning of type, not - * at empty region at offset N+1) */ - if (file_ptr_type == ADIO_INDIVIDUAL) { - /* this is closer, but still incorrect for the cases where a small - * amount of a file type is "leftover" after a write */ - fd->fp_ind = disp + flat_file->indices[j] + - ((ADIO_Offset)n_filetypes)*filetype_extent; - } if (err_flag == 0) *error_code = MPI_SUCCESS; error_state: diff -ruN Original/mpich2-1.0.8p1/src/mpi/romio/adio/ad_pvfs2/ad_pvfs2_write.c mpich2-1.0.8p1/src/mpi/romio/adio/ad_pvfs2/ad_pvfs2_write.c --- Original/mpich2-1.0.8p1/src/mpi/romio/adio/ad_pvfs2/ad_pvfs2_write.c 2007-11-02 17:50:19.000000000 -0500 +++ mpich2-1.0.8p1/src/mpi/romio/adio/ad_pvfs2/ad_pvfs2_write.c 2009-05-31 00:49:09.000000000 -0500 @@ -528,7 +528,7 @@ file_list_count = extra_blks; if(!i) { file_offsets[0] = offset; - file_lengths[0] = st_fwr_size; + file_lengths[0] = ADIOI_MIN(st_fwr_size, bufsize); } for (k=0; kfp_ind = file_offsets[file_list_count-1]+file_lengths[file_list_count-1]; ADIOI_Free(file_offsets); ADIOI_Free(file_lengths); - /* when incrementing fp_ind, need to also take into account the file type: - * consider an N-element 1-d subarray with a lb and ub: ( |---xxxxx-----| - * if we wrote N elements, offset needs to point at beginning of type, not - * at empty region at offset N+1) */ - if (file_ptr_type == ADIO_INDIVIDUAL) { - /* this is closer, but still incorrect for the cases where a small - * amount of a file type is "leftover" after a write */ - fd->fp_ind = disp + flat_file->indices[j] + - ((ADIO_Offset)n_filetypes)*filetype_extent; - } *error_code = MPI_SUCCESS; error_state: