diff --git a/ompi/include/mpi.h.in b/ompi/include/mpi.h.in index 2a6331fa0e..9b5b4a0f36 100644 --- a/ompi/include/mpi.h.in +++ b/ompi/include/mpi.h.in @@ -16,6 +16,7 @@ * Copyright (c) 2012-2015 Los Alamos National Security, LLC. All rights * reserved. * Copyright (c) 2011-2013 INRIA. All rights reserved. + * Copyright (c) 2015 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -1390,6 +1391,10 @@ OMPI_DECLSPEC int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, + int count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int MPI_File_read_all(MPI_File fh, void *buf, int count, @@ -1402,6 +1407,10 @@ OMPI_DECLSPEC int MPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_iwrite(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iread_all(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int MPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); OMPI_DECLSPEC int MPI_File_get_position(MPI_File fh, MPI_Offset *offset); OMPI_DECLSPEC int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, @@ -2082,6 +2091,10 @@ OMPI_DECLSPEC int PMPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_iwrite_at(MPI_File fh, MPI_Offset offset, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, + int count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_read(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status); OMPI_DECLSPEC int PMPI_File_read_all(MPI_File fh, void *buf, int count, @@ -2094,6 +2107,10 @@ OMPI_DECLSPEC int PMPI_File_iread(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_iwrite(MPI_File fh, const void *buf, int count, MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iread_all(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); +OMPI_DECLSPEC int PMPI_File_iwrite_all(MPI_File fh, const void *buf, int count, + MPI_Datatype datatype, MPI_Request *request); OMPI_DECLSPEC int PMPI_File_seek(MPI_File fh, MPI_Offset offset, int whence); OMPI_DECLSPEC int PMPI_File_get_position(MPI_File fh, MPI_Offset *offset); OMPI_DECLSPEC int PMPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, diff --git a/ompi/mca/io/io.h b/ompi/mca/io/io.h index 08cb1a38ee..2ab40d4460 100644 --- a/ompi/mca/io/io.h +++ b/ompi/mca/io/io.h @@ -13,6 +13,7 @@ * Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2015 University of Houston. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -188,6 +189,15 @@ typedef int (*mca_io_base_module_file_iwrite_at_fn_t) int count, struct ompi_datatype_t *datatype, struct ompi_request_t **request); +typedef int (*mca_io_base_module_file_iread_at_all_fn_t) + (struct ompi_file_t *fh, MPI_Offset offset, void *buf, + int count, struct ompi_datatype_t *datatype, + struct ompi_request_t **request); +typedef int (*mca_io_base_module_file_iwrite_at_all_fn_t) + (struct ompi_file_t *fh, MPI_Offset offset, void *buf, + int count, struct ompi_datatype_t *datatype, + struct ompi_request_t **request); + typedef int (*mca_io_base_module_file_read_fn_t) (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t * datatype, struct ompi_status_public_t *status); @@ -208,6 +218,13 @@ typedef int (*mca_io_base_module_file_iwrite_fn_t) (struct ompi_file_t *fh, void *buf, int count, struct ompi_datatype_t *datatype, struct ompi_request_t **request); +typedef int (*mca_io_base_module_file_iread_all_fn_t) + (struct ompi_file_t *fh, void *buf, int count, + struct ompi_datatype_t *datatype, struct ompi_request_t **request); +typedef int (*mca_io_base_module_file_iwrite_all_fn_t) + (struct ompi_file_t *fh, void *buf, int count, + struct ompi_datatype_t *datatype, struct ompi_request_t **request); + typedef int (*mca_io_base_module_file_seek_fn_t) (struct ompi_file_t *fh, MPI_Offset offset, int whence); typedef int (*mca_io_base_module_file_get_position_fn_t) @@ -301,8 +318,10 @@ struct mca_io_base_module_2_0_0_t { mca_io_base_module_file_write_at_fn_t io_module_file_write_at; mca_io_base_module_file_write_at_all_fn_t io_module_file_write_at_all; - mca_io_base_module_file_iread_at_fn_t io_module_file_iread_at; - mca_io_base_module_file_iwrite_at_fn_t io_module_file_iwrite_at; + mca_io_base_module_file_iread_at_fn_t io_module_file_iread_at; + mca_io_base_module_file_iwrite_at_fn_t io_module_file_iwrite_at; + mca_io_base_module_file_iread_at_all_fn_t io_module_file_iread_at_all; + mca_io_base_module_file_iwrite_at_all_fn_t io_module_file_iwrite_at_all; mca_io_base_module_file_read_fn_t io_module_file_read; mca_io_base_module_file_read_all_fn_t io_module_file_read_all; @@ -311,6 +330,8 @@ struct mca_io_base_module_2_0_0_t { mca_io_base_module_file_iread_fn_t io_module_file_iread; mca_io_base_module_file_iwrite_fn_t io_module_file_iwrite; + mca_io_base_module_file_iread_all_fn_t io_module_file_iread_all; + mca_io_base_module_file_iwrite_all_fn_t io_module_file_iwrite_all; mca_io_base_module_file_seek_fn_t io_module_file_seek; mca_io_base_module_file_get_position_fn_t io_module_file_get_position; diff --git a/ompi/mca/io/ompio/io_ompio_module.c b/ompi/mca/io/ompio/io_ompio_module.c index 1b6b0f1b92..cbdaf2e0dd 100644 --- a/ompi/mca/io/ompio/io_ompio_module.c +++ b/ompi/mca/io/ompio/io_ompio_module.c @@ -49,6 +49,8 @@ mca_io_base_module_2_0_0_t mca_io_ompio_module = { mca_io_ompio_file_iread_at, mca_io_ompio_file_iwrite_at, + mca_io_ompio_file_iread_at_all, + mca_io_ompio_file_iwrite_at_all, /* non-indexed IO operations */ mca_io_ompio_file_read, @@ -58,6 +60,8 @@ mca_io_base_module_2_0_0_t mca_io_ompio_module = { mca_io_ompio_file_iread, mca_io_ompio_file_iwrite, + mca_io_ompio_file_iread_all, + mca_io_ompio_file_iwrite_all, mca_io_ompio_file_seek, mca_io_ompio_file_get_position, diff --git a/ompi/mca/io/romio314/src/io_romio314_module.c b/ompi/mca/io/romio314/src/io_romio314_module.c index cb46168ae4..3a40046cbd 100644 --- a/ompi/mca/io/romio314/src/io_romio314_module.c +++ b/ompi/mca/io/romio314/src/io_romio314_module.c @@ -59,6 +59,8 @@ mca_io_base_module_2_0_0_t mca_io_romio314_module = { mca_io_romio314_file_write_at_all, mca_io_romio314_file_iread_at, mca_io_romio314_file_iwrite_at, + NULL, /* iread_at_all */ + NULL, /* iwrite_at_all */ /* non-indexed IO operations */ mca_io_romio314_file_read, @@ -67,6 +69,8 @@ mca_io_base_module_2_0_0_t mca_io_romio314_module = { mca_io_romio314_file_write_all, mca_io_romio314_file_iread, mca_io_romio314_file_iwrite, + NULL, /* iread_all */ + NULL, /* iwrite_all */ mca_io_romio314_file_seek, mca_io_romio314_file_get_position, diff --git a/ompi/mpi/c/Makefile.am b/ompi/mpi/c/Makefile.am index d3e47a69d0..8d533a678f 100644 --- a/ompi/mpi/c/Makefile.am +++ b/ompi/mpi/c/Makefile.am @@ -406,10 +406,14 @@ libmpi_c_mpi_la_SOURCES += \ file_get_type_extent.c \ file_get_view.c \ file_iread_at.c \ + file_iread_at_all.c \ file_iread.c \ + file_iread_all.c \ file_iread_shared.c \ file_iwrite_at.c \ + file_iwrite_at_all.c \ file_iwrite.c \ + file_iwrite_all.c \ file_iwrite_shared.c \ file_open.c \ file_preallocate.c \ diff --git a/ompi/mpi/c/file_iread_all.c b/ompi/mpi/c/file_iread_all.c new file mode 100644 index 0000000000..76d0c7198e --- /dev/null +++ b/ompi/mpi/c/file_iread_all.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 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 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2015 University of Houston. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/c/bindings.h" +#include "ompi/runtime/params.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/file/file.h" +#include "ompi/mca/io/io.h" +#include "ompi/mca/io/base/io_base_request.h" +#include "ompi/memchecker.h" + +#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES +#pragma weak MPI_File_iread_all = PMPI_File_iread_all +#endif + +#if OMPI_PROFILING_DEFINES +#include "ompi/mpi/c/profile/defines.h" +#endif + +static const char FUNC_NAME[] = "MPI_File_iread_all"; + + +int MPI_File_iread_all(MPI_File fh, void *buf, int count, + MPI_Datatype datatype, MPI_Request *request) +{ + int rc; + + MEMCHECKER( + memchecker_datatype(datatype); + ); + + if (MPI_PARAM_CHECK) { + rc = MPI_SUCCESS; + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_file_invalid(fh)) { + fh = MPI_FILE_NULL; + rc = MPI_ERR_FILE; + } else if (count < 0) { + rc = MPI_ERR_COUNT; + } else if (NULL == request) { + rc = MPI_ERR_REQUEST; + } else { + OMPI_CHECK_DATATYPE_FOR_RECV(rc, datatype, count); + } + OMPI_ERRHANDLER_CHECK(rc, fh, rc, FUNC_NAME); + } + + OPAL_CR_ENTER_LIBRARY(); + + /* Call the back-end io component function */ + switch (fh->f_io_version) { + case MCA_IO_BASE_V_2_0_0: + rc = fh->f_io_selected_module.v2_0_0. + io_module_file_iread_all(fh, buf, count, datatype, request); + break; + + default: + rc = MPI_ERR_INTERN; + break; + } + + /* All done */ + OMPI_ERRHANDLER_RETURN(rc, fh, rc, FUNC_NAME); +} diff --git a/ompi/mpi/c/file_iread_at_all.c b/ompi/mpi/c/file_iread_at_all.c new file mode 100644 index 0000000000..8ec0adbbca --- /dev/null +++ b/ompi/mpi/c/file_iread_at_all.c @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 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 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2015 University of Houston. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/c/bindings.h" +#include "ompi/runtime/params.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/file/file.h" +#include "ompi/mca/io/io.h" +#include "ompi/mca/io/base/io_base_request.h" +#include "ompi/memchecker.h" + +#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES +#pragma weak MPI_File_iread_at_all = PMPI_File_iread_at_all +#endif + +#if OMPI_PROFILING_DEFINES +#include "ompi/mpi/c/profile/defines.h" +#endif + +static const char FUNC_NAME[] = "MPI_File_iread_at_all"; + + +int MPI_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, + int count, MPI_Datatype datatype, MPI_Request *request) +{ + int rc; + + MEMCHECKER( + memchecker_datatype(datatype); + ); + + if (MPI_PARAM_CHECK) { + rc = MPI_SUCCESS; + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_file_invalid(fh)) { + fh = MPI_FILE_NULL; + rc = MPI_ERR_FILE; + } else if (count < 0) { + rc = MPI_ERR_COUNT; + } else if (NULL == request) { + rc = MPI_ERR_REQUEST; + } else { + OMPI_CHECK_DATATYPE_FOR_RECV(rc, datatype, count); + } + OMPI_ERRHANDLER_CHECK(rc, fh, rc, FUNC_NAME); + } + + OPAL_CR_ENTER_LIBRARY(); + + /* Call the back-end io component function */ + switch (fh->f_io_version) { + case MCA_IO_BASE_V_2_0_0: + rc = fh->f_io_selected_module.v2_0_0. + io_module_file_iread_at_all(fh, offset, buf, count, datatype, + request); + break; + + default: + rc = MPI_ERR_INTERN; + break; + } + + /* All done */ + + OMPI_ERRHANDLER_RETURN(rc, fh, rc, FUNC_NAME); +} diff --git a/ompi/mpi/c/file_iwrite_all.c b/ompi/mpi/c/file_iwrite_all.c new file mode 100644 index 0000000000..8022b28223 --- /dev/null +++ b/ompi/mpi/c/file_iwrite_all.c @@ -0,0 +1,89 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 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 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 University of Houston. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/c/bindings.h" +#include "ompi/runtime/params.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/file/file.h" +#include "ompi/mca/io/io.h" +#include "ompi/mca/io/base/io_base_request.h" +#include "ompi/memchecker.h" + +#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES +#pragma weak MPI_File_iwrite_all = PMPI_File_iwrite_all +#endif + +#if OMPI_PROFILING_DEFINES +#include "ompi/mpi/c/profile/defines.h" +#endif + +static const char FUNC_NAME[] = "MPI_File_iwrite_all"; + + +int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype + datatype, MPI_Request *request) +{ + int rc; + + MEMCHECKER( + memchecker_datatype(datatype); + memchecker_call(&opal_memchecker_base_isdefined, buf, count, datatype); + ); + + if (MPI_PARAM_CHECK) { + rc = MPI_SUCCESS; + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_file_invalid(fh)) { + fh = MPI_FILE_NULL; + rc = MPI_ERR_FILE; + } else if (count < 0) { + rc = MPI_ERR_COUNT; + } else if (NULL == request) { + rc = MPI_ERR_REQUEST; + } else { + OMPI_CHECK_DATATYPE_FOR_SEND(rc, datatype, count); + } + OMPI_ERRHANDLER_CHECK(rc, fh, rc, FUNC_NAME); + } + + OPAL_CR_ENTER_LIBRARY(); + + /* Call the back-end io component function */ + switch (fh->f_io_version) { + case MCA_IO_BASE_V_2_0_0: + /* XXX -- CONST -- do not cast away const -- update mca/io */ + rc = fh->f_io_selected_module.v2_0_0. + io_module_file_iwrite_all(fh, (void *) buf, count, datatype, request); + break; + + default: + rc = MPI_ERR_INTERN; + break; + } + + /* All done */ + OMPI_ERRHANDLER_RETURN(rc, fh, rc, FUNC_NAME); +} diff --git a/ompi/mpi/c/file_iwrite_at_all.c b/ompi/mpi/c/file_iwrite_at_all.c new file mode 100644 index 0000000000..21fc0affee --- /dev/null +++ b/ompi/mpi/c/file_iwrite_at_all.c @@ -0,0 +1,92 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ +/* + * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2005 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2008 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 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2013 Los Alamos National Security, LLC. All rights + * reserved. + * Copyright (c) 2015 University of Houston. All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "ompi_config.h" + +#include "ompi/mpi/c/bindings.h" +#include "ompi/runtime/params.h" +#include "ompi/errhandler/errhandler.h" +#include "ompi/datatype/ompi_datatype.h" +#include "ompi/file/file.h" +#include "ompi/mca/io/io.h" +#include "ompi/mca/io/base/io_base_request.h" +#include "ompi/memchecker.h" + +#if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES +#pragma weak MPI_File_iwrite_at_all = PMPI_File_iwrite_at_all +#endif + +#if OMPI_PROFILING_DEFINES +#include "ompi/mpi/c/profile/defines.h" +#endif + +static const char FUNC_NAME[] = "MPI_File_iwrite_at_all"; + + +int MPI_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, + int count, MPI_Datatype datatype, + MPI_Request *request) +{ + int rc; + + MEMCHECKER( + memchecker_datatype(datatype); + memchecker_call(&opal_memchecker_base_isdefined, buf, count, datatype); + ); + + if (MPI_PARAM_CHECK) { + rc = MPI_SUCCESS; + OMPI_ERR_INIT_FINALIZE(FUNC_NAME); + if (ompi_file_invalid(fh)) { + fh = MPI_FILE_NULL; + rc = MPI_ERR_FILE; + } else if (count < 0) { + rc = MPI_ERR_COUNT; + } else if (NULL == request) { + rc = MPI_ERR_REQUEST; + } else { + OMPI_CHECK_DATATYPE_FOR_SEND(rc, datatype, count); + } + OMPI_ERRHANDLER_CHECK(rc, fh, rc, FUNC_NAME); + } + + OPAL_CR_ENTER_LIBRARY(); + + /* Call the back-end io component function */ + switch (fh->f_io_version) { + case MCA_IO_BASE_V_2_0_0: + /* XXX -- CONST -- do not cast away const -- update mca/io */ + rc = fh->f_io_selected_module.v2_0_0. + io_module_file_iwrite_at_all(fh, offset, (void *) buf, count, datatype, + request); + break; + + default: + rc = MPI_ERR_INTERN; + break; + } + + /* All done */ + + OMPI_ERRHANDLER_RETURN(rc, fh, rc, FUNC_NAME); +}