Skip to content

Commit bf058ca

Browse files
committed
common/ompio: check datatypes when setting file view
return MPI_ERR_ARG if the size of the fileview is not a multiple of the size of the etype provided. Signed-off-by: Edgar Gabriel <egabriel@central.uh.edu>
1 parent 05d2538 commit bf058ca

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ompi/mca/common/ompio/common_ompio_file_view.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ int mca_common_ompio_set_view (ompio_file_t *fh,
141141
// in orig_file type, No need to set args on this one.
142142
ompi_datatype_duplicate (newfiletype, &fh->f_filetype);
143143

144+
if ( (fh->f_view_size % fh->f_etype_size) ) {
145+
// File view is not a multiple of the etype.
146+
return MPI_ERR_ARG;
147+
}
144148

145149
if( SIMPLE_PLUS == OMPIO_MCA_GET(fh, grouping_option) ) {
146150
fh->f_cc_size = get_contiguous_chunk_size (fh, 1);

0 commit comments

Comments
 (0)