diff --git a/ompi/mca/common/ompio/common_ompio.h b/ompi/mca/common/ompio/common_ompio.h index 6d09da76f8..34f51f0fee 100644 --- a/ompi/mca/common/ompio/common_ompio.h +++ b/ompi/mca/common/ompio/common_ompio.h @@ -253,10 +253,16 @@ OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at (ompio_file_t *fh, OMPI_MPI_O const void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); +OMPI_DECLSPEC int mca_common_ompio_file_write_all (ompio_file_t *fh, const void *buf, + int count, struct ompi_datatype_t *datatype, + ompi_status_public_t *status); + OMPI_DECLSPEC int mca_common_ompio_file_write_at_all (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t *status); +OMPI_DECLSPEC int mca_common_ompio_file_iwrite_all (ompio_file_t *fp, const void *buf, + int count, struct ompi_datatype_t *datatype, ompi_request_t **request); OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset, const void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); @@ -282,10 +288,16 @@ OMPI_DECLSPEC int mca_common_ompio_file_iread_at (ompio_file_t *fh, OMPI_MPI_OFF void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); +OMPI_DECLSPEC int mca_common_ompio_file_read_all (ompio_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, + ompi_status_public_t * status); + OMPI_DECLSPEC int mca_common_ompio_file_read_at_all (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, void *buf, int count, struct ompi_datatype_t *datatype, ompi_status_public_t * status); +OMPI_DECLSPEC int mca_common_ompio_file_iread_all (ompio_file_t *fp, void *buf, int count, struct ompi_datatype_t *datatype, + ompi_request_t **request); + OMPI_DECLSPEC int mca_common_ompio_file_iread_at_all (ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset, void *buf, int count, struct ompi_datatype_t *datatype, ompi_request_t **request); diff --git a/ompi/mca/common/ompio/common_ompio_file_read.c b/ompi/mca/common/ompio/common_ompio_file_read.c index 3cd0cf2a73..283355cda3 100644 --- a/ompi/mca/common/ompio/common_ompio_file_read.c +++ b/ompi/mca/common/ompio/common_ompio_file_read.c @@ -376,6 +376,21 @@ int mca_common_ompio_file_iread_at (ompio_file_t *fh, /* Infrastructure for collective operations */ +int mca_common_ompio_file_read_all (ompio_file_t *fh, + void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_status_public_t * status) +{ + int ret = OMPI_SUCCESS; + ret = fh->f_fcoll->fcoll_file_read_all (fh, + buf, + count, + datatype, + status); + return ret; +} + int mca_common_ompio_file_read_at_all (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, void *buf, @@ -388,16 +403,41 @@ int mca_common_ompio_file_read_at_all (ompio_file_t *fh, mca_common_ompio_file_get_position (fh, &prev_offset ); mca_common_ompio_set_explicit_offset (fh, offset); - ret = fh->f_fcoll->fcoll_file_read_all (fh, - buf, - count, - datatype, - status); - + ret = mca_common_ompio_file_read_all (fh, + buf, + count, + datatype, + status); + mca_common_ompio_set_explicit_offset (fh, prev_offset); return ret; } +int mca_common_ompio_file_iread_all (ompio_file_t *fp, + void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_request_t **request) +{ + int ret = OMPI_SUCCESS; + + if ( NULL != fp->f_fcoll->fcoll_file_iread_all ) { + ret = fp->f_fcoll->fcoll_file_iread_all (fp, + buf, + count, + datatype, + request); + } + else { + /* this fcoll component does not support non-blocking + collective I/O operations. WE fake it with + individual non-blocking I/O operations. */ + ret = mca_common_ompio_file_iread ( fp, buf, count, datatype, request ); + } + + return ret; +} + int mca_common_ompio_file_iread_at_all (ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset, void *buf, @@ -411,25 +451,17 @@ int mca_common_ompio_file_iread_at_all (ompio_file_t *fp, mca_common_ompio_file_get_position (fp, &prev_offset ); mca_common_ompio_set_explicit_offset (fp, offset); - if ( NULL != fp->f_fcoll->fcoll_file_iread_all ) { - ret = fp->f_fcoll->fcoll_file_iread_all (fp, - buf, - count, - datatype, - request); - } - else { - /* this fcoll component does not support non-blocking - collective I/O operations. WE fake it with - individual non-blocking I/O operations. */ - ret = mca_common_ompio_file_iread ( fp, buf, count, datatype, request ); - } - - + ret = mca_common_ompio_file_iread_all (fp, + buf, + count, + datatype, + request); + mca_common_ompio_set_explicit_offset (fp, prev_offset); return ret; } + int mca_common_ompio_set_explicit_offset (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset) { diff --git a/ompi/mca/common/ompio/common_ompio_file_write.c b/ompi/mca/common/ompio/common_ompio_file_write.c index a803ca1898..555726fd5a 100644 --- a/ompi/mca/common/ompio/common_ompio_file_write.c +++ b/ompi/mca/common/ompio/common_ompio_file_write.c @@ -352,6 +352,20 @@ int mca_common_ompio_file_iwrite_at (ompio_file_t *fh, /* Collective operations */ /******************************************************************/ +int mca_common_ompio_file_write_all (ompio_file_t *fh, + const void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_status_public_t *status) +{ + int ret = OMPI_SUCCESS; + ret = fh->f_fcoll->fcoll_file_write_all (fh, + buf, + count, + datatype, + status); + return ret; +} int mca_common_ompio_file_write_at_all (ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, @@ -365,30 +379,23 @@ int mca_common_ompio_file_write_at_all (ompio_file_t *fh, mca_common_ompio_file_get_position (fh, &prev_offset ); mca_common_ompio_set_explicit_offset (fh, offset); - ret = fh->f_fcoll->fcoll_file_write_all (fh, - buf, - count, - datatype, - status); - + ret = mca_common_ompio_file_write_all (fh, + buf, + count, + datatype, + status); + mca_common_ompio_set_explicit_offset (fh, prev_offset); return ret; } -int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp, - OMPI_MPI_OFFSET_TYPE offset, - const void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request) +int mca_common_ompio_file_iwrite_all (ompio_file_t *fp, + const void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_request_t **request) { - int ret = OMPI_SUCCESS; - OMPI_MPI_OFFSET_TYPE prev_offset; - - mca_common_ompio_file_get_position (fp, &prev_offset ); - - mca_common_ompio_set_explicit_offset (fp, offset); if ( NULL != fp->f_fcoll->fcoll_file_iwrite_all ) { ret = fp->f_fcoll->fcoll_file_iwrite_all (fp, @@ -404,11 +411,32 @@ int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp, ret = mca_common_ompio_file_iwrite ( fp, buf, count, datatype, request ); } + return ret; +} + + +int mca_common_ompio_file_iwrite_at_all (ompio_file_t *fp, + OMPI_MPI_OFFSET_TYPE offset, + const void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_request_t **request) +{ + + int ret = OMPI_SUCCESS; + OMPI_MPI_OFFSET_TYPE prev_offset; + + mca_common_ompio_file_get_position (fp, &prev_offset ); + mca_common_ompio_set_explicit_offset (fp, offset); + + ret = mca_common_ompio_file_iwrite_all ( fp, buf, count, datatype, request ); + mca_common_ompio_set_explicit_offset (fp, prev_offset); return ret; } + /* Helper function used by both read and write operations */ /**************************************************************/ diff --git a/ompi/mca/io/ompio/io_ompio_file_read.c b/ompi/mca/io/ompio/io_ompio_file_read.c index 3aa4d14538..2181629e69 100644 --- a/ompi/mca/io/ompio/io_ompio_file_read.c +++ b/ompi/mca/io/ompio/io_ompio_file_read.c @@ -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) 2017-2018 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -137,12 +137,11 @@ int mca_io_ompio_file_read_all (ompi_file_t *fh, data = (mca_common_ompio_data_t *) fh->f_io_selected_data; OPAL_THREAD_LOCK(&fh->f_lock); - ret = data->ompio_fh. - f_fcoll->fcoll_file_read_all (&data->ompio_fh, - buf, - count, - datatype, - status); + ret = mca_common_ompio_file_read_all (&data->ompio_fh, + buf, + count, + datatype, + status); OPAL_THREAD_UNLOCK(&fh->f_lock); if ( MPI_STATUS_IGNORE != status ) { size_t size; @@ -168,19 +167,11 @@ int mca_io_ompio_file_iread_all (ompi_file_t *fh, fp = &data->ompio_fh; OPAL_THREAD_LOCK(&fh->f_lock); - if ( NULL != fp->f_fcoll->fcoll_file_iread_all ) { - ret = fp->f_fcoll->fcoll_file_iread_all (&data->ompio_fh, - buf, - count, - datatype, - request); - } - else { - /* this fcoll component does not support non-blocking - collective I/O operations. WE fake it with - individual non-blocking I/O operations. */ - ret = mca_common_ompio_file_iread ( fp, buf, count, datatype, request ); - } + ret = mca_common_ompio_file_iread_all (&data->ompio_fh, + buf, + count, + datatype, + request); OPAL_THREAD_UNLOCK(&fh->f_lock); return ret; diff --git a/ompi/mca/io/ompio/io_ompio_file_write.c b/ompi/mca/io/ompio/io_ompio_file_write.c index ba3e1e5f1c..b80622464c 100644 --- a/ompi/mca/io/ompio/io_ompio_file_write.c +++ b/ompi/mca/io/ompio/io_ompio_file_write.c @@ -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$ @@ -143,12 +143,11 @@ int mca_io_ompio_file_write_all (ompi_file_t *fh, data = (mca_common_ompio_data_t *) fh->f_io_selected_data; OPAL_THREAD_LOCK(&fh->f_lock); - ret = data->ompio_fh. - f_fcoll->fcoll_file_write_all (&data->ompio_fh, - buf, - count, - datatype, - status); + ret = mca_common_ompio_file_write_all (&data->ompio_fh, + buf, + count, + datatype, + status); OPAL_THREAD_UNLOCK(&fh->f_lock); if ( MPI_STATUS_IGNORE != status ) { size_t size; @@ -192,19 +191,11 @@ int mca_io_ompio_file_iwrite_all (ompi_file_t *fh, fp = &data->ompio_fh; OPAL_THREAD_LOCK(&fh->f_lock); - if ( NULL != fp->f_fcoll->fcoll_file_iwrite_all ) { - ret = fp->f_fcoll->fcoll_file_iwrite_all (&data->ompio_fh, - buf, - count, - datatype, - request); - } - else { - /* this fcoll component does not support non-blocking - collective I/O operations. WE fake it with - individual non-blocking I/O operations. */ - ret = mca_common_ompio_file_iwrite ( fp, buf, count, datatype, request ); - } + ret = mca_common_ompio_file_iwrite_all (&data->ompio_fh, + buf, + count, + datatype, + request); OPAL_THREAD_UNLOCK(&fh->f_lock); return ret;