Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions ompi/include/mpi.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1385,6 +1386,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,
Expand All @@ -1397,6 +1402,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,
Expand Down Expand Up @@ -2077,6 +2086,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,
Expand All @@ -2089,6 +2102,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,
Expand Down
31 changes: 26 additions & 5 deletions ompi/mca/io/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -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)
Expand Down Expand Up @@ -300,18 +317,22 @@ struct mca_io_base_module_2_0_0_t {
mca_io_base_module_file_read_at_all_fn_t io_module_file_read_at_all;
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;
mca_io_base_module_file_write_fn_t io_module_file_write;
mca_io_base_module_file_write_all_fn_t io_module_file_write_all;

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;
mca_io_base_module_file_get_byte_offset_fn_t io_module_file_get_byte_offset;
Expand Down
4 changes: 4 additions & 0 deletions ompi/mca/io/ompio/io_ompio_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions ompi/mca/io/romio314/src/io_romio314_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions ompi/mpi/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
84 changes: 84 additions & 0 deletions ompi/mpi/c/file_iread_all.c
Original file line number Diff line number Diff line change
@@ -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);
}
86 changes: 86 additions & 0 deletions ompi/mpi/c/file_iread_at_all.c
Original file line number Diff line number Diff line change
@@ -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);
}
Loading