1
1

Merge pull request #6704 from edgargabriel/pr/v4.0.x-empty-fileview-fix

common/ompio: fix division by zero problem with empty fview
Этот коммит содержится в:
Howard Pritchard 2019-05-26 09:45:52 -06:00 коммит произвёл GitHub
родитель 386ed07d54 c7250cd11d
Коммит e78851a6c7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

Просмотреть файл

@ -9,7 +9,7 @@
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* Copyright (c) 2008-2018 University of Houston. All rights reserved.
* Copyright (c) 2008-2019 University of Houston. All rights reserved.
* Copyright (c) 2015-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016 Cisco Systems, Inc. All rights reserved.
@ -384,6 +384,13 @@ int mca_common_ompio_file_get_position (ompio_file_t *fh,
{
OMPI_MPI_OFFSET_TYPE off;
if ( 0 == fh->f_view_extent ||
0 == fh->f_view_size ||
0 == fh->f_etype_size ) {
*offset = 0;
return OMPI_SUCCESS;
}
/* No. of copies of the entire file view */
off = (fh->f_offset - fh->f_disp)/fh->f_view_extent;