Skip to content

Commit 2806393

Browse files
authored
Merge pull request #6705 from edgargabriel/pr/v3.1.x-empty-fileview-fix
common/ompio: fix division by zero problem with empty fview
2 parents b176fa6 + c96e0f0 commit 2806393

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

ompi/mca/common/ompio/common_ompio_file_open.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
* University of Stuttgart. All rights reserved.
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
12-
* Copyright (c) 2008-2017 University of Houston. All rights reserved.
13-
* Copyright (c) 2015-2017 Research Organization for Information Science
12+
* Copyright (c) 2008-2019 University of Houston. All rights reserved.
13+
* Copyright (c) 2015-2018 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
1515
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
1616
* Copyright (c) 2017 IBM Corporation. All rights reserved.
@@ -381,6 +381,13 @@ int mca_common_ompio_file_get_position (mca_io_ompio_file_t *fh,
381381
{
382382
OMPI_MPI_OFFSET_TYPE off;
383383

384+
if ( 0 == fh->f_view_extent ||
385+
0 == fh->f_view_size ||
386+
0 == fh->f_etype_size ) {
387+
*offset = 0;
388+
return OMPI_SUCCESS;
389+
}
390+
384391
/* No. of copies of the entire file view */
385392
off = (fh->f_offset - fh->f_disp)/fh->f_view_extent;
386393

0 commit comments

Comments
 (0)