On Sat, 2007-02-17 at 14:32 +0100, Michael Kuhn wrote:
> while doing some I/O visualization we noticed that the attached program
> (MPI-IO.c) produces an I/O error under certain circumstances. The error
> messages printed by the program (MPI-IO.out) and pvfs2-server
> (pvfs2-server.out) are also attached.
This was a good bug to find. I don't have the perfect fix for this yet,
but I do have something that's better than what we were using before.
With this patch I pass your test case. Please let me know how well it
works for your larger application.
Thanks again for the test case!
==rob
? .swp
? ad_pvfs2_write-tiling-fix.c
? ad_pvfs2_write_debugging.c
? tiled-types-for-mkuhn.diff
Index: ad_pvfs2_read.c
===================================================================
RCS file: /home/MPI/cvsMaster/romio/adio/ad_pvfs2/ad_pvfs2_read.c,v
retrieving revision 1.26
diff -u -p -r1.26 ad_pvfs2_read.c
--- ad_pvfs2_read.c 1 Mar 2007 17:28:26 -0000 1.26
+++ ad_pvfs2_read.c 1 Mar 2007 23:54:48 -0000
@@ -924,7 +924,16 @@ void ADIOI_PVFS2_ReadStrided(ADIO_File f
ADIOI_Free(file_lengths);
/* Other ADIO routines will convert absolute bytes into counts of datatypes */
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += total_bytes_read;
+ /* 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:
Index: ad_pvfs2_write.c
===================================================================
RCS file: /home/MPI/cvsMaster/romio/adio/ad_pvfs2/ad_pvfs2_write.c,v
retrieving revision 1.28
diff -u -p -r1.28 ad_pvfs2_write.c
--- ad_pvfs2_write.c 1 Mar 2007 17:28:26 -0000 1.28
+++ ad_pvfs2_write.c 1 Mar 2007 23:54:48 -0000
@@ -986,7 +986,16 @@ void ADIOI_PVFS2_WriteStrided(ADIO_File
ADIOI_Free(file_offsets);
ADIOI_Free(file_lengths);
- if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += total_bytes_written;
+ /* 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:
_______________________________________________
Pvfs2-users mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-users