From ccf76b779130e065de326f71fe6bac868c565300 Mon Sep 17 00:00:00 2001 From: Edgar Gabriel Date: Wed, 20 Jul 2016 14:46:44 -0500 Subject: [PATCH] moving the internal read/write functions to common/ompio and update all fs/fcoll/sharedfp components to use these functions. --- ompi/mca/common/ompio/Makefile.am | 4 +- ompi/mca/common/ompio/common_ompio.h | 51 ++ .../mca/common/ompio/common_ompio_file_read.c | 353 ++++++++++++++ .../common/ompio/common_ompio_file_write.c | 448 ++++++++++++++++++ .../common/ompio/common_ompio_print_queue.c | 19 +- .../common/ompio/common_ompio_print_queue.h | 23 +- ompi/mca/fbtl/base/fbtl_base_file_select.c | 2 +- ompi/mca/fbtl/base/fbtl_base_file_unselect.c | 2 +- ompi/mca/fbtl/plfs/fbtl_plfs.h | 2 +- ompi/mca/fbtl/posix/fbtl_posix.h | 4 +- ompi/mca/fbtl/pvfs2/fbtl_pvfs2.h | 2 +- ompi/mca/fcoll/base/fcoll_base_coll_array.c | 2 +- ompi/mca/fcoll/base/fcoll_base_file_select.c | 2 +- .../mca/fcoll/base/fcoll_base_file_unselect.c | 4 +- ompi/mca/fcoll/dynamic/fcoll_dynamic.h | 4 +- .../fcoll/dynamic_gen2/fcoll_dynamic_gen2.h | 2 +- ompi/mca/fcoll/individual/fcoll_individual.h | 4 +- .../fcoll_individual_file_read_all.c | 5 +- .../fcoll_individual_file_write_all.c | 5 +- ompi/mca/fcoll/static/fcoll_static.h | 4 +- ompi/mca/fcoll/two_phase/fcoll_two_phase.h | 4 +- ompi/mca/fs/base/fs_base_file_select.c | 4 +- ompi/mca/fs/base/fs_base_file_unselect.c | 5 +- ompi/mca/fs/base/fs_base_get_parent_dir.c | 2 +- ompi/mca/fs/lustre/fs_lustre.h | 4 +- ompi/mca/fs/plfs/fs_plfs.h | 4 +- ompi/mca/fs/pvfs2/fs_pvfs2.h | 4 +- ompi/mca/fs/ufs/fs_ufs.h | 4 +- ompi/mca/io/ompio/io_ompio.h | 89 +--- ompi/mca/io/ompio/io_ompio_file_read.c | 316 +----------- ompi/mca/io/ompio/io_ompio_file_write.c | 426 +---------------- ompi/mca/sharedfp/addproc/sharedfp_addproc.h | 4 +- .../sharedfp/addproc/sharedfp_addproc_iread.c | 6 +- .../addproc/sharedfp_addproc_iwrite.c | 6 +- .../sharedfp/addproc/sharedfp_addproc_read.c | 6 +- .../sharedfp/addproc/sharedfp_addproc_write.c | 6 +- .../sharedfp/base/sharedfp_base_file_select.c | 4 +- .../base/sharedfp_base_file_unselect.c | 5 +- .../sharedfp/individual/sharedfp_individual.h | 4 +- .../sharedfp_individual_collaborate_data.c | 9 +- .../sharedfp_individual_insert_metadata.c | 8 +- .../individual/sharedfp_individual_iwrite.c | 12 +- .../individual/sharedfp_individual_write.c | 10 +- .../sharedfp/lockedfile/sharedfp_lockedfile.h | 4 +- .../lockedfile/sharedfp_lockedfile_iread.c | 6 +- .../lockedfile/sharedfp_lockedfile_iwrite.c | 6 +- .../lockedfile/sharedfp_lockedfile_read.c | 6 +- .../lockedfile/sharedfp_lockedfile_write.c | 6 +- ompi/mca/sharedfp/sm/sharedfp_sm.h | 4 +- ompi/mca/sharedfp/sm/sharedfp_sm_iread.c | 6 +- ompi/mca/sharedfp/sm/sharedfp_sm_iwrite.c | 6 +- ompi/mca/sharedfp/sm/sharedfp_sm_read.c | 6 +- ompi/mca/sharedfp/sm/sharedfp_sm_write.c | 6 +- 53 files changed, 1010 insertions(+), 930 deletions(-) create mode 100644 ompi/mca/common/ompio/common_ompio_file_read.c create mode 100644 ompi/mca/common/ompio/common_ompio_file_write.c diff --git a/ompi/mca/common/ompio/Makefile.am b/ompi/mca/common/ompio/Makefile.am index c6cac52216..d6f255819f 100644 --- a/ompi/mca/common/ompio/Makefile.am +++ b/ompi/mca/common/ompio/Makefile.am @@ -23,7 +23,9 @@ headers = \ common_ompio.h sources = \ - common_ompio_print_queue.c + common_ompio_print_queue.c \ + common_ompio_file_read.c \ + common_ompio_file_write.c # To simplify components that link to this library, we will *always* diff --git a/ompi/mca/common/ompio/common_ompio.h b/ompi/mca/common/ompio/common_ompio.h index 501e7db0d5..fcc3702c64 100644 --- a/ompi/mca/common/ompio/common_ompio.h +++ b/ompi/mca/common/ompio/common_ompio.h @@ -24,4 +24,55 @@ #include "ompi/mca/common/ompio/common_ompio_print_queue.h" #include "ompi/mca/io/ompio/io_ompio.h" +OMPI_DECLSPEC int mca_common_ompio_file_write (mca_io_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 (mca_io_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 (mca_io_ompio_file_t *fh, const void *buf, int count, + struct ompi_datatype_t *datatype, ompi_request_t **request); + +OMPI_DECLSPEC int mca_common_ompio_file_iwrite_at (mca_io_ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, + const void *buf, int count, struct ompi_datatype_t *datatype, + ompi_request_t **request); + +OMPI_DECLSPEC int mca_common_ompio_file_write_at_all (mca_io_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_at_all (mca_io_ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset, const void *buf, + int count, struct ompi_datatype_t *datatype, ompi_request_t **request); + +OMPI_DECLSPEC int mca_common_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cycles, + size_t bytes_per_cycle, int max_data, uint32_t iov_count, + struct iovec *decoded_iov, int *ii, int *jj, size_t *tbw ); + + +OMPI_DECLSPEC int mca_common_ompio_file_read (mca_io_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 (mca_io_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 (mca_io_ompio_file_t *fh, void *buf, int count, + struct ompi_datatype_t *datatype, ompi_request_t **request); + +OMPI_DECLSPEC int mca_common_ompio_file_iread_at (mca_io_ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, + void *buf, int count, struct ompi_datatype_t *datatype, + ompi_request_t **request); + +OMPI_DECLSPEC int mca_common_ompio_file_read_at_all (mca_io_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_at_all (mca_io_ompio_file_t *fp, OMPI_MPI_OFFSET_TYPE offset, + void *buf, int count, struct ompi_datatype_t *datatype, + ompi_request_t **request); + + #endif /* MCA_COMMON_OMPIO_H */ diff --git a/ompi/mca/common/ompio/common_ompio_file_read.c b/ompi/mca/common/ompio/common_ompio_file_read.c new file mode 100644 index 0000000000..6c6014c5a0 --- /dev/null +++ b/ompi/mca/common/ompio/common_ompio_file_read.c @@ -0,0 +1,353 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2016 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * 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$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/communicator/communicator.h" +#include "ompi/info/info.h" +#include "ompi/file/file.h" +#include "ompi/mca/fs/fs.h" +#include "ompi/mca/fs/base/base.h" +#include "ompi/mca/fcoll/fcoll.h" +#include "ompi/mca/fcoll/base/base.h" +#include "ompi/mca/fbtl/fbtl.h" +#include "ompi/mca/fbtl/base/base.h" + +#include "common_ompio.h" +#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/io/ompio/io_ompio_request.h" +#include "math.h" +#include + +/* Read and write routines are split into two interfaces. +** The +** mca_io_ompio_file_read/write[_at] +** +** routines are the ones registered with the ompio modules. +** The +** +** mca_common_ompio_file_read/write[_at] +** +** routesin are used e.g. from the shared file pointer modules. +** The main difference is, that the first one takes an ompi_file_t +** as a file pointer argument, while the second uses the ompio internal +** mca_io_ompio_file_t structure. +*/ + +int mca_common_ompio_file_read (mca_io_ompio_file_t *fh, + void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_status_public_t *status) +{ + int ret = OMPI_SUCCESS; + + size_t total_bytes_read = 0; /* total bytes that have been read*/ + size_t bytes_per_cycle = 0; /* total read in each cycle by each process*/ + int index = 0; + int cycles = 0; + + uint32_t iov_count = 0; + struct iovec *decoded_iov = NULL; + + size_t max_data=0, real_bytes_read=0; + ssize_t ret_code=0; + int i = 0; /* index into the decoded iovec of the buffer */ + int j = 0; /* index into the file vie iovec */ + + if ( 0 == count ) { + if ( MPI_STATUS_IGNORE != status ) { + status->_ucount = 0; + } + return ret; + } + + if (fh->f_amode & MPI_MODE_WRONLY){ + printf("Improper use of FILE Mode, Using WRONLY for Read!\n"); + ret = OMPI_ERROR; + return ret; + } + + ompi_io_ompio_decode_datatype (fh, + datatype, + count, + buf, + &max_data, + &decoded_iov, + &iov_count); + + if ( -1 == mca_io_ompio_cycle_buffer_size ) { + bytes_per_cycle = max_data; + } + else { + bytes_per_cycle = mca_io_ompio_cycle_buffer_size; + } + cycles = ceil((float)max_data/bytes_per_cycle); + +#if 0 + printf ("Bytes per Cycle: %d Cycles: %d max_data:%d \n",bytes_per_cycle, cycles, max_data); +#endif + + j = fh->f_index_in_file_view; + + for (index = 0; index < cycles; index++) { + + mca_common_ompio_build_io_array ( fh, + index, + cycles, + bytes_per_cycle, + max_data, + iov_count, + decoded_iov, + &i, + &j, + &total_bytes_read); + + if (fh->f_num_of_io_entries) { + ret_code = fh->f_fbtl->fbtl_preadv (fh); + if ( 0<= ret_code ) { + real_bytes_read+=(size_t)ret_code; + } + } + + fh->f_num_of_io_entries = 0; + if (NULL != fh->f_io_array) { + free (fh->f_io_array); + fh->f_io_array = NULL; + } + } + + if (NULL != decoded_iov) { + free (decoded_iov); + decoded_iov = NULL; + } + + if ( MPI_STATUS_IGNORE != status ) { + status->_ucount = real_bytes_read; + } + + return ret; +} + +int mca_common_ompio_file_read_at (mca_io_ompio_file_t *fh, + OMPI_MPI_OFFSET_TYPE offset, + void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_status_public_t * status) +{ + int ret = OMPI_SUCCESS; + OMPI_MPI_OFFSET_TYPE prev_offset; + + ompio_io_ompio_file_get_position (fh, &prev_offset ); + + ompi_io_ompio_set_explicit_offset (fh, offset); + ret = mca_common_ompio_file_read (fh, + buf, + count, + datatype, + status); + + // An explicit offset file operation is not suppsed to modify + // the internal file pointer. So reset the pointer + // to the previous value + ompi_io_ompio_set_explicit_offset (fh, prev_offset); + + return ret; +} + + +int mca_common_ompio_file_iread (mca_io_ompio_file_t *fh, + void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_request_t **request) +{ + int ret = OMPI_SUCCESS; + mca_ompio_request_t *ompio_req=NULL; + + ompio_req = OBJ_NEW(mca_ompio_request_t); + ompio_req->req_type = MCA_OMPIO_REQUEST_READ; + ompio_req->req_ompi.req_state = OMPI_REQUEST_ACTIVE; + + if ( 0 == count ) { + ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; + ompio_req->req_ompi.req_status._ucount = 0; + ompi_request_complete (&ompio_req->req_ompi, false); + *request = (ompi_request_t *) ompio_req; + + return OMPI_SUCCESS; + } + + if ( NULL != fh->f_fbtl->fbtl_ipreadv ) { + // This fbtl has support for non-blocking operations + + size_t total_bytes_read = 0; /* total bytes that have been read*/ + uint32_t iov_count = 0; + struct iovec *decoded_iov = NULL; + + size_t max_data = 0; + int i = 0; /* index into the decoded iovec of the buffer */ + int j = 0; /* index into the file vie iovec */ + + ompi_io_ompio_decode_datatype (fh, + datatype, + count, + buf, + &max_data, + &decoded_iov, + &iov_count); + + // Non-blocking operations have to occur in a single cycle + j = fh->f_index_in_file_view; + + mca_common_ompio_build_io_array ( fh, + 0, // index + 1, // no. of cyces + max_data, // setting bytes per cycle to match data + max_data, + iov_count, + decoded_iov, + &i, + &j, + &total_bytes_read); + + if (fh->f_num_of_io_entries) { + fh->f_fbtl->fbtl_ipreadv (fh, (ompi_request_t *) ompio_req); + } + + if ( false == mca_io_ompio_progress_is_registered ) { + // Lazy initialization of progress function to minimize impact + // on other ompi functionality in case its not used. + opal_progress_register (mca_io_ompio_component_progress); + mca_io_ompio_progress_is_registered=true; + } + + fh->f_num_of_io_entries = 0; + if (NULL != fh->f_io_array) { + free (fh->f_io_array); + fh->f_io_array = NULL; + } + + if (NULL != decoded_iov) { + free (decoded_iov); + decoded_iov = NULL; + } + } + else { + // This fbtl does not support non-blocking operations + ompi_status_public_t status; + ret = mca_common_ompio_file_read (fh, buf, count, datatype, &status); + + ompio_req->req_ompi.req_status.MPI_ERROR = ret; + ompio_req->req_ompi.req_status._ucount = status._ucount; + ompi_request_complete (&ompio_req->req_ompi, false); + } + + *request = (ompi_request_t *) ompio_req; + return ret; +} + + +int mca_common_ompio_file_iread_at (mca_io_ompio_file_t *fh, + OMPI_MPI_OFFSET_TYPE offset, + void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_request_t **request) +{ + int ret = OMPI_SUCCESS; + OMPI_MPI_OFFSET_TYPE prev_offset; + ompio_io_ompio_file_get_position (fh, &prev_offset ); + + ompi_io_ompio_set_explicit_offset (fh, offset); + ret = mca_common_ompio_file_iread (fh, + buf, + count, + datatype, + request); + + /* An explicit offset file operation is not suppsed to modify + ** the internal file pointer. So reset the pointer + ** to the previous value + ** It is OK to reset the position already here, althgouth + ** the operation might still be pending/ongoing, since + ** the entire array of have + ** already been constructed in the file_iread operation + */ + ompi_io_ompio_set_explicit_offset (fh, prev_offset); + + return ret; +} + + +/* Infrastructure for collective operations */ +int mca_common_ompio_file_read_at_all (mca_io_ompio_file_t *fh, + OMPI_MPI_OFFSET_TYPE offset, + void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_status_public_t * status) +{ + int ret = OMPI_SUCCESS; + OMPI_MPI_OFFSET_TYPE prev_offset; + ompio_io_ompio_file_get_position (fh, &prev_offset ); + + ompi_io_ompio_set_explicit_offset (fh, offset); + ret = fh->f_fcoll->fcoll_file_read_all (fh, + buf, + count, + datatype, + status); + + ompi_io_ompio_set_explicit_offset (fh, prev_offset); + return ret; +} + +int mca_common_ompio_file_iread_at_all (mca_io_ompio_file_t *fp, + OMPI_MPI_OFFSET_TYPE offset, + void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_request_t **request) +{ + int ret = OMPI_SUCCESS; + OMPI_MPI_OFFSET_TYPE prev_offset; + + ompio_io_ompio_file_get_position (fp, &prev_offset ); + ompi_io_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 ); + } + + + ompi_io_ompio_set_explicit_offset (fp, prev_offset); + return ret; +} diff --git a/ompi/mca/common/ompio/common_ompio_file_write.c b/ompi/mca/common/ompio/common_ompio_file_write.c new file mode 100644 index 0000000000..c633a14de4 --- /dev/null +++ b/ompi/mca/common/ompio/common_ompio_file_write.c @@ -0,0 +1,448 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2016 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * 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) 2015 Research Organization for Information Science + * and Technology (RIST). All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/communicator/communicator.h" +#include "ompi/info/info.h" +#include "ompi/file/file.h" +#include "ompi/mca/fcoll/fcoll.h" +#include "ompi/mca/fcoll/base/base.h" +#include "ompi/mca/fbtl/fbtl.h" +#include "ompi/mca/fbtl/base/base.h" + +#include "common_ompio.h" +#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/io/ompio/io_ompio_request.h" +#include "math.h" +#include + +int mca_common_ompio_file_write (mca_io_ompio_file_t *fh, + const void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_status_public_t *status) +{ + int ret = OMPI_SUCCESS; + int index = 0; + int cycles = 0; + + uint32_t iov_count = 0; + struct iovec *decoded_iov = NULL; + size_t bytes_per_cycle=0; + size_t total_bytes_written = 0; + size_t max_data=0, real_bytes_written=0; + ssize_t ret_code=0; + int i = 0; /* index into the decoded iovec of the buffer */ + int j = 0; /* index into the file view iovec */ + + if ( 0 == count ) { + if ( MPI_STATUS_IGNORE != status ) { + status->_ucount = 0; + } + return ret; + } + + ompi_io_ompio_decode_datatype (fh, + datatype, + count, + buf, + &max_data, + &decoded_iov, + &iov_count); + + if ( -1 == mca_io_ompio_cycle_buffer_size ) { + bytes_per_cycle = max_data; + } + else { + bytes_per_cycle = mca_io_ompio_cycle_buffer_size; + } + cycles = ceil((float)max_data/bytes_per_cycle); + +#if 0 + printf ("Bytes per Cycle: %d Cycles: %d\n", bytes_per_cycle, cycles); +#endif + + j = fh->f_index_in_file_view; + for (index = 0; index < cycles; index++) { + mca_common_ompio_build_io_array ( fh, + index, + cycles, + bytes_per_cycle, + max_data, + iov_count, + decoded_iov, + &i, + &j, + &total_bytes_written); + + if (fh->f_num_of_io_entries) { + ret_code =fh->f_fbtl->fbtl_pwritev (fh); + if ( 0<= ret_code ) { + real_bytes_written+= (size_t)ret_code; + } + } + + fh->f_num_of_io_entries = 0; + if (NULL != fh->f_io_array) { + free (fh->f_io_array); + fh->f_io_array = NULL; + } + } + + if (NULL != decoded_iov) { + free (decoded_iov); + decoded_iov = NULL; + } + + if ( MPI_STATUS_IGNORE != status ) { + status->_ucount = real_bytes_written; + } + + return ret; +} + +int mca_common_ompio_file_write_at (mca_io_ompio_file_t *fh, + OMPI_MPI_OFFSET_TYPE offset, + const void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_status_public_t *status) +{ + int ret = OMPI_SUCCESS; + OMPI_MPI_OFFSET_TYPE prev_offset; + ompio_io_ompio_file_get_position (fh, &prev_offset ); + + ompi_io_ompio_set_explicit_offset (fh, offset); + ret = mca_common_ompio_file_write (fh, + buf, + count, + datatype, + status); + // An explicit offset file operation is not suppsed to modify + // the internal file pointer. So reset the pointer + // to the previous value + ompi_io_ompio_set_explicit_offset (fh, prev_offset ); + return ret; +} + +int mca_common_ompio_file_iwrite (mca_io_ompio_file_t *fh, + const void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_request_t **request) +{ + int ret = OMPI_SUCCESS; + mca_ompio_request_t *ompio_req=NULL; + + ompio_req = OBJ_NEW(mca_ompio_request_t); + ompio_req->req_type = MCA_OMPIO_REQUEST_WRITE; + ompio_req->req_ompi.req_state = OMPI_REQUEST_ACTIVE; + + if ( 0 == count ) { + ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; + ompio_req->req_ompi.req_status._ucount = 0; + ompi_request_complete (&ompio_req->req_ompi, false); + *request = (ompi_request_t *) ompio_req; + + return OMPI_SUCCESS; + } + + if ( NULL != fh->f_fbtl->fbtl_ipwritev ) { + /* This fbtl has support for non-blocking operations */ + + uint32_t iov_count = 0; + struct iovec *decoded_iov = NULL; + size_t max_data = 0; + size_t total_bytes_written =0; + int i = 0; /* index into the decoded iovec of the buffer */ + int j = 0; /* index into the file vie iovec */ + + ompi_io_ompio_decode_datatype (fh, + datatype, + count, + buf, + &max_data, + &decoded_iov, + &iov_count); + j = fh->f_index_in_file_view; + + /* Non blocking operations have to occur in a single cycle */ + mca_common_ompio_build_io_array ( fh, + 0, // index of current cycle iteration + 1, // number of cycles + max_data, // setting bytes_per_cycle to max_data + max_data, + iov_count, + decoded_iov, + &i, + &j, + &total_bytes_written); + + if (fh->f_num_of_io_entries) { + fh->f_fbtl->fbtl_ipwritev (fh, (ompi_request_t *) ompio_req); + } + + if ( false == mca_io_ompio_progress_is_registered ) { + // Lazy initialization of progress function to minimize impact + // on other ompi functionality in case its not used. + opal_progress_register (mca_io_ompio_component_progress); + mca_io_ompio_progress_is_registered=true; + } + + fh->f_num_of_io_entries = 0; + if (NULL != fh->f_io_array) { + free (fh->f_io_array); + fh->f_io_array = NULL; + } + if (NULL != decoded_iov) { + free (decoded_iov); + decoded_iov = NULL; + } + } + else { + // This fbtl does not support non-blocking write operations + ompi_status_public_t status; + ret = mca_common_ompio_file_write(fh,buf,count,datatype, &status); + + ompio_req->req_ompi.req_status.MPI_ERROR = ret; + ompio_req->req_ompi.req_status._ucount = status._ucount; + ompi_request_complete (&ompio_req->req_ompi, false); + } + + *request = (ompi_request_t *) ompio_req; + return ret; +} + +int mca_common_ompio_file_iwrite_at (mca_io_ompio_file_t *fh, + 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; + ompio_io_ompio_file_get_position (fh, &prev_offset ); + + ompi_io_ompio_set_explicit_offset (fh, offset); + ret = mca_common_ompio_file_iwrite (fh, + buf, + count, + datatype, + request); + + /* An explicit offset file operation is not suppsed to modify + ** the internal file pointer. So reset the pointer + ** to the previous value + ** It is OK to reset the position already here, althgouth + ** the operation might still be pending/ongoing, since + ** the entire array of have + ** already been constructed in the file_iwrite operation + */ + ompi_io_ompio_set_explicit_offset (fh, prev_offset); + + return ret; +} + +/* Collective operations */ +/******************************************************************/ + +int mca_common_ompio_file_write_at_all (mca_io_ompio_file_t *fh, + OMPI_MPI_OFFSET_TYPE offset, + const void *buf, + int count, + struct ompi_datatype_t *datatype, + ompi_status_public_t *status) +{ + int ret = OMPI_SUCCESS; + OMPI_MPI_OFFSET_TYPE prev_offset; + ompio_io_ompio_file_get_position (fh, &prev_offset ); + + ompi_io_ompio_set_explicit_offset (fh, offset); + ret = fh->f_fcoll->fcoll_file_write_all (fh, + buf, + count, + datatype, + status); + + ompi_io_ompio_set_explicit_offset (fh, prev_offset); + return ret; +} + +int mca_common_ompio_file_iwrite_at_all (mca_io_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; + + ompio_io_ompio_file_get_position (fp, &prev_offset ); + + ompi_io_ompio_set_explicit_offset (fp, offset); + + if ( NULL != fp->f_fcoll->fcoll_file_iwrite_all ) { + ret = fp->f_fcoll->fcoll_file_iwrite_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_iwrite ( fp, buf, count, datatype, request ); + } + + ompi_io_ompio_set_explicit_offset (fp, prev_offset); + return ret; +} + + +/* Helper function used by both read and write operations */ +/**************************************************************/ + +int mca_common_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cycles, + size_t bytes_per_cycle, int max_data, uint32_t iov_count, + struct iovec *decoded_iov, int *ii, int *jj, size_t *tbw ) +{ + OPAL_PTRDIFF_TYPE disp; + int block = 1; + size_t total_bytes_written = *tbw; /* total bytes that have been written*/ + size_t bytes_to_write_in_cycle = 0; /* left to be written in a cycle*/ + size_t sum_previous_counts = 0; + size_t sum_previous_length = 0; + int k = 0; /* index into the io_array */ + int i = *ii; + int j = *jj; + + sum_previous_length = fh->f_position_in_file_view; + + if ((index == cycles-1) && (max_data % bytes_per_cycle)) { + bytes_to_write_in_cycle = max_data % bytes_per_cycle; + } + else { + bytes_to_write_in_cycle = bytes_per_cycle; + } + + fh->f_io_array = (mca_io_ompio_io_array_t *)malloc + (OMPIO_IOVEC_INITIAL_SIZE * sizeof (mca_io_ompio_io_array_t)); + if (NULL == fh->f_io_array) { + opal_output(1, "OUT OF MEMORY\n"); + return OMPI_ERR_OUT_OF_RESOURCE; + } + + while (bytes_to_write_in_cycle) { + /* reallocate if needed */ + if (OMPIO_IOVEC_INITIAL_SIZE*block <= k) { + block ++; + fh->f_io_array = (mca_io_ompio_io_array_t *)realloc + (fh->f_io_array, OMPIO_IOVEC_INITIAL_SIZE * + block * sizeof (mca_io_ompio_io_array_t)); + if (NULL == fh->f_io_array) { + opal_output(1, "OUT OF MEMORY\n"); + return OMPI_ERR_OUT_OF_RESOURCE; + } + } + + if (decoded_iov[i].iov_len - + (total_bytes_written - sum_previous_counts) <= 0) { + sum_previous_counts += decoded_iov[i].iov_len; + i = i + 1; + } + + disp = (OPAL_PTRDIFF_TYPE)decoded_iov[i].iov_base + + (total_bytes_written - sum_previous_counts); + fh->f_io_array[k].memory_address = (IOVBASE_TYPE *)disp; + + if (decoded_iov[i].iov_len - + (total_bytes_written - sum_previous_counts) >= + bytes_to_write_in_cycle) { + fh->f_io_array[k].length = bytes_to_write_in_cycle; + } + else { + fh->f_io_array[k].length = decoded_iov[i].iov_len - + (total_bytes_written - sum_previous_counts); + } + + if (! (fh->f_flags & OMPIO_CONTIGUOUS_FVIEW)) { + if (fh->f_decoded_iov[j].iov_len - + (fh->f_total_bytes - sum_previous_length) <= 0) { + sum_previous_length += fh->f_decoded_iov[j].iov_len; + j = j + 1; + if (j == (int)fh->f_iov_count) { + j = 0; + sum_previous_length = 0; + fh->f_offset += fh->f_view_extent; + fh->f_position_in_file_view = sum_previous_length; + fh->f_index_in_file_view = j; + fh->f_total_bytes = 0; + } + } + } + + disp = (OPAL_PTRDIFF_TYPE)fh->f_decoded_iov[j].iov_base + + (fh->f_total_bytes - sum_previous_length); + fh->f_io_array[k].offset = (IOVBASE_TYPE *)(intptr_t)(disp + fh->f_offset); + + if (! (fh->f_flags & OMPIO_CONTIGUOUS_FVIEW)) { + if (fh->f_decoded_iov[j].iov_len - + (fh->f_total_bytes - sum_previous_length) + < fh->f_io_array[k].length) { + fh->f_io_array[k].length = fh->f_decoded_iov[j].iov_len - + (fh->f_total_bytes - sum_previous_length); + } + } + + total_bytes_written += fh->f_io_array[k].length; + fh->f_total_bytes += fh->f_io_array[k].length; + bytes_to_write_in_cycle -= fh->f_io_array[k].length; + k = k + 1; + } + fh->f_position_in_file_view = sum_previous_length; + fh->f_index_in_file_view = j; + fh->f_num_of_io_entries = k; + +#if 0 + if (fh->f_rank == 0) { + int d; + printf("*************************** %d\n", fh->f_num_of_io_entries); + + for (d=0 ; df_num_of_io_entries ; d++) { + printf(" ADDRESS: %p OFFSET: %p LENGTH: %d\n", + fh->f_io_array[d].memory_address, + fh->f_io_array[d].offset, + fh->f_io_array[d].length); + } + } +#endif + *ii = i; + *jj = j; + *tbw = total_bytes_written; + + return OMPI_SUCCESS; +} + diff --git a/ompi/mca/common/ompio/common_ompio_print_queue.c b/ompi/mca/common/ompio/common_ompio_print_queue.c index 75831272b2..7b2be822bf 100644 --- a/ompi/mca/common/ompio/common_ompio_print_queue.c +++ b/ompi/mca/common/ompio/common_ompio_print_queue.c @@ -25,15 +25,16 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/mca/common/ompio/common_ompio.h" +#include "ompi/mca/io/ompio/io_ompio.h" /* Print queue related function implementations */ -int mca_common_ompio_initialize_print_queue( mca_common_ompio_print_queue **r){ +int mca_common_ompio_initialize_print_queue( struct mca_common_ompio_print_queue **r){ - mca_common_ompio_print_queue *q=NULL; + struct mca_common_ompio_print_queue *q=NULL; int ret = OMPI_SUCCESS; - q = (mca_common_ompio_print_queue *) malloc ( sizeof(mca_common_ompio_print_queue)); + q = (struct mca_common_ompio_print_queue *) malloc ( sizeof(mca_common_ompio_print_queue)); if ( NULL == q ) { ret = OMPI_ERR_OUT_OF_RESOURCE; } @@ -45,8 +46,8 @@ int mca_common_ompio_initialize_print_queue( mca_common_ompio_print_queue **r){ return ret; } -int mca_common_ompio_register_print_entry ( mca_common_ompio_print_queue *q, - mca_common_ompio_print_entry x) +int mca_common_ompio_register_print_entry ( struct mca_common_ompio_print_queue *q, + mca_common_ompio_print_entry x) { if (q->count >= MCA_COMMON_OMPIO_QUEUESIZE){ return OMPI_ERROR; @@ -60,7 +61,7 @@ int mca_common_ompio_register_print_entry ( mca_common_ompio_print_queue *q, return OMPI_SUCCESS; } -int mca_common_ompio_unregister_print_entry ( mca_common_ompio_print_queue *q, +int mca_common_ompio_unregister_print_entry ( struct mca_common_ompio_print_queue *q, mca_common_ompio_print_entry *x) { @@ -76,7 +77,7 @@ int mca_common_ompio_unregister_print_entry ( mca_common_ompio_print_queue *q, return OMPI_SUCCESS; } -int mca_common_ompio_empty_print_queue(mca_common_ompio_print_queue *q) +int mca_common_ompio_empty_print_queue( struct mca_common_ompio_print_queue *q) { if (q->count == 0) { return 1; @@ -85,7 +86,7 @@ int mca_common_ompio_empty_print_queue(mca_common_ompio_print_queue *q) return 0; } -int mca_common_ompio_full_print_queue(mca_common_ompio_print_queue *q) +int mca_common_ompio_full_print_queue( struct mca_common_ompio_print_queue *q) { if (q->count < MCA_COMMON_OMPIO_QUEUESIZE) { return 0; @@ -95,7 +96,7 @@ int mca_common_ompio_full_print_queue(mca_common_ompio_print_queue *q) } -int mca_common_ompio_print_time_info( mca_common_ompio_print_queue *q, +int mca_common_ompio_print_time_info( struct mca_common_ompio_print_queue *q, char *name, struct mca_io_ompio_file_t *fh){ diff --git a/ompi/mca/common/ompio/common_ompio_print_queue.h b/ompi/mca/common/ompio/common_ompio_print_queue.h index deb869eeee..ba74e30a55 100644 --- a/ompi/mca/common/ompio/common_ompio_print_queue.h +++ b/ompi/mca/common/ompio/common_ompio_print_queue.h @@ -32,33 +32,36 @@ struct mca_io_ompio_file_t; #define MCA_COMMON_OMPIO_QUEUESIZE 2048 /*To extract time-information */ -typedef struct { +struct mca_common_ompio_print_entry{ double time[3]; int nprocs_for_coll; int aggregator; -}mca_common_ompio_print_entry; +}; -typedef struct { +typedef struct mca_common_ompio_print_entry mca_common_ompio_print_entry; + +struct mca_common_ompio_print_queue { mca_common_ompio_print_entry entry[MCA_COMMON_OMPIO_QUEUESIZE + 1]; int first; int last; int count; -} mca_common_ompio_print_queue; +}; +typedef struct mca_common_ompio_print_queue mca_common_ompio_print_queue; -OMPI_DECLSPEC int mca_common_ompio_register_print_entry (mca_common_ompio_print_queue *q, +OMPI_DECLSPEC int mca_common_ompio_register_print_entry (struct mca_common_ompio_print_queue *q, mca_common_ompio_print_entry x); -OMPI_DECLSPEC int mca_common_ompio_unregister_print_entry (mca_common_ompio_print_queue *q, +OMPI_DECLSPEC int mca_common_ompio_unregister_print_entry (struct mca_common_ompio_print_queue *q, mca_common_ompio_print_entry *x); -OMPI_DECLSPEC int mca_common_ompio_empty_print_queue(mca_common_ompio_print_queue *q); +OMPI_DECLSPEC int mca_common_ompio_empty_print_queue( struct mca_common_ompio_print_queue *q); -OMPI_DECLSPEC int mca_common_ompio_full_print_queue(mca_common_ompio_print_queue *q); +OMPI_DECLSPEC int mca_common_ompio_full_print_queue( struct mca_common_ompio_print_queue *q); -OMPI_DECLSPEC int mca_common_ompio_initialize_print_queue(mca_common_ompio_print_queue **q); +OMPI_DECLSPEC int mca_common_ompio_initialize_print_queue(struct mca_common_ompio_print_queue **q); -OMPI_DECLSPEC int mca_common_ompio_print_time_info( mca_common_ompio_print_queue *q, +OMPI_DECLSPEC int mca_common_ompio_print_time_info( struct mca_common_ompio_print_queue *q, char *name_operation, struct mca_io_ompio_file_t *fh); diff --git a/ompi/mca/fbtl/base/fbtl_base_file_select.c b/ompi/mca/fbtl/base/fbtl_base_file_select.c index 36393fc6d9..1c133ace6a 100644 --- a/ompi/mca/fbtl/base/fbtl_base_file_select.c +++ b/ompi/mca/fbtl/base/fbtl_base_file_select.c @@ -27,7 +27,7 @@ #include "opal/mca/base/base.h" #include "ompi/mca/fbtl/fbtl.h" #include "ompi/mca/fbtl/base/base.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" /* * This structure is needed so that we can close the modules diff --git a/ompi/mca/fbtl/base/fbtl_base_file_unselect.c b/ompi/mca/fbtl/base/fbtl_base_file_unselect.c index 280965f934..bf54f6c802 100644 --- a/ompi/mca/fbtl/base/fbtl_base_file_unselect.c +++ b/ompi/mca/fbtl/base/fbtl_base_file_unselect.c @@ -24,12 +24,12 @@ #include #include "mpi.h" -#include "ompi/mca/io/ompio/io_ompio.h" #include "opal/util/show_help.h" #include "ompi/mca/mca.h" #include "opal/mca/base/base.h" #include "ompi/mca/fbtl/fbtl.h" #include "ompi/mca/fbtl/base/base.h" +#include "ompi/mca/common/ompio/common_ompio.h" int mca_fbtl_base_file_unselect(mca_io_ompio_file_t *file) { diff --git a/ompi/mca/fbtl/plfs/fbtl_plfs.h b/ompi/mca/fbtl/plfs/fbtl_plfs.h index 40173b2524..dc1f4ea785 100644 --- a/ompi/mca/fbtl/plfs/fbtl_plfs.h +++ b/ompi/mca/fbtl/plfs/fbtl_plfs.h @@ -23,7 +23,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/fbtl/fbtl.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" #include extern int mca_fbtl_plfs_priority; diff --git a/ompi/mca/fbtl/posix/fbtl_posix.h b/ompi/mca/fbtl/posix/fbtl_posix.h index df6fd29e4f..9111cba761 100644 --- a/ompi/mca/fbtl/posix/fbtl_posix.h +++ b/ompi/mca/fbtl/posix/fbtl_posix.h @@ -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-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -23,7 +23,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/fbtl/fbtl.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" #include "ompi/mca/io/ompio/io_ompio_request.h" extern int mca_fbtl_posix_priority; diff --git a/ompi/mca/fbtl/pvfs2/fbtl_pvfs2.h b/ompi/mca/fbtl/pvfs2/fbtl_pvfs2.h index eab4e2c1dd..270d8e7b81 100644 --- a/ompi/mca/fbtl/pvfs2/fbtl_pvfs2.h +++ b/ompi/mca/fbtl/pvfs2/fbtl_pvfs2.h @@ -23,7 +23,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/fbtl/fbtl.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" #include "ompi/mca/fs/pvfs2/fs_pvfs2.h" #include "pvfs2.h" #include "pvfs2-compat.h" diff --git a/ompi/mca/fcoll/base/fcoll_base_coll_array.c b/ompi/mca/fcoll/base/fcoll_base_coll_array.c index a903a43cd2..4b334f1331 100644 --- a/ompi/mca/fcoll/base/fcoll_base_coll_array.c +++ b/ompi/mca/fcoll/base/fcoll_base_coll_array.c @@ -29,7 +29,7 @@ #include #include "ompi/mca/fcoll/base/fcoll_base_coll_array.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" int fcoll_base_coll_allgatherv_array (void *sbuf, diff --git a/ompi/mca/fcoll/base/fcoll_base_file_select.c b/ompi/mca/fcoll/base/fcoll_base_file_select.c index 3c260074f2..b0a410937a 100644 --- a/ompi/mca/fcoll/base/fcoll_base_file_select.c +++ b/ompi/mca/fcoll/base/fcoll_base_file_select.c @@ -27,7 +27,7 @@ #include "opal/mca/base/base.h" #include "ompi/mca/fcoll/fcoll.h" #include "ompi/mca/fcoll/base/base.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" /* * This structure is needed so that we can close the modules diff --git a/ompi/mca/fcoll/base/fcoll_base_file_unselect.c b/ompi/mca/fcoll/base/fcoll_base_file_unselect.c index b4b614ca8f..db70a84cae 100644 --- a/ompi/mca/fcoll/base/fcoll_base_file_unselect.c +++ b/ompi/mca/fcoll/base/fcoll_base_file_unselect.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-2011 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -24,12 +24,12 @@ #include #include "mpi.h" -#include "ompi/mca/io/ompio/io_ompio.h" #include "opal/util/show_help.h" #include "ompi/mca/mca.h" #include "opal/mca/base/base.h" #include "ompi/mca/fcoll/fcoll.h" #include "ompi/mca/fcoll/base/base.h" +#include "ompi/mca/common/ompio/common_ompio.h" int mca_fcoll_base_file_unselect(mca_io_ompio_file_t *file) { diff --git a/ompi/mca/fcoll/dynamic/fcoll_dynamic.h b/ompi/mca/fcoll/dynamic/fcoll_dynamic.h index 4ca2cab823..eaa634c93b 100644 --- a/ompi/mca/fcoll/dynamic/fcoll_dynamic.h +++ b/ompi/mca/fcoll/dynamic/fcoll_dynamic.h @@ -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-2014 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -28,7 +28,7 @@ #include "ompi/mca/mca.h" #include "ompi/mca/fcoll/fcoll.h" #include "ompi/mca/fcoll/base/base.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" BEGIN_C_DECLS diff --git a/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2.h b/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2.h index dfd8d16e92..7c83b42e17 100644 --- a/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2.h +++ b/ompi/mca/fcoll/dynamic_gen2/fcoll_dynamic_gen2.h @@ -28,7 +28,7 @@ #include "ompi/mca/mca.h" #include "ompi/mca/fcoll/fcoll.h" #include "ompi/mca/fcoll/base/base.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" BEGIN_C_DECLS diff --git a/ompi/mca/fcoll/individual/fcoll_individual.h b/ompi/mca/fcoll/individual/fcoll_individual.h index 298fae795b..26fb833fb6 100644 --- a/ompi/mca/fcoll/individual/fcoll_individual.h +++ b/ompi/mca/fcoll/individual/fcoll_individual.h @@ -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-2014 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -28,7 +28,7 @@ #include "ompi/mca/mca.h" #include "ompi/mca/fcoll/fcoll.h" #include "ompi/mca/fcoll/base/base.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" BEGIN_C_DECLS diff --git a/ompi/mca/fcoll/individual/fcoll_individual_file_read_all.c b/ompi/mca/fcoll/individual/fcoll_individual_file_read_all.c index bde6f9a92d..127080b2b7 100644 --- a/ompi/mca/fcoll/individual/fcoll_individual_file_read_all.c +++ b/ompi/mca/fcoll/individual/fcoll_individual_file_read_all.c @@ -23,8 +23,7 @@ #include "mpi.h" #include "ompi/constants.h" #include "ompi/mca/fcoll/fcoll.h" -#include "ompi/mca/io/ompio/io_ompio.h" -#include "ompi/mca/io/io.h" +#include "ompi/mca/common/ompio/common_ompio.h" #include "math.h" #include @@ -38,5 +37,5 @@ mca_fcoll_individual_file_read_all (mca_io_ompio_file_t *fh, struct ompi_datatype_t *datatype, ompi_status_public_t *status) { - return ompio_io_ompio_file_read( fh, buf, count, datatype, status); + return mca_common_ompio_file_read( fh, buf, count, datatype, status); } diff --git a/ompi/mca/fcoll/individual/fcoll_individual_file_write_all.c b/ompi/mca/fcoll/individual/fcoll_individual_file_write_all.c index 8b4b6fa881..550fca715b 100644 --- a/ompi/mca/fcoll/individual/fcoll_individual_file_write_all.c +++ b/ompi/mca/fcoll/individual/fcoll_individual_file_write_all.c @@ -25,8 +25,7 @@ #include "mpi.h" #include "ompi/constants.h" #include "ompi/mca/fcoll/fcoll.h" -#include "ompi/mca/io/ompio/io_ompio.h" -#include "ompi/mca/io/io.h" +#include "ompi/mca/common/ompio/common_ompio.h" #include "math.h" #include @@ -37,5 +36,5 @@ int mca_fcoll_individual_file_write_all (mca_io_ompio_file_t *fh, struct ompi_datatype_t *datatype, ompi_status_public_t *status) { - return ompio_io_ompio_file_write (fh, buf, count, datatype, status); + return mca_common_ompio_file_write (fh, buf, count, datatype, status); } diff --git a/ompi/mca/fcoll/static/fcoll_static.h b/ompi/mca/fcoll/static/fcoll_static.h index 91a9dd4900..e21574bb6f 100644 --- a/ompi/mca/fcoll/static/fcoll_static.h +++ b/ompi/mca/fcoll/static/fcoll_static.h @@ -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-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -28,7 +28,7 @@ #include "ompi/mca/mca.h" #include "ompi/mca/fcoll/fcoll.h" #include "ompi/mca/fcoll/base/base.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" BEGIN_C_DECLS diff --git a/ompi/mca/fcoll/two_phase/fcoll_two_phase.h b/ompi/mca/fcoll/two_phase/fcoll_two_phase.h index 8ffa620812..942cd85793 100644 --- a/ompi/mca/fcoll/two_phase/fcoll_two_phase.h +++ b/ompi/mca/fcoll/two_phase/fcoll_two_phase.h @@ -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-2014 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -28,7 +28,7 @@ #include "ompi/mca/mca.h" #include "ompi/mca/fcoll/fcoll.h" #include "ompi/mca/fcoll/base/base.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" BEGIN_C_DECLS diff --git a/ompi/mca/fs/base/fs_base_file_select.c b/ompi/mca/fs/base/fs_base_file_select.c index 6d91087b7d..f0927cdf3c 100644 --- a/ompi/mca/fs/base/fs_base_file_select.c +++ b/ompi/mca/fs/base/fs_base_file_select.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-2011 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -27,7 +27,7 @@ #include "opal/mca/base/base.h" #include "ompi/mca/fs/fs.h" #include "ompi/mca/fs/base/base.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" /* * This structure is needed so that we can close the modules diff --git a/ompi/mca/fs/base/fs_base_file_unselect.c b/ompi/mca/fs/base/fs_base_file_unselect.c index 1252bc2497..7b6bbd8267 100644 --- a/ompi/mca/fs/base/fs_base_file_unselect.c +++ b/ompi/mca/fs/base/fs_base_file_unselect.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-2011 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -24,13 +24,14 @@ #include #include "mpi.h" -#include "ompi/mca/io/ompio/io_ompio.h" #include "opal/util/show_help.h" #include "ompi/mca/mca.h" #include "opal/mca/base/base.h" #include "ompi/mca/fs/fs.h" #include "ompi/mca/fs/base/base.h" +#include "ompi/mca/common/ompio/common_ompio.h" + int mca_fs_base_file_unselect(mca_io_ompio_file_t *file) { if (NULL != file->f_fs && NULL != file->f_fs->fs_module_finalize) { diff --git a/ompi/mca/fs/base/fs_base_get_parent_dir.c b/ompi/mca/fs/base/fs_base_get_parent_dir.c index fb1d8ef814..bad67cac90 100644 --- a/ompi/mca/fs/base/fs_base_get_parent_dir.c +++ b/ompi/mca/fs/base/fs_base_get_parent_dir.c @@ -29,7 +29,7 @@ #include "ompi/mca/fs/fs.h" #include "ompi/mca/fs/base/base.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" #ifdef HAVE_SYS_STATFS_H #include /* or */ diff --git a/ompi/mca/fs/lustre/fs_lustre.h b/ompi/mca/fs/lustre/fs_lustre.h index ad4844c618..8e36a3933f 100644 --- a/ompi/mca/fs/lustre/fs_lustre.h +++ b/ompi/mca/fs/lustre/fs_lustre.h @@ -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-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -25,7 +25,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/fs/fs.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" extern int mca_fs_lustre_priority; extern int mca_fs_lustre_stripe_size; diff --git a/ompi/mca/fs/plfs/fs_plfs.h b/ompi/mca/fs/plfs/fs_plfs.h index 69221d4c9b..755a8c6b8c 100644 --- a/ompi/mca/fs/plfs/fs_plfs.h +++ b/ompi/mca/fs/plfs/fs_plfs.h @@ -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-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -25,7 +25,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/fs/fs.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" #include diff --git a/ompi/mca/fs/pvfs2/fs_pvfs2.h b/ompi/mca/fs/pvfs2/fs_pvfs2.h index a2e372770c..01bc4efa66 100644 --- a/ompi/mca/fs/pvfs2/fs_pvfs2.h +++ b/ompi/mca/fs/pvfs2/fs_pvfs2.h @@ -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-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -36,7 +36,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/fs/fs.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" extern int mca_fs_pvfs2_priority; extern int mca_fs_pvfs2_stripe_size; diff --git a/ompi/mca/fs/ufs/fs_ufs.h b/ompi/mca/fs/ufs/fs_ufs.h index daebc5d505..66ec4c6ce2 100644 --- a/ompi/mca/fs/ufs/fs_ufs.h +++ b/ompi/mca/fs/ufs/fs_ufs.h @@ -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-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -25,7 +25,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/fs/fs.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" extern int mca_fs_ufs_priority; diff --git a/ompi/mca/io/ompio/io_ompio.h b/ompi/mca/io/ompio/io_ompio.h index 4477d21d91..60b2fea826 100644 --- a/ompi/mca/io/ompio/io_ompio.h +++ b/ompi/mca/io/ompio/io_ompio.h @@ -10,7 +10,7 @@ * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. - * Copyright (c) 2008-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -41,7 +41,6 @@ #include "ompi/datatype/ompi_datatype.h" #include "ompi/request/request.h" -#include "ompi/mca/common/ompio/common_ompio.h" extern int mca_io_ompio_cycle_buffer_size; extern int mca_io_ompio_bytes_per_agg; @@ -219,6 +218,7 @@ typedef int (*mca_io_ompio_set_aggregator_props_fn_t) (struct mca_io_ompio_file_ size_t bytes_per_proc); +struct mca_common_ompio_print_queue; /** * Back-end structure for MPI_File @@ -289,8 +289,8 @@ struct mca_io_ompio_file_t { mca_sharedfp_base_module_t *f_sharedfp; /* Timing information */ - mca_common_ompio_print_queue *f_coll_write_time; - mca_common_ompio_print_queue *f_coll_read_time; + struct mca_common_ompio_print_queue *f_coll_write_time; + struct mca_common_ompio_print_queue *f_coll_read_time; /*initial list of aggregators and groups*/ int *f_init_aggr_list; @@ -320,17 +320,15 @@ struct mca_io_ompio_data_t { typedef struct mca_io_ompio_data_t mca_io_ompio_data_t; +#include "ompi/mca/common/ompio/common_ompio.h" + + /* functions to retrieve the number of aggregators and the size of the temporary buffer on aggregators from the fcoll modules */ OMPI_DECLSPEC void mca_io_ompio_get_num_aggregators ( int *num_aggregators); OMPI_DECLSPEC void mca_io_ompio_get_bytes_per_agg ( int *bytes_per_agg); -OMPI_DECLSPEC int mca_io_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cycles, - size_t bpc, int max_data, uint32_t iov_count, - struct iovec *decoded_iov, int *ii, int *jj, - size_t *tbw ); - OMPI_DECLSPEC int ompi_io_ompio_set_file_defaults (mca_io_ompio_file_t *fh); OMPI_DECLSPEC int ompio_io_ompio_file_open (ompi_communicator_t *comm, @@ -339,82 +337,9 @@ OMPI_DECLSPEC int ompio_io_ompio_file_open (ompi_communicator_t *comm, ompi_info_t *info, mca_io_ompio_file_t *fh,bool use_sharedfp); -OMPI_DECLSPEC int ompio_io_ompio_file_write_at (mca_io_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 ompio_io_ompio_file_write (mca_io_ompio_file_t *fh, - const void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_status_public_t *status); - OMPI_DECLSPEC int ompio_io_ompio_file_close (mca_io_ompio_file_t *fh); -OMPI_DECLSPEC int ompio_io_ompio_file_write_at_all (mca_io_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 ompio_io_ompio_file_iwrite_at (mca_io_ompio_file_t *fh, - OMPI_MPI_OFFSET_TYPE offset, - const void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request); - -OMPI_DECLSPEC int ompio_io_ompio_file_iwrite (mca_io_ompio_file_t *fh, - const void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request); - -OMPI_DECLSPEC int ompio_io_ompio_file_iwrite_at_all (mca_io_ompio_file_t *fh, - OMPI_MPI_OFFSET_TYPE offset, - const void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request); -OMPI_DECLSPEC int ompio_io_ompio_file_iread (mca_io_ompio_file_t *fh, - void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request); - -OMPI_DECLSPEC int ompio_io_ompio_file_read (mca_io_ompio_file_t *fh, - void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_status_public_t *status); -OMPI_DECLSPEC int ompio_io_ompio_file_iread_at (mca_io_ompio_file_t *fh, - OMPI_MPI_OFFSET_TYPE offset, - void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request); -OMPI_DECLSPEC int ompio_io_ompio_file_iread_at_all (mca_io_ompio_file_t *fh, - OMPI_MPI_OFFSET_TYPE offset, - void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request); -OMPI_DECLSPEC int ompio_io_ompio_file_read_at (mca_io_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 ompio_io_ompio_file_read_at_all (mca_io_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 ompio_io_ompio_file_get_size (mca_io_ompio_file_t *fh, OMPI_MPI_OFFSET_TYPE *size); diff --git a/ompi/mca/io/ompio/io_ompio_file_read.c b/ompi/mca/io/ompio/io_ompio_file_read.c index d60c181912..4f2ef58255 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-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -59,102 +59,7 @@ int mca_io_ompio_file_read (ompi_file_t *fp, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fp->f_io_selected_data; - ret = ompio_io_ompio_file_read(&data->ompio_fh,buf,count,datatype,status); - - return ret; -} - -int ompio_io_ompio_file_read (mca_io_ompio_file_t *fh, - void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_status_public_t *status) -{ - int ret = OMPI_SUCCESS; - - size_t total_bytes_read = 0; /* total bytes that have been read*/ - size_t bytes_per_cycle = 0; /* total read in each cycle by each process*/ - int index = 0; - int cycles = 0; - - uint32_t iov_count = 0; - struct iovec *decoded_iov = NULL; - - size_t max_data=0, real_bytes_read=0; - ssize_t ret_code=0; - int i = 0; /* index into the decoded iovec of the buffer */ - int j = 0; /* index into the file vie iovec */ - - if ( 0 == count ) { - if ( MPI_STATUS_IGNORE != status ) { - status->_ucount = 0; - } - return ret; - } - - if (fh->f_amode & MPI_MODE_WRONLY){ - printf("Improper use of FILE Mode, Using WRONLY for Read!\n"); - ret = OMPI_ERROR; - return ret; - } - - ompi_io_ompio_decode_datatype (fh, - datatype, - count, - buf, - &max_data, - &decoded_iov, - &iov_count); - - if ( -1 == mca_io_ompio_cycle_buffer_size ) { - bytes_per_cycle = max_data; - } - else { - bytes_per_cycle = mca_io_ompio_cycle_buffer_size; - } - cycles = ceil((float)max_data/bytes_per_cycle); - -#if 0 - printf ("Bytes per Cycle: %d Cycles: %d max_data:%d \n",bytes_per_cycle, cycles, max_data); -#endif - - j = fh->f_index_in_file_view; - - for (index = 0; index < cycles; index++) { - - mca_io_ompio_build_io_array ( fh, - index, - cycles, - bytes_per_cycle, - max_data, - iov_count, - decoded_iov, - &i, - &j, - &total_bytes_read); - - if (fh->f_num_of_io_entries) { - ret_code = fh->f_fbtl->fbtl_preadv (fh); - if ( 0<= ret_code ) { - real_bytes_read+=(size_t)ret_code; - } - } - - fh->f_num_of_io_entries = 0; - if (NULL != fh->f_io_array) { - free (fh->f_io_array); - fh->f_io_array = NULL; - } - } - - if (NULL != decoded_iov) { - free (decoded_iov); - decoded_iov = NULL; - } - - if ( MPI_STATUS_IGNORE != status ) { - status->_ucount = real_bytes_read; - } + ret = mca_common_ompio_file_read(&data->ompio_fh,buf,count,datatype,status); return ret; } @@ -170,39 +75,11 @@ int mca_io_ompio_file_read_at (ompi_file_t *fh, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fh->f_io_selected_data; - ret = ompio_io_ompio_file_read_at(&data->ompio_fh, offset,buf,count,datatype,status); + ret = mca_common_ompio_file_read_at(&data->ompio_fh, offset,buf,count,datatype,status); return ret; } -int ompio_io_ompio_file_read_at (mca_io_ompio_file_t *fh, - OMPI_MPI_OFFSET_TYPE offset, - void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_status_public_t * status) -{ - int ret = OMPI_SUCCESS; - OMPI_MPI_OFFSET_TYPE prev_offset; - - ompio_io_ompio_file_get_position (fh, &prev_offset ); - - ompi_io_ompio_set_explicit_offset (fh, offset); - ret = ompio_io_ompio_file_read (fh, - buf, - count, - datatype, - status); - - // An explicit offset file operation is not suppsed to modify - // the internal file pointer. So reset the pointer - // to the previous value - ompi_io_ompio_set_explicit_offset (fh, prev_offset); - - return ret; -} - - int mca_io_ompio_file_iread (ompi_file_t *fh, void *buf, int count, @@ -213,103 +90,12 @@ int mca_io_ompio_file_iread (ompi_file_t *fh, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fh->f_io_selected_data; - ret = ompio_io_ompio_file_iread(&data->ompio_fh,buf,count,datatype,request); + ret = mca_common_ompio_file_iread(&data->ompio_fh,buf,count,datatype,request); return ret; } -int ompio_io_ompio_file_iread (mca_io_ompio_file_t *fh, - void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request) -{ - int ret = OMPI_SUCCESS; - mca_ompio_request_t *ompio_req=NULL; - - ompio_req = OBJ_NEW(mca_ompio_request_t); - ompio_req->req_type = MCA_OMPIO_REQUEST_READ; - ompio_req->req_ompi.req_state = OMPI_REQUEST_ACTIVE; - - if ( 0 == count ) { - ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; - ompio_req->req_ompi.req_status._ucount = 0; - ompi_request_complete (&ompio_req->req_ompi, false); - *request = (ompi_request_t *) ompio_req; - - return OMPI_SUCCESS; - } - - if ( NULL != fh->f_fbtl->fbtl_ipreadv ) { - // This fbtl has support for non-blocking operations - - size_t total_bytes_read = 0; /* total bytes that have been read*/ - uint32_t iov_count = 0; - struct iovec *decoded_iov = NULL; - - size_t max_data = 0; - int i = 0; /* index into the decoded iovec of the buffer */ - int j = 0; /* index into the file vie iovec */ - - ompi_io_ompio_decode_datatype (fh, - datatype, - count, - buf, - &max_data, - &decoded_iov, - &iov_count); - - // Non-blocking operations have to occur in a single cycle - j = fh->f_index_in_file_view; - - mca_io_ompio_build_io_array ( fh, - 0, // index - 1, // no. of cyces - max_data, // setting bytes per cycle to match data - max_data, - iov_count, - decoded_iov, - &i, - &j, - &total_bytes_read); - - if (fh->f_num_of_io_entries) { - fh->f_fbtl->fbtl_ipreadv (fh, (ompi_request_t *) ompio_req); - } - - if ( false == mca_io_ompio_progress_is_registered ) { - // Lazy initialization of progress function to minimize impact - // on other ompi functionality in case its not used. - opal_progress_register (mca_io_ompio_component_progress); - mca_io_ompio_progress_is_registered=true; - } - - fh->f_num_of_io_entries = 0; - if (NULL != fh->f_io_array) { - free (fh->f_io_array); - fh->f_io_array = NULL; - } - - if (NULL != decoded_iov) { - free (decoded_iov); - decoded_iov = NULL; - } - } - else { - // This fbtl does not support non-blocking operations - ompi_status_public_t status; - ret = ompio_io_ompio_file_read (fh, buf, count, datatype, &status); - - ompio_req->req_ompi.req_status.MPI_ERROR = ret; - ompio_req->req_ompi.req_status._ucount = status._ucount; - ompi_request_complete (&ompio_req->req_ompi, false); - } - - *request = (ompi_request_t *) ompio_req; - return ret; -} - int mca_io_ompio_file_iread_at (ompi_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, void *buf, @@ -321,38 +107,7 @@ int mca_io_ompio_file_iread_at (ompi_file_t *fh, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fh->f_io_selected_data; - ret = ompio_io_ompio_file_iread_at(&data->ompio_fh,offset,buf,count,datatype,request); - - return ret; -} - -int ompio_io_ompio_file_iread_at (mca_io_ompio_file_t *fh, - OMPI_MPI_OFFSET_TYPE offset, - void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request) -{ - int ret = OMPI_SUCCESS; - OMPI_MPI_OFFSET_TYPE prev_offset; - ompio_io_ompio_file_get_position (fh, &prev_offset ); - - ompi_io_ompio_set_explicit_offset (fh, offset); - ret = ompio_io_ompio_file_iread (fh, - buf, - count, - datatype, - request); - - /* An explicit offset file operation is not suppsed to modify - ** the internal file pointer. So reset the pointer - ** to the previous value - ** It is OK to reset the position already here, althgouth - ** the operation might still be pending/ongoing, since - ** the entire array of have - ** already been constructed in the file_iread operation - */ - ompi_io_ompio_set_explicit_offset (fh, prev_offset); + ret = mca_common_ompio_file_iread_at(&data->ompio_fh,offset,buf,count,datatype,request); return ret; } @@ -411,7 +166,7 @@ int mca_io_ompio_file_iread_all (ompi_file_t *fh, /* this fcoll component does not support non-blocking collective I/O operations. WE fake it with individual non-blocking I/O operations. */ - ret = ompio_io_ompio_file_iread ( fp, buf, count, datatype, request ); + ret = mca_common_ompio_file_iread ( fp, buf, count, datatype, request ); } return ret; @@ -429,33 +184,11 @@ int mca_io_ompio_file_read_at_all (ompi_file_t *fh, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fh->f_io_selected_data; - ret = ompio_io_ompio_file_read_at_all(&data->ompio_fh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_read_at_all(&data->ompio_fh,offset,buf,count,datatype,status); return ret; } -int ompio_io_ompio_file_read_at_all (mca_io_ompio_file_t *fh, - OMPI_MPI_OFFSET_TYPE offset, - void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_status_public_t * status) -{ - int ret = OMPI_SUCCESS; - OMPI_MPI_OFFSET_TYPE prev_offset; - ompio_io_ompio_file_get_position (fh, &prev_offset ); - - ompi_io_ompio_set_explicit_offset (fh, offset); - ret = fh->f_fcoll->fcoll_file_read_all (fh, - buf, - count, - datatype, - status); - - ompi_io_ompio_set_explicit_offset (fh, prev_offset); - return ret; -} - int mca_io_ompio_file_iread_at_all (ompi_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, void *buf, @@ -467,41 +200,10 @@ int mca_io_ompio_file_iread_at_all (ompi_file_t *fh, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fh->f_io_selected_data; - ret = ompio_io_ompio_file_iread_at_all ( &data->ompio_fh, offset, buf, count, datatype, request ); + ret = mca_common_ompio_file_iread_at_all ( &data->ompio_fh, offset, buf, count, datatype, request ); return ret; } -int ompio_io_ompio_file_iread_at_all (mca_io_ompio_file_t *fp, - OMPI_MPI_OFFSET_TYPE offset, - void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request) -{ - int ret = OMPI_SUCCESS; - OMPI_MPI_OFFSET_TYPE prev_offset; - - ompio_io_ompio_file_get_position (fp, &prev_offset ); - ompi_io_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 = ompio_io_ompio_file_iread ( fp, buf, count, datatype, request ); - } - - - ompi_io_ompio_set_explicit_offset (fp, prev_offset); - return ret; -} /* Infrastructure for shared file pointer operations ** (individual and ordered)*/ @@ -685,7 +387,7 @@ int mca_io_ompio_file_read_at_all_begin (ompi_file_t *fh, printf("Only one split collective I/O operation allowed per file handle at any given point in time!\n"); return MPI_ERR_REQUEST; } - ret = ompio_io_ompio_file_iread_at_all ( fp, offset, buf, count, datatype, &fp->f_split_coll_req ); + ret = mca_common_ompio_file_iread_at_all ( fp, offset, buf, count, datatype, &fp->f_split_coll_req ); fp->f_split_coll_in_use = true; 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 637cafe863..7b4f674d2c 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-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -45,7 +45,7 @@ ** routines are the ones registered with the ompio modules. ** The ** -** ompio_io_ompio_file_read/write[_at] +** mca_common_ompio_file_read/write[_at] ** ** routesin are used e.g. from the shared file pointer modules. ** The main difference is, that the first one takes an ompi_file_t @@ -67,94 +67,10 @@ int mca_io_ompio_file_write (ompi_file_t *fp, data = (mca_io_ompio_data_t *) fp->f_io_selected_data; fh = &data->ompio_fh; - ret = ompio_io_ompio_file_write(fh,buf,count,datatype,status); + ret = mca_common_ompio_file_write(fh,buf,count,datatype,status); return ret; } -int ompio_io_ompio_file_write (mca_io_ompio_file_t *fh, - const void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_status_public_t *status) -{ - int ret = OMPI_SUCCESS; - int index = 0; - int cycles = 0; - - uint32_t iov_count = 0; - struct iovec *decoded_iov = NULL; - size_t bytes_per_cycle=0; - size_t total_bytes_written = 0; - size_t max_data=0, real_bytes_written=0; - ssize_t ret_code=0; - int i = 0; /* index into the decoded iovec of the buffer */ - int j = 0; /* index into the file view iovec */ - - if ( 0 == count ) { - if ( MPI_STATUS_IGNORE != status ) { - status->_ucount = 0; - } - return ret; - } - - ompi_io_ompio_decode_datatype (fh, - datatype, - count, - buf, - &max_data, - &decoded_iov, - &iov_count); - - if ( -1 == mca_io_ompio_cycle_buffer_size ) { - bytes_per_cycle = max_data; - } - else { - bytes_per_cycle = mca_io_ompio_cycle_buffer_size; - } - cycles = ceil((float)max_data/bytes_per_cycle); - -#if 0 - printf ("Bytes per Cycle: %d Cycles: %d\n", bytes_per_cycle, cycles); -#endif - - j = fh->f_index_in_file_view; - for (index = 0; index < cycles; index++) { - mca_io_ompio_build_io_array ( fh, - index, - cycles, - bytes_per_cycle, - max_data, - iov_count, - decoded_iov, - &i, - &j, - &total_bytes_written); - - if (fh->f_num_of_io_entries) { - ret_code =fh->f_fbtl->fbtl_pwritev (fh); - if ( 0<= ret_code ) { - real_bytes_written+= (size_t)ret_code; - } - } - - fh->f_num_of_io_entries = 0; - if (NULL != fh->f_io_array) { - free (fh->f_io_array); - fh->f_io_array = NULL; - } - } - - if (NULL != decoded_iov) { - free (decoded_iov); - decoded_iov = NULL; - } - - if ( MPI_STATUS_IGNORE != status ) { - status->_ucount = real_bytes_written; - } - - return ret; -} int mca_io_ompio_file_write_at (ompi_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, @@ -167,35 +83,11 @@ int mca_io_ompio_file_write_at (ompi_file_t *fh, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fh->f_io_selected_data; - ret = ompio_io_ompio_file_write_at (&data->ompio_fh, offset,buf,count,datatype,status); + ret = mca_common_ompio_file_write_at (&data->ompio_fh, offset,buf,count,datatype,status); return ret; } -int ompio_io_ompio_file_write_at (mca_io_ompio_file_t *fh, - OMPI_MPI_OFFSET_TYPE offset, - const void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_status_public_t *status) -{ - int ret = OMPI_SUCCESS; - OMPI_MPI_OFFSET_TYPE prev_offset; - ompio_io_ompio_file_get_position (fh, &prev_offset ); - - ompi_io_ompio_set_explicit_offset (fh, offset); - ret = ompio_io_ompio_file_write (fh, - buf, - count, - datatype, - status); - // An explicit offset file operation is not suppsed to modify - // the internal file pointer. So reset the pointer - // to the previous value - ompi_io_ompio_set_explicit_offset (fh, prev_offset ); - return ret; -} - int mca_io_ompio_file_iwrite (ompi_file_t *fp, const void *buf, int count, @@ -206,98 +98,11 @@ int mca_io_ompio_file_iwrite (ompi_file_t *fp, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fp->f_io_selected_data; - ret = ompio_io_ompio_file_iwrite(&data->ompio_fh,buf,count,datatype,request); + ret = mca_common_ompio_file_iwrite(&data->ompio_fh,buf,count,datatype,request); return ret; } -int ompio_io_ompio_file_iwrite (mca_io_ompio_file_t *fh, - const void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_request_t **request) -{ - int ret = OMPI_SUCCESS; - mca_ompio_request_t *ompio_req=NULL; - - ompio_req = OBJ_NEW(mca_ompio_request_t); - ompio_req->req_type = MCA_OMPIO_REQUEST_WRITE; - ompio_req->req_ompi.req_state = OMPI_REQUEST_ACTIVE; - - if ( 0 == count ) { - ompio_req->req_ompi.req_status.MPI_ERROR = OMPI_SUCCESS; - ompio_req->req_ompi.req_status._ucount = 0; - ompi_request_complete (&ompio_req->req_ompi, false); - *request = (ompi_request_t *) ompio_req; - - return OMPI_SUCCESS; - } - - if ( NULL != fh->f_fbtl->fbtl_ipwritev ) { - /* This fbtl has support for non-blocking operations */ - - uint32_t iov_count = 0; - struct iovec *decoded_iov = NULL; - size_t max_data = 0; - size_t total_bytes_written =0; - int i = 0; /* index into the decoded iovec of the buffer */ - int j = 0; /* index into the file vie iovec */ - - ompi_io_ompio_decode_datatype (fh, - datatype, - count, - buf, - &max_data, - &decoded_iov, - &iov_count); - j = fh->f_index_in_file_view; - - /* Non blocking operations have to occur in a single cycle */ - mca_io_ompio_build_io_array ( fh, - 0, // index of current cycle iteration - 1, // number of cycles - max_data, // setting bytes_per_cycle to max_data - max_data, - iov_count, - decoded_iov, - &i, - &j, - &total_bytes_written); - - if (fh->f_num_of_io_entries) { - fh->f_fbtl->fbtl_ipwritev (fh, (ompi_request_t *) ompio_req); - } - - if ( false == mca_io_ompio_progress_is_registered ) { - // Lazy initialization of progress function to minimize impact - // on other ompi functionality in case its not used. - opal_progress_register (mca_io_ompio_component_progress); - mca_io_ompio_progress_is_registered=true; - } - - fh->f_num_of_io_entries = 0; - if (NULL != fh->f_io_array) { - free (fh->f_io_array); - fh->f_io_array = NULL; - } - if (NULL != decoded_iov) { - free (decoded_iov); - decoded_iov = NULL; - } - } - else { - // This fbtl does not support non-blocking write operations - ompi_status_public_t status; - ret = ompio_io_ompio_file_write(fh,buf,count,datatype, &status); - - ompio_req->req_ompi.req_status.MPI_ERROR = ret; - ompio_req->req_ompi.req_status._ucount = status._ucount; - ompi_request_complete (&ompio_req->req_ompi, false); - } - - *request = (ompi_request_t *) ompio_req; - return ret; -} int mca_io_ompio_file_iwrite_at (ompi_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, @@ -310,165 +115,11 @@ int mca_io_ompio_file_iwrite_at (ompi_file_t *fh, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fh->f_io_selected_data; - ret = ompio_io_ompio_file_iwrite_at(&data->ompio_fh,offset,buf,count,datatype,request); + ret = mca_common_ompio_file_iwrite_at(&data->ompio_fh,offset,buf,count,datatype,request); return ret; } -int ompio_io_ompio_file_iwrite_at (mca_io_ompio_file_t *fh, - 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; - ompio_io_ompio_file_get_position (fh, &prev_offset ); - - ompi_io_ompio_set_explicit_offset (fh, offset); - ret = ompio_io_ompio_file_iwrite (fh, - buf, - count, - datatype, - request); - - /* An explicit offset file operation is not suppsed to modify - ** the internal file pointer. So reset the pointer - ** to the previous value - ** It is OK to reset the position already here, althgouth - ** the operation might still be pending/ongoing, since - ** the entire array of have - ** already been constructed in the file_iwrite operation - */ - ompi_io_ompio_set_explicit_offset (fh, prev_offset); - - return ret; -} - -/* Helper function used by both read and write operations */ -/**************************************************************/ - -int mca_io_ompio_build_io_array ( mca_io_ompio_file_t *fh, int index, int cycles, - size_t bytes_per_cycle, int max_data, uint32_t iov_count, - struct iovec *decoded_iov, int *ii, int *jj, size_t *tbw ) -{ - OPAL_PTRDIFF_TYPE disp; - int block = 1; - size_t total_bytes_written = *tbw; /* total bytes that have been written*/ - size_t bytes_to_write_in_cycle = 0; /* left to be written in a cycle*/ - size_t sum_previous_counts = 0; - size_t sum_previous_length = 0; - int k = 0; /* index into the io_array */ - int i = *ii; - int j = *jj; - - sum_previous_length = fh->f_position_in_file_view; - - if ((index == cycles-1) && (max_data % bytes_per_cycle)) { - bytes_to_write_in_cycle = max_data % bytes_per_cycle; - } - else { - bytes_to_write_in_cycle = bytes_per_cycle; - } - - fh->f_io_array = (mca_io_ompio_io_array_t *)malloc - (OMPIO_IOVEC_INITIAL_SIZE * sizeof (mca_io_ompio_io_array_t)); - if (NULL == fh->f_io_array) { - opal_output(1, "OUT OF MEMORY\n"); - return OMPI_ERR_OUT_OF_RESOURCE; - } - - while (bytes_to_write_in_cycle) { - /* reallocate if needed */ - if (OMPIO_IOVEC_INITIAL_SIZE*block <= k) { - block ++; - fh->f_io_array = (mca_io_ompio_io_array_t *)realloc - (fh->f_io_array, OMPIO_IOVEC_INITIAL_SIZE * - block * sizeof (mca_io_ompio_io_array_t)); - if (NULL == fh->f_io_array) { - opal_output(1, "OUT OF MEMORY\n"); - return OMPI_ERR_OUT_OF_RESOURCE; - } - } - - if (decoded_iov[i].iov_len - - (total_bytes_written - sum_previous_counts) <= 0) { - sum_previous_counts += decoded_iov[i].iov_len; - i = i + 1; - } - - disp = (OPAL_PTRDIFF_TYPE)decoded_iov[i].iov_base + - (total_bytes_written - sum_previous_counts); - fh->f_io_array[k].memory_address = (IOVBASE_TYPE *)disp; - - if (decoded_iov[i].iov_len - - (total_bytes_written - sum_previous_counts) >= - bytes_to_write_in_cycle) { - fh->f_io_array[k].length = bytes_to_write_in_cycle; - } - else { - fh->f_io_array[k].length = decoded_iov[i].iov_len - - (total_bytes_written - sum_previous_counts); - } - - if (! (fh->f_flags & OMPIO_CONTIGUOUS_FVIEW)) { - if (fh->f_decoded_iov[j].iov_len - - (fh->f_total_bytes - sum_previous_length) <= 0) { - sum_previous_length += fh->f_decoded_iov[j].iov_len; - j = j + 1; - if (j == (int)fh->f_iov_count) { - j = 0; - sum_previous_length = 0; - fh->f_offset += fh->f_view_extent; - fh->f_position_in_file_view = sum_previous_length; - fh->f_index_in_file_view = j; - fh->f_total_bytes = 0; - } - } - } - - disp = (OPAL_PTRDIFF_TYPE)fh->f_decoded_iov[j].iov_base + - (fh->f_total_bytes - sum_previous_length); - fh->f_io_array[k].offset = (IOVBASE_TYPE *)(intptr_t)(disp + fh->f_offset); - - if (! (fh->f_flags & OMPIO_CONTIGUOUS_FVIEW)) { - if (fh->f_decoded_iov[j].iov_len - - (fh->f_total_bytes - sum_previous_length) - < fh->f_io_array[k].length) { - fh->f_io_array[k].length = fh->f_decoded_iov[j].iov_len - - (fh->f_total_bytes - sum_previous_length); - } - } - - total_bytes_written += fh->f_io_array[k].length; - fh->f_total_bytes += fh->f_io_array[k].length; - bytes_to_write_in_cycle -= fh->f_io_array[k].length; - k = k + 1; - } - fh->f_position_in_file_view = sum_previous_length; - fh->f_index_in_file_view = j; - fh->f_num_of_io_entries = k; - -#if 0 - if (fh->f_rank == 0) { - int d; - printf("*************************** %d\n", fh->f_num_of_io_entries); - - for (d=0 ; df_num_of_io_entries ; d++) { - printf(" ADDRESS: %p OFFSET: %p LENGTH: %d\n", - fh->f_io_array[d].memory_address, - fh->f_io_array[d].offset, - fh->f_io_array[d].length); - } - } -#endif - *ii = i; - *jj = j; - *tbw = total_bytes_written; - - return OMPI_SUCCESS; -} /* Collective operations */ /******************************************************************/ @@ -512,7 +163,7 @@ int mca_io_ompio_file_write_at_all (ompi_file_t *fh, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fh->f_io_selected_data; - ret = ompio_io_ompio_file_write_at_all(&data->ompio_fh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_write_at_all(&data->ompio_fh,offset,buf,count,datatype,status); return ret; } @@ -541,33 +192,12 @@ int mca_io_ompio_file_iwrite_all (ompi_file_t *fh, /* this fcoll component does not support non-blocking collective I/O operations. WE fake it with individual non-blocking I/O operations. */ - ret = ompio_io_ompio_file_iwrite ( fp, buf, count, datatype, request ); + ret = mca_common_ompio_file_iwrite ( fp, buf, count, datatype, request ); } return ret; } -int ompio_io_ompio_file_write_at_all (mca_io_ompio_file_t *fh, - OMPI_MPI_OFFSET_TYPE offset, - const void *buf, - int count, - struct ompi_datatype_t *datatype, - ompi_status_public_t *status) -{ - int ret = OMPI_SUCCESS; - OMPI_MPI_OFFSET_TYPE prev_offset; - ompio_io_ompio_file_get_position (fh, &prev_offset ); - - ompi_io_ompio_set_explicit_offset (fh, offset); - ret = fh->f_fcoll->fcoll_file_write_all (fh, - buf, - count, - datatype, - status); - - ompi_io_ompio_set_explicit_offset (fh, prev_offset); - return ret; -} int mca_io_ompio_file_iwrite_at_all (ompi_file_t *fh, OMPI_MPI_OFFSET_TYPE offset, @@ -580,46 +210,10 @@ int mca_io_ompio_file_iwrite_at_all (ompi_file_t *fh, mca_io_ompio_data_t *data; data = (mca_io_ompio_data_t *) fh->f_io_selected_data; - ret = ompio_io_ompio_file_iwrite_at_all ( &data->ompio_fh, offset, buf, count, datatype, request ); + ret = mca_common_ompio_file_iwrite_at_all ( &data->ompio_fh, offset, buf, count, datatype, request ); return ret; } -int ompio_io_ompio_file_iwrite_at_all (mca_io_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; - - ompio_io_ompio_file_get_position (fp, &prev_offset ); - - ompi_io_ompio_set_explicit_offset (fp, offset); - - if ( NULL != fp->f_fcoll->fcoll_file_iwrite_all ) { - ret = fp->f_fcoll->fcoll_file_iwrite_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 = ompio_io_ompio_file_iwrite ( fp, buf, count, datatype, request ); - } - - ompi_io_ompio_set_explicit_offset (fp, prev_offset); - return ret; -} - - - - /* Infrastructure for shared file pointer operations */ /* (Individual and collective */ @@ -806,7 +400,7 @@ int mca_io_ompio_file_write_at_all_begin (ompi_file_t *fh, printf("Only one split collective I/O operation allowed per file handle at any given point in time!\n"); return MPI_ERR_REQUEST; } - ret = ompio_io_ompio_file_iwrite_at_all ( fp, offset, buf, count, datatype, &fp->f_split_coll_req ); + ret = mca_common_ompio_file_iwrite_at_all ( fp, offset, buf, count, datatype, &fp->f_split_coll_req ); fp->f_split_coll_in_use = true; return ret; diff --git a/ompi/mca/sharedfp/addproc/sharedfp_addproc.h b/ompi/mca/sharedfp/addproc/sharedfp_addproc.h index 52030231e0..e47afda7a8 100644 --- a/ompi/mca/sharedfp/addproc/sharedfp_addproc.h +++ b/ompi/mca/sharedfp/addproc/sharedfp_addproc.h @@ -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) 2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -23,7 +23,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/sharedfp/sharedfp.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" #include BEGIN_C_DECLS diff --git a/ompi/mca/sharedfp/addproc/sharedfp_addproc_iread.c b/ompi/mca/sharedfp/addproc/sharedfp_addproc_iread.c index 961733b661..38239d963d 100644 --- a/ompi/mca/sharedfp/addproc/sharedfp_addproc_iread.c +++ b/ompi/mca/sharedfp/addproc/sharedfp_addproc_iread.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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -66,7 +66,7 @@ int mca_sharedfp_addproc_iread(mca_io_ompio_file_t *fh, "mca_sharedfp_addproc_iread: Offset received is %lld\n",offset); } /* Read from the file */ - ret = ompio_io_ompio_file_iread_at ( sh->sharedfh, offset, buf, count, datatype, request); + ret = mca_common_ompio_file_iread_at ( sh->sharedfh, offset, buf, count, datatype, request); } return ret; @@ -180,7 +180,7 @@ int mca_sharedfp_addproc_read_ordered_begin(mca_io_ompio_file_t *fh, } /* read from the file */ - ret = ompio_io_ompio_file_iread_at_all(sh->sharedfh,offset,buf,count,datatype,&fh->f_split_coll_req); + ret = mca_common_ompio_file_iread_at_all(sh->sharedfh,offset,buf,count,datatype,&fh->f_split_coll_req); fh->f_split_coll_in_use = true; exit: diff --git a/ompi/mca/sharedfp/addproc/sharedfp_addproc_iwrite.c b/ompi/mca/sharedfp/addproc/sharedfp_addproc_iwrite.c index 0157c079cb..2aec2ee16c 100644 --- a/ompi/mca/sharedfp/addproc/sharedfp_addproc_iwrite.c +++ b/ompi/mca/sharedfp/addproc/sharedfp_addproc_iwrite.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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -64,7 +64,7 @@ int mca_sharedfp_addproc_iwrite(mca_io_ompio_file_t *fh, "sharedfp_addproc_iwrite: Offset received is %lld\n",offset); } /* Write to the file */ - ret = ompio_io_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request); + ret = mca_common_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request); } return ret; @@ -176,7 +176,7 @@ int mca_sharedfp_addproc_write_ordered_begin(mca_io_ompio_file_t *fh, } /* write to the file */ - ret = ompio_io_ompio_file_iwrite_at_all(sh->sharedfh,offset,buf,count,datatype,&fh->f_split_coll_req); + ret = mca_common_ompio_file_iwrite_at_all(sh->sharedfh,offset,buf,count,datatype,&fh->f_split_coll_req); fh->f_split_coll_in_use = true; exit: diff --git a/ompi/mca/sharedfp/addproc/sharedfp_addproc_read.c b/ompi/mca/sharedfp/addproc/sharedfp_addproc_read.c index 37d78f01f8..37bfc31ded 100644 --- a/ompi/mca/sharedfp/addproc/sharedfp_addproc_read.c +++ b/ompi/mca/sharedfp/addproc/sharedfp_addproc_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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -62,7 +62,7 @@ int mca_sharedfp_addproc_read ( mca_io_ompio_file_t *fh, "mca_sharedfp_addproc_read: Offset received is %lld\n",offset); } /* Read from the file */ - ret = ompio_io_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status); } return ret; @@ -172,7 +172,7 @@ int mca_sharedfp_addproc_read_ordered (mca_io_ompio_file_t *fh, } /* read from the file */ - ret = ompio_io_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status); exit: if ( NULL != buff ) { diff --git a/ompi/mca/sharedfp/addproc/sharedfp_addproc_write.c b/ompi/mca/sharedfp/addproc/sharedfp_addproc_write.c index e4fe7ff154..03d6db839e 100644 --- a/ompi/mca/sharedfp/addproc/sharedfp_addproc_write.c +++ b/ompi/mca/sharedfp/addproc/sharedfp_addproc_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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -65,7 +65,7 @@ int mca_sharedfp_addproc_write (mca_io_ompio_file_t *fh, "sharedfp_addproc_write: Offset received is %lld\n",offset); } /* Write to the file */ - ret = ompio_io_ompio_file_write_at(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_write_at(sh->sharedfh,offset,buf,count,datatype,status); } return ret; @@ -173,7 +173,7 @@ int mca_sharedfp_addproc_write_ordered (mca_io_ompio_file_t *fh, } /* write to the file */ - ret = ompio_io_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status); exit: if ( NULL != buff ) { diff --git a/ompi/mca/sharedfp/base/sharedfp_base_file_select.c b/ompi/mca/sharedfp/base/sharedfp_base_file_select.c index 9bc9c275c4..e295af2db9 100644 --- a/ompi/mca/sharedfp/base/sharedfp_base_file_select.c +++ b/ompi/mca/sharedfp/base/sharedfp_base_file_select.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-2013 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2012-2013 Los Alamos National Security, Inc. All rights reserved. * $COPYRIGHT$ * @@ -28,7 +28,7 @@ #include "opal/mca/base/base.h" #include "ompi/mca/sharedfp/sharedfp.h" #include "ompi/mca/sharedfp/base/base.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" /* * This structure is needed so that we can close the modules diff --git a/ompi/mca/sharedfp/base/sharedfp_base_file_unselect.c b/ompi/mca/sharedfp/base/sharedfp_base_file_unselect.c index 8d799ccefa..3c341fe09d 100644 --- a/ompi/mca/sharedfp/base/sharedfp_base_file_unselect.c +++ b/ompi/mca/sharedfp/base/sharedfp_base_file_unselect.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-2011 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -24,13 +24,14 @@ #include #include "mpi.h" -#include "ompi/mca/io/ompio/io_ompio.h" #include "opal/util/show_help.h" #include "ompi/mca/mca.h" #include "opal/mca/base/base.h" #include "ompi/mca/sharedfp/sharedfp.h" #include "ompi/mca/sharedfp/base/base.h" +#include "ompi/mca/common/ompio/common_ompio.h" + int mca_sharedfp_base_file_unselect(mca_io_ompio_file_t *file) { if (NULL != file->f_sharedfp && NULL != file->f_sharedfp->sharedfp_module_finalize) { diff --git a/ompi/mca/sharedfp/individual/sharedfp_individual.h b/ompi/mca/sharedfp/individual/sharedfp_individual.h index 8c0516897a..b5f0d5e5be 100644 --- a/ompi/mca/sharedfp/individual/sharedfp_individual.h +++ b/ompi/mca/sharedfp/individual/sharedfp_individual.h @@ -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) 2013 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -25,7 +25,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/sharedfp/sharedfp.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" BEGIN_C_DECLS diff --git a/ompi/mca/sharedfp/individual/sharedfp_individual_collaborate_data.c b/ompi/mca/sharedfp/individual/sharedfp_individual_collaborate_data.c index 024a7edd0f..d91351272f 100644 --- a/ompi/mca/sharedfp/individual/sharedfp_individual_collaborate_data.c +++ b/ompi/mca/sharedfp/individual/sharedfp_individual_collaborate_data.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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -25,6 +25,7 @@ #include "ompi/constants.h" #include "ompi/mca/sharedfp/sharedfp.h" #include "ompi/mca/sharedfp/base/base.h" +#include "ompi/mca/common/ompio/common_ompio.h" #include "ompi/mca/io/ompio/io_ompio.h" #include @@ -175,7 +176,7 @@ int mca_sharedfp_individual_collaborate_data(struct mca_sharedfp_base_data_t *sh } /*Read from the local data file*/ - ompio_io_ompio_file_read_at ( headnode->datafilehandle, + mca_common_ompio_file_read_at ( headnode->datafilehandle, local_off[i], buff, ind_recordlength[i], MPI_BYTE, &status); @@ -188,7 +189,7 @@ int mca_sharedfp_individual_collaborate_data(struct mca_sharedfp_base_data_t *sh } /*Write into main data file*/ - ompio_io_ompio_file_write_at( sh->sharedfh, offsetbuff[idx], buff, + mca_common_ompio_file_write_at( sh->sharedfh, offsetbuff[idx], buff, ind_recordlength[i], MPI_BYTE, &status); } @@ -275,7 +276,7 @@ int mca_sharedfp_individual_get_timestamps_and_reclengths ( double **buff, long ctr = 0; for (i = 0; i < headnode->numofrecordsonfile ; i++) { - ompio_io_ompio_file_read_at(headnode->metadatafilehandle,metaoffset, &rec, 32, MPI_BYTE,&status); + mca_common_ompio_file_read_at(headnode->metadatafilehandle,metaoffset, &rec, 32, MPI_BYTE,&status); *(*rec_length + ctr) = rec.recordlength; *(*buff + ctr) = rec.timestamp; diff --git a/ompi/mca/sharedfp/individual/sharedfp_individual_insert_metadata.c b/ompi/mca/sharedfp/individual/sharedfp_individual_insert_metadata.c index 191c4e1bf3..2012899dca 100644 --- a/ompi/mca/sharedfp/individual/sharedfp_individual_insert_metadata.c +++ b/ompi/mca/sharedfp/individual/sharedfp_individual_insert_metadata.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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -133,9 +133,9 @@ int mca_sharedfp_individual_write_metadata_file(struct mca_sharedfp_base_data_t /*Write to the metadata file*/ - ret = ompio_io_ompio_file_write_at ( (headnode)->metadatafilehandle, - (headnode)->metadatafile_offset, - &buff,32, MPI_BYTE, &status); + ret = mca_common_ompio_file_write_at ( (headnode)->metadatafilehandle, + (headnode)->metadatafile_offset, + &buff,32, MPI_BYTE, &status); if ( OMPI_SUCCESS != ret ) { goto exit; } diff --git a/ompi/mca/sharedfp/individual/sharedfp_individual_iwrite.c b/ompi/mca/sharedfp/individual/sharedfp_individual_iwrite.c index 223d6703d4..efb7d605b3 100644 --- a/ompi/mca/sharedfp/individual/sharedfp_individual_iwrite.c +++ b/ompi/mca/sharedfp/individual/sharedfp_individual_iwrite.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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -76,8 +76,8 @@ int mca_sharedfp_individual_iwrite(mca_io_ompio_file_t *fh, /*Write the data into individual file*/ - ret = ompio_io_ompio_file_iwrite_at ( headnode->datafilehandle, headnode->datafile_offset, - buf, count, datatype, request); + ret = mca_common_ompio_file_iwrite_at ( headnode->datafilehandle, headnode->datafile_offset, + buf, count, datatype, request); if ( OMPI_SUCCESS != ret ) { opal_output(0,"sharedfp_individual_iwrite: Error while iwriting the datafile \n"); return ret; @@ -189,7 +189,7 @@ int mca_sharedfp_individual_write_ordered_begin(mca_io_ompio_file_t *fh, } ret = sh->comm->c_coll.coll_bcast ( &global_offset, 1, OMPI_OFFSET_DATATYPE, - 0, sh->comm, sh->comm->c_coll.coll_bcast_module ); + 0, sh->comm, sh->comm->c_coll.coll_bcast_module ); if ( OMPI_SUCCESS != ret ) { opal_output(0,"sharedfp_individual_write_ordered_begin: Error while bcasting global offset \n"); goto exit; @@ -198,8 +198,8 @@ int mca_sharedfp_individual_write_ordered_begin(mca_io_ompio_file_t *fh, sh->global_offset = global_offset; /*use file_write_at_all to ensure the order*/ - ret = ompio_io_ompio_file_iwrite_at_all(sh->sharedfh,offset, buf,count,datatype, - &fh->f_split_coll_req); + ret = mca_common_ompio_file_iwrite_at_all(sh->sharedfh,offset, buf,count,datatype, + &fh->f_split_coll_req); fh->f_split_coll_in_use = true; if ( OMPI_SUCCESS != ret ) { opal_output(0,"sharedfp_individual_write_ordered_begin: Error while writing the datafile \n"); diff --git a/ompi/mca/sharedfp/individual/sharedfp_individual_write.c b/ompi/mca/sharedfp/individual/sharedfp_individual_write.c index 6f921f4656..f394fd8c7e 100644 --- a/ompi/mca/sharedfp/individual/sharedfp_individual_write.c +++ b/ompi/mca/sharedfp/individual/sharedfp_individual_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) 2013 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -71,9 +71,9 @@ int mca_sharedfp_individual_write (mca_io_ompio_file_t *fh, mca_sharedfp_individual_insert_metadata(OMPI_FILE_WRITE_SHARED, totalbytes, sh); /*Write the data into individual file*/ - ret = ompio_io_ompio_file_write_at ( headnode->datafilehandle, - headnode->datafile_offset, - buf, count, datatype, status); + ret = mca_common_ompio_file_write_at ( headnode->datafilehandle, + headnode->datafile_offset, + buf, count, datatype, status); if ( OMPI_SUCCESS != ret ) { opal_output(0,"mca_sharedfp_individual_write: Error while writing the datafile \n"); return -1; @@ -191,7 +191,7 @@ int mca_sharedfp_individual_write_ordered (mca_io_ompio_file_t *fh, sh->global_offset = global_offset; /*use file_write_at_all to ensure the order*/ - ret = ompio_io_ompio_file_write_at_all(sh->sharedfh,offset, buf,count,datatype,status); + ret = mca_common_ompio_file_write_at_all(sh->sharedfh,offset, buf,count,datatype,status); if ( OMPI_SUCCESS != ret ) { opal_output(0,"sharedfp_individual_write_ordered: Error while writing the datafile \n"); } diff --git a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile.h b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile.h index 2774ef5ee6..0e1faa3584 100644 --- a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile.h +++ b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile.h @@ -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) 2013 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -25,7 +25,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/sharedfp/sharedfp.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" BEGIN_C_DECLS diff --git a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_iread.c b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_iread.c index 70df7914f6..fa5dd25f9e 100644 --- a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_iread.c +++ b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_iread.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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -82,7 +82,7 @@ int mca_sharedfp_lockedfile_iread(mca_io_ompio_file_t *fh, } /* Read the file */ - ret = ompio_io_ompio_file_iread_at(sh->sharedfh,offset,buf,count,datatype,request); + ret = mca_common_ompio_file_iread_at(sh->sharedfh,offset,buf,count,datatype,request); } return ret; @@ -205,7 +205,7 @@ int mca_sharedfp_lockedfile_read_ordered_begin(mca_io_ompio_file_t *fh, "sharedfp_lockedfile_read_ordered_begin: Offset returned is %lld\n",offset); } - ret = ompio_io_ompio_file_iread_at_all ( sh->sharedfh, offset, buf, count, datatype, &fh->f_split_coll_req ); + ret = mca_common_ompio_file_iread_at_all ( sh->sharedfh, offset, buf, count, datatype, &fh->f_split_coll_req ); fh->f_split_coll_in_use = true; exit: diff --git a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_iwrite.c b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_iwrite.c index c12f60f6a6..82a464344f 100644 --- a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_iwrite.c +++ b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_iwrite.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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -82,7 +82,7 @@ int mca_sharedfp_lockedfile_iwrite(mca_io_ompio_file_t *fh, } /* Write to the file */ - ret = ompio_io_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request); + ret = mca_common_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request); } return ret; @@ -204,7 +204,7 @@ int mca_sharedfp_lockedfile_write_ordered_begin(mca_io_ompio_file_t *fh, "sharedfp_lockedfile_write_ordered_begin: Offset returned is %lld\n",offset); } - ret = ompio_io_ompio_file_iwrite_at_all ( sh->sharedfh, offset, buf, count, datatype, &fh->f_split_coll_req ); + ret = mca_common_ompio_file_iwrite_at_all ( sh->sharedfh, offset, buf, count, datatype, &fh->f_split_coll_req ); fh->f_split_coll_in_use = true; exit: diff --git a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_read.c b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_read.c index cd7df48e57..58f502cce1 100644 --- a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_read.c +++ b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -77,7 +77,7 @@ int mca_sharedfp_lockedfile_read ( mca_io_ompio_file_t *fh, } /* Read the file */ - ret = ompio_io_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status); } return ret; @@ -192,7 +192,7 @@ int mca_sharedfp_lockedfile_read_ordered (mca_io_ompio_file_t *fh, } /* read to the file */ - ret = ompio_io_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status); exit: if ( NULL != buff ) { diff --git a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_write.c b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_write.c index eb44cefb9a..7a4beb6c28 100644 --- a/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_write.c +++ b/ompi/mca/sharedfp/lockedfile/sharedfp_lockedfile_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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -80,7 +80,7 @@ int mca_sharedfp_lockedfile_write (mca_io_ompio_file_t *fh, "sharedfp_lockedfile_write: Offset received is %lld\n",offset); } /* Write to the file */ - ret = ompio_io_ompio_file_write_at ( sh->sharedfh, offset, buf, count, datatype, status); + ret = mca_common_ompio_file_write_at ( sh->sharedfh, offset, buf, count, datatype, status); } return ret; @@ -199,7 +199,7 @@ int mca_sharedfp_lockedfile_write_ordered (mca_io_ompio_file_t *fh, } /* write to the file */ - ret = ompio_io_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status); exit: if ( NULL != buff ) { diff --git a/ompi/mca/sharedfp/sm/sharedfp_sm.h b/ompi/mca/sharedfp/sm/sharedfp_sm.h index 4f62e2997b..b10bbcf141 100644 --- a/ompi/mca/sharedfp/sm/sharedfp_sm.h +++ b/ompi/mca/sharedfp/sm/sharedfp_sm.h @@ -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-2015 University of Houston. All rights reserved. + * Copyright (c) 2008-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Cisco Systems, Inc. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. @@ -26,7 +26,7 @@ #include "ompi_config.h" #include "ompi/mca/mca.h" #include "ompi/mca/sharedfp/sharedfp.h" -#include "ompi/mca/io/ompio/io_ompio.h" +#include "ompi/mca/common/ompio/common_ompio.h" #include BEGIN_C_DECLS diff --git a/ompi/mca/sharedfp/sm/sharedfp_sm_iread.c b/ompi/mca/sharedfp/sm/sharedfp_sm_iread.c index 17652cfa87..7ecc657768 100644 --- a/ompi/mca/sharedfp/sm/sharedfp_sm_iread.c +++ b/ompi/mca/sharedfp/sm/sharedfp_sm_iread.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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -78,7 +78,7 @@ int mca_sharedfp_sm_iread(mca_io_ompio_file_t *fh, "sharedfp_sm_iread: Offset received is %lld\n",offset); } /* Read the file */ - ret = ompio_io_ompio_file_iread_at(sh->sharedfh,offset,buf,count,datatype,request); + ret = mca_common_ompio_file_iread_at(sh->sharedfh,offset,buf,count,datatype,request); } return ret; @@ -202,7 +202,7 @@ int mca_sharedfp_sm_read_ordered_begin(mca_io_ompio_file_t *fh, } /* read to the file */ - ret = ompio_io_ompio_file_iread_at_all(sh->sharedfh,offset,buf,count,datatype, + ret = mca_common_ompio_file_iread_at_all(sh->sharedfh,offset,buf,count,datatype, &fh->f_split_coll_req); fh->f_split_coll_in_use = true; diff --git a/ompi/mca/sharedfp/sm/sharedfp_sm_iwrite.c b/ompi/mca/sharedfp/sm/sharedfp_sm_iwrite.c index 6527c888c7..6a5f8289ce 100644 --- a/ompi/mca/sharedfp/sm/sharedfp_sm_iwrite.c +++ b/ompi/mca/sharedfp/sm/sharedfp_sm_iwrite.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) 2013 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -80,7 +80,7 @@ int mca_sharedfp_sm_iwrite(mca_io_ompio_file_t *fh, "sharedfp_sm_iwrite: Offset received is %lld\n",offset); } /* Write to the file */ - ret = ompio_io_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request); + ret = mca_common_ompio_file_iwrite_at(sh->sharedfh,offset,buf,count,datatype,request); } return ret; @@ -205,7 +205,7 @@ int mca_sharedfp_sm_write_ordered_begin(mca_io_ompio_file_t *fh, } /* read to the file */ - ret = ompio_io_ompio_file_iwrite_at_all(sh->sharedfh,offset,buf,count,datatype, + ret = mca_common_ompio_file_iwrite_at_all(sh->sharedfh,offset,buf,count,datatype, &fh->f_split_coll_req); fh->f_split_coll_in_use = true; diff --git a/ompi/mca/sharedfp/sm/sharedfp_sm_read.c b/ompi/mca/sharedfp/sm/sharedfp_sm_read.c index 8f2cd77426..4c14e1a542 100644 --- a/ompi/mca/sharedfp/sm/sharedfp_sm_read.c +++ b/ompi/mca/sharedfp/sm/sharedfp_sm_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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -77,7 +77,7 @@ int mca_sharedfp_sm_read ( mca_io_ompio_file_t *fh, } /* Read the file */ - ret = ompio_io_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_read_at(sh->sharedfh,offset,buf,count,datatype,status); } return ret; @@ -195,7 +195,7 @@ int mca_sharedfp_sm_read_ordered (mca_io_ompio_file_t *fh, } /* read to the file */ - ret = ompio_io_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_read_at_all(sh->sharedfh,offset,buf,count,datatype,status); exit: if ( NULL != buff ) { diff --git a/ompi/mca/sharedfp/sm/sharedfp_sm_write.c b/ompi/mca/sharedfp/sm/sharedfp_sm_write.c index fd0ffab678..ac5bd800cb 100644 --- a/ompi/mca/sharedfp/sm/sharedfp_sm_write.c +++ b/ompi/mca/sharedfp/sm/sharedfp_sm_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) 2013-2015 University of Houston. All rights reserved. + * Copyright (c) 2013-2016 University of Houston. All rights reserved. * Copyright (c) 2015 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ @@ -81,7 +81,7 @@ int mca_sharedfp_sm_write (mca_io_ompio_file_t *fh, } /* Write to the file*/ - ret = ompio_io_ompio_file_write_at(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_write_at(sh->sharedfh,offset,buf,count,datatype,status); } return ret; @@ -202,7 +202,7 @@ int mca_sharedfp_sm_write_ordered (mca_io_ompio_file_t *fh, "sharedfp_sm_write_ordered: Offset returned is %lld\n",offset); } /* write to the file */ - ret = ompio_io_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status); + ret = mca_common_ompio_file_write_at_all(sh->sharedfh,offset,buf,count,datatype,status); exit: if ( NULL != buff ) {