1
1

mpi/c: Protect some IO functions not widely implemented

* Protects us from segv when ROMIO 314 is selected and one of the
   following operations is called:
   - MPI_File_iread_at_all
   - MPI_File_iwrite_at_all
   - MPI_File_iread_all
   - MPI_File_iwrite_all

Signed-off-by: Joshua Hursey <jhursey@us.ibm.com>
Этот коммит содержится в:
Joshua Hursey 2017-06-09 11:22:28 -04:00
родитель 2ffaf5ea9f
Коммит 29609631a2
4 изменённых файлов: 34 добавлений и 10 удалений

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

@ -13,6 +13,7 @@
* Copyright (c) 2015 University of Houston. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -71,8 +72,13 @@ int MPI_File_iread_all(MPI_File fh, void *buf, int count,
/* Call the back-end io component function */
switch (fh->f_io_version) {
case MCA_IO_BASE_V_2_0_0:
rc = fh->f_io_selected_module.v2_0_0.
io_module_file_iread_all(fh, buf, count, datatype, request);
if( OPAL_UNLIKELY(NULL == fh->f_io_selected_module.v2_0_0.io_module_file_iread_all) ) {
rc = MPI_ERR_UNSUPPORTED_OPERATION;
}
else {
rc = fh->f_io_selected_module.v2_0_0.
io_module_file_iread_all(fh, buf, count, datatype, request);
}
break;
default:

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

@ -13,6 +13,7 @@
* Copyright (c) 2015 University of Houston. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -71,9 +72,14 @@ int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf,
/* Call the back-end io component function */
switch (fh->f_io_version) {
case MCA_IO_BASE_V_2_0_0:
rc = fh->f_io_selected_module.v2_0_0.
io_module_file_iread_at_all(fh, offset, buf, count, datatype,
request);
if( OPAL_UNLIKELY(NULL == fh->f_io_selected_module.v2_0_0.io_module_file_iread_at_all) ) {
rc = MPI_ERR_UNSUPPORTED_OPERATION;
}
else {
rc = fh->f_io_selected_module.v2_0_0.
io_module_file_iread_at_all(fh, offset, buf, count, datatype,
request);
}
break;
default:

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

@ -16,6 +16,7 @@
* Copyright (c) 2015 University of Houston. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -75,8 +76,13 @@ int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype
/* Call the back-end io component function */
switch (fh->f_io_version) {
case MCA_IO_BASE_V_2_0_0:
rc = fh->f_io_selected_module.v2_0_0.
io_module_file_iwrite_all(fh, buf, count, datatype, request);
if( OPAL_UNLIKELY(NULL == fh->f_io_selected_module.v2_0_0.io_module_file_iwrite_all) ) {
rc = MPI_ERR_UNSUPPORTED_OPERATION;
}
else {
rc = fh->f_io_selected_module.v2_0_0.
io_module_file_iwrite_all(fh, buf, count, datatype, request);
}
break;
default:

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

@ -16,6 +16,7 @@
* Copyright (c) 2015 University of Houston. All rights reserved.
* Copyright (c) 2015 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
@ -76,9 +77,14 @@ int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf,
/* Call the back-end io component function */
switch (fh->f_io_version) {
case MCA_IO_BASE_V_2_0_0:
rc = fh->f_io_selected_module.v2_0_0.
io_module_file_iwrite_at_all(fh, offset, buf, count, datatype,
request);
if( OPAL_UNLIKELY(NULL == fh->f_io_selected_module.v2_0_0.io_module_file_iwrite_at_all) ) {
rc = MPI_ERR_UNSUPPORTED_OPERATION;
}
else {
rc = fh->f_io_selected_module.v2_0_0.
io_module_file_iwrite_at_all(fh, offset, buf, count, datatype,
request);
}
break;
default: