Index: romio/adio/ad_pvfs2/ad_pvfs2_read.c =================================================================== RCS file: /home/MPI/cvsMaster/romio/adio/ad_pvfs2/ad_pvfs2_read.c,v retrieving revision 1.10 retrieving revision 1.14 diff -u -w -p -r1.10 -r1.14 --- romio/adio/ad_pvfs2/ad_pvfs2_read.c 7 Jun 2004 20:48:15 -0000 1.10 +++ romio/adio/ad_pvfs2/ad_pvfs2_read.c 2 Sep 2004 21:30:23 -0000 1.14 @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; -*- */ /* - * $Id: ad_pvfs2_read.c,v 1.10 2004/06/07 20:48:15 robl Exp $ + * $Id: ad_pvfs2_read.c,v 1.14 2004/09/02 21:30:23 robl Exp $ * * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. @@ -106,6 +106,7 @@ void ADIOI_PVFS2_ReadStrided(ADIO_File f ADIOI_PVFS2_fs * pvfs_fs; PVFS_sysresp_io resp_io; int err_flag=0; + MPI_Offset total_bytes_read = 0; #define MAX_ARRAY_SIZE 64 @@ -188,6 +189,7 @@ void ADIOI_PVFS2_ReadStrided(ADIO_File f err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, file_offsets, PVFS_BOTTOM, mem_req, &(pvfs_fs->credentials), &resp_io); + total_bytes_read += resp_io.total_completed; /* in the case of error or the last read list call, * leave here */ @@ -202,7 +204,8 @@ void ADIOI_PVFS2_ReadStrided(ADIO_File f ADIOI_Free(mem_offsets); ADIOI_Free(mem_lengths); - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; + if (file_ptr_type == ADIO_INDIVIDUAL) + fd->fp_ind += total_bytes_read; fd->fp_sys_posn = -1; /* set it to null. */ @@ -360,10 +363,11 @@ void ADIOI_PVFS2_ReadStrided(ADIO_File f /* PVFS_Request_hindexed already expresses the offsets into the * file, so we should not pass in an offset if we are using * hindexed for the file type */ - err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0, + err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0, mem_offsets, mem_req, &(pvfs_fs->credentials), &resp_io); if (err_flag < 0) goto error_state; + total_bytes_read += resp_io.total_completed; mem_offsets += mem_lengths; mem_lengths = 0; } /* for (i=0; iobject_ref, file_req, 0, + err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0, mem_offsets, mem_req, &(pvfs_fs->credentials), &resp_io); if (err_flag < 0) goto error_state; + total_bytes_read += resp_io.total_completed; } } else { @@ -752,6 +757,7 @@ void ADIOI_PVFS2_ReadStrided(ADIO_File f /* offset will be expressed in memory and file datatypes */ err_flag = PVFS_sys_read(pvfs_fs->object_ref, file_req, 0, PVFS_BOTTOM, mem_req, &(pvfs_fs->credentials), &resp_io); + total_bytes_read += resp_io.total_completed; size_read += new_buffer_read; start_k = k; start_j = j; @@ -762,7 +768,8 @@ void ADIOI_PVFS2_ReadStrided(ADIO_File f ADIOI_Free(file_offsets); ADIOI_Free(file_lengths); - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; + /* Other ADIO routines will convert absolute bytes into counts of datatypes */ + if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += total_bytes_read; error_state: if (err_flag) { Index: romio/adio/ad_pvfs2/ad_pvfs2_write.c =================================================================== RCS file: /home/MPI/cvsMaster/romio/adio/ad_pvfs2/ad_pvfs2_write.c,v retrieving revision 1.13 retrieving revision 1.17 diff -u -w -p -r1.13 -r1.17 --- romio/adio/ad_pvfs2/ad_pvfs2_write.c 20 May 2004 20:31:05 -0000 1.13 +++ romio/adio/ad_pvfs2/ad_pvfs2_write.c 2 Sep 2004 21:30:23 -0000 1.17 @@ -1,6 +1,6 @@ /* -*- Mode: C; c-basic-offset:4 ; -*- * vim: ts=8 sts=4 sw=4 noexpandtab - * $Id: ad_pvfs2_write.c,v 1.13 2004/05/20 20:31:05 robl Exp $ + * $Id: ad_pvfs2_write.c,v 1.17 2004/09/02 21:30:23 robl Exp $ * * Copyright (C) 1997 University of Chicago. * See COPYRIGHT notice in top-level directory. @@ -108,6 +108,7 @@ void ADIOI_PVFS2_WriteStrided(ADIO_File PVFS_Request mem_req, file_req; ADIOI_PVFS2_fs * pvfs_fs; PVFS_sysresp_io resp_io; + MPI_Offset total_bytes_written=0; /* TODO: increase this to the maximum value */ #define MAX_ARRAY_SIZE 64 @@ -208,6 +209,7 @@ void ADIOI_PVFS2_WriteStrided(ADIO_File err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, file_offsets, PVFS_BOTTOM, mem_req, &(pvfs_fs->credentials), &resp_io); + total_bytes_written += resp_io.total_completed; /* in the case of error or the last read list call, * leave here */ @@ -222,7 +224,8 @@ void ADIOI_PVFS2_WriteStrided(ADIO_File ADIOI_Free(mem_offsets); ADIOI_Free(mem_lengths); - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = off; + if (file_ptr_type == ADIO_INDIVIDUAL) + fd->fp_ind += total_bytes_written; if (err_flag) { ADIOI_PVFS2_pvfs_error_convert(err_flag, error_code); @@ -389,6 +392,7 @@ void ADIOI_PVFS2_WriteStrided(ADIO_File mem_offsets, mem_req, &(pvfs_fs->credentials), &resp_io); if (err_flag < 0) goto error_state; + total_bytes_written += resp_io.total_completed; mem_offsets += mem_lengths; mem_lengths = 0; @@ -429,6 +433,7 @@ void ADIOI_PVFS2_WriteStrided(ADIO_File /* as above, use 0 for 'offset' when using hindexed file type*/ err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0, mem_offsets, mem_req, &(pvfs_fs->credentials), &resp_io); + total_bytes_written += resp_io.total_completed; if (err_flag < 0) goto error_state; } @@ -784,6 +789,7 @@ void ADIOI_PVFS2_WriteStrided(ADIO_File err_flag = PVFS_sys_write(pvfs_fs->object_ref, file_req, 0, PVFS_BOTTOM, mem_req, &(pvfs_fs->credentials), &resp_io); size_wrote += new_buffer_write; + total_bytes_written += resp_io.total_completed; start_k = k; start_j = j; } /* while (size_wrote < bufsize) */ @@ -793,7 +799,8 @@ void ADIOI_PVFS2_WriteStrided(ADIO_File ADIOI_Free(file_offsets); ADIOI_Free(file_lengths); - if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind = offset; + if (file_ptr_type == ADIO_INDIVIDUAL) + fd->fp_ind += total_bytes_written; error_state: /* XXX: free memory */