1
1

io/ompio: add verification for data representations.

check for providing a data representation that is actually supported
by ompio.

Add also one check for a non-NULL pointer in mpi/c/file_set_view
for the data representation.

Also fixes parts of issue #5643

Signed-off-by: Edgar Gabriel <egabriel@central.uh.edu>
Этот коммит содержится в:
Edgar Gabriel 2018-10-16 12:45:33 -05:00
родитель 849d0452a0
Коммит ba95588332
2 изменённых файлов: 10 добавлений и 2 удалений

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

@ -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-2016 University of Houston. All rights reserved.
* Copyright (c) 2008-2018 University of Houston. All rights reserved.
* Copyright (c) 2015-2018 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2016-2017 IBM Corporation. All rights reserved.
@ -66,13 +66,17 @@ int mca_io_ompio_file_set_view (ompi_file_t *fp,
mca_common_ompio_data_t *data;
ompio_file_t *fh;
if ( (strcmp(datarep, "native") && strcmp(datarep, "NATIVE"))) {
return MPI_ERR_UNSUPPORTED_DATAREP;
}
data = (mca_common_ompio_data_t *) fp->f_io_selected_data;
/* we need to call the internal file set view twice: once for the individual
file pointer, once for the shared file pointer (if it is existent)
*/
fh = &data->ompio_fh;
OPAL_THREAD_LOCK(&fp->f_lock);
ret = mca_common_ompio_set_view(fh, disp, etype, filetype, datarep, info);
OPAL_THREAD_UNLOCK(&fp->f_lock);

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

@ -64,6 +64,10 @@ int MPI_File_set_view(MPI_File fh, MPI_Offset disp, MPI_Datatype etype,
OMPI_CHECK_DATATYPE_FOR_VIEW(rc, filetype, 0);
}
}
if ( NULL == datarep) {
rc = MPI_ERR_UNSUPPORTED_DATAREP;
fh = MPI_FILE_NULL;
}
OMPI_ERRHANDLER_CHECK(rc, fh, rc, FUNC_NAME);
}