[mpich-discuss] ad_pvfs2_read bug in ADIOI_PVFS2_ReadStrided()
Rob Latham
robl at mcs.anl.gov
Mon Jun 1 17:36:23 CDT 2009
On Mon, Jun 01, 2009 at 05:26:32PM -0500, Wei-keng Liao wrote:
> I tested your patch against mpich2-1.1.rc1 and
> ran a few tests just fine.
>
> I can see you have added the calculation for updating the file pointer.
> I wonder if it can be simplified by
> fd->fp_ind =
> file_offsets[file_list_count-1]+file_lengths[file_list_count-1];
True, this puts the file pointer at the end of the last byte written,
but what if one past the last byte written points to an area not
described by the file view?
I would love to simplify this code, so hopefully you can tell me what
I missed :>
I was imagining a situation where the type looks like
"|XXXX----XXXX----|"
Let's say each X and - represents one integer
If the request was to write 6 ints, then
file_offsets[file_list_count-1]+file_lengths[file_list_count-1] is
exactly right (that's your test case, after all) and would put the
file pointer in the middle of the second batch of Xs.
If the request was to write 8, though, then the file pointer would be
set to an area not described by the file view, right?
==rob
--
Rob Latham
Mathematics and Computer Science Division
Argonne National Lab, IL USA
More information about the mpich-discuss
mailing list