Skip to content

Commit 0e76855

Browse files
authored
Merge pull request #8903 from edgargabriel/topic/get-byte-offset-emptyview
io/ompio: fix get_byte_offset for 0-size fview
2 parents 17b723b + 873a7fa commit 0e76855

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ompi/mca/io/ompio/io_ompio_file_open.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,11 @@ int mca_io_ompio_file_get_byte_offset (ompi_file_t *fh,
519519
data = (mca_common_ompio_data_t *) fh->f_io_selected_data;
520520

521521
OPAL_THREAD_LOCK(&fh->f_lock);
522+
if ( data->ompio_fh.f_view_size == 0 ) {
523+
*disp = 0;
524+
OPAL_THREAD_UNLOCK(&fh->f_lock);
525+
return OMPI_SUCCESS;
526+
}
522527
temp_offset = (long) data->ompio_fh.f_view_extent *
523528
(offset*data->ompio_fh.f_etype_size / data->ompio_fh.f_view_size);
524529
if ( 0 > temp_offset ) {

0 commit comments

Comments
 (0)