- first cut on the io interface changes
- add the C interfaces for the new non-blocking collective I/O functions of MPI 3.1
Этот коммит содержится в:
родитель
c0e0510db4
Коммит
f2af8e94ff
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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 \
|
||||
|
84
ompi/mpi/c/file_iread_all.c
Обычный файл
84
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);
|
||||
}
|
86
ompi/mpi/c/file_iread_at_all.c
Обычный файл
86
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);
|
||||
}
|
89
ompi/mpi/c/file_iwrite_all.c
Обычный файл
89
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);
|
||||
}
|
92
ompi/mpi/c/file_iwrite_at_all.c
Обычный файл
92
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);
|
||||
}
|
Загрузка…
x
Ссылка в новой задаче
Block a user