Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions ompi/mca/io/ompio/io_ompio_file_open.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,19 +414,21 @@ static void mca_io_ompio_file_get_eof_offset (ompio_file_t *fh,
in_offset -= fh->f_fview.f_disp;
if ( fh->f_fview.f_view_size > 0 ) {
/* starting offset of the current copy of the filew view */
start_offset = in_offset / fh->f_fview.f_view_extent;
start_offset = (in_offset / fh->f_fview.f_view_extent) * fh->f_fview.f_view_extent;

index_in_file_view = 0;
/* determine block id that the offset is located in and
the starting offset of that block */
while ( offset <= in_offset && index_in_file_view < fh->f_fview.f_iov_count) {
prev_offset = offset;
while (offset <= in_offset && index_in_file_view < fh->f_fview.f_iov_count) {
offset = start_offset + (OMPI_MPI_OFFSET_TYPE)(intptr_t) fh->f_fview.f_decoded_iov[index_in_file_view++].iov_base;
if (offset <= in_offset) {
prev_offset = offset;
}
}

offset = prev_offset;
blocklen = fh->f_fview.f_decoded_iov[index_in_file_view-1].iov_len;
while ( offset <= in_offset && k <= blocklen ) {
while (offset <= in_offset && k <= blocklen) {
prev_offset = offset;
offset += fh->f_fview.f_etype_size;
k += fh->f_fview.f_etype_size;
Expand Down
Loading