Commit c26c6627 authored by Sangmin Seo's avatar Sangmin Seo Committed by Rob Latham
Browse files

Add nonblocking collective I/O functions.

This patch implemented four functions for nonblocking collective I/O,
which will be added to MPI 3.1 standard. Details for these functions
can be found in the MPI-Forum ticket,
https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/273

.
Currently, they are implemented as MPIX functions.
Signed-off-by: Rob Latham's avatarRob Latham <robl@mcs.anl.gov>
parent f0f2c00a
This diff is collapsed.
......@@ -39,7 +39,7 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node
ADIOI_Access *others_req,
int iter,
MPI_Aint buftype_extent, int *buf_idx);
static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
*flat_buf, char **recv_buf, ADIO_Offset
*offset_list, ADIO_Offset *len_list,
unsigned *recv_size,
......@@ -954,7 +954,7 @@ static void ADIOI_R_Exchange_data(ADIO_File fd, void *buf, ADIOI_Flatlist_node
ADIOI_BUF_INCR \
}
static void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
void ADIOI_Fill_user_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
*flat_buf, char **recv_buf, ADIO_Offset
*offset_list, ADIO_Offset *len_list,
unsigned *recv_size,
......
......@@ -35,7 +35,7 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf,
int *send_buf_idx, int *curr_to_proc,
int *done_to_proc, int *hole, int iter,
MPI_Aint buftype_extent, int *buf_idx, int *error_code);
static void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
*flat_buf, char **send_buf, ADIO_Offset
*offset_list, ADIO_Offset *len_list, int *send_size,
MPI_Request *requests, int *sent_to_proc,
......@@ -860,7 +860,7 @@ static void ADIOI_W_Exchange_data(ADIO_File fd, void *buf, char *write_buf,
static void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
void ADIOI_Fill_send_buffer(ADIO_File fd, void *buf, ADIOI_Flatlist_node
*flat_buf, char **send_buf, ADIO_Offset
*offset_list, ADIO_Offset *len_list, int *send_size,
MPI_Request *requests, int *sent_to_proc,
......
......@@ -398,6 +398,14 @@ void ADIO_IwriteStrided(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Request *request, int
*error_code);
void ADIO_IreadStridedColl(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Request *request,
int *error_code);
void ADIO_IwriteStridedColl(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Request *request,
int *error_code);
ADIO_Offset ADIO_SeekIndividual(ADIO_File fd, ADIO_Offset offset,
int whence, int *error_code);
void ADIO_Delete(char *filename, int *error_code);
......
......@@ -197,6 +197,12 @@ struct ADIOI_Fns_struct {
void (*ADIOI_xxx_Delete) (const char *filename, int *error_code);
int (*ADIOI_xxx_Feature) (ADIO_File fd, int flag);
const char *fsname;
void (*ADIOI_xxx_IreadStridedColl) (ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Request *request, int *error_code);
void (*ADIOI_xxx_IwriteStridedColl) (ADIO_File fd, const void *buf,
int count, MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Request *request, int *error_code);
};
/* optypes for ADIO_RequestD */
......@@ -287,6 +293,12 @@ struct ADIOI_Fns_struct {
#define ADIO_IwriteStrided(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \
(*(fd->fns->ADIOI_xxx_IwriteStrided))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code)
#define ADIO_IreadStridedColl(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \
(*(fd->fns->ADIOI_xxx_IreadStridedColl))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code)
#define ADIO_IwriteStridedColl(fd,buf,count,datatype,file_ptr_type,offset,request,error_code) \
(*(fd->fns->ADIOI_xxx_IwriteStridedColl))(fd,buf,count,datatype,file_ptr_type,offset,request,error_code)
#define ADIO_Flush(fd,error_code) (*(fd->fns->ADIOI_xxx_Flush))(fd,error_code)
#define ADIO_Resize(fd,size,error_code) \
......@@ -417,10 +429,18 @@ void ADIOI_GEN_ReadStridedColl(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Status *status, int
*error_code);
void ADIOI_GEN_IreadStridedColl(ADIO_File fd, void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, MPI_Request *request,
int *error_code);
void ADIOI_GEN_WriteStridedColl(ADIO_File fd, const void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, ADIO_Status *status, int
*error_code);
void ADIOI_GEN_IwriteStridedColl(ADIO_File fd, const void *buf, int count,
MPI_Datatype datatype, int file_ptr_type,
ADIO_Offset offset, MPI_Request *request,
int *error_code);
void ADIOI_Calc_my_off_len(ADIO_File fd, int bufcount, MPI_Datatype
datatype, int file_ptr_type, ADIO_Offset
offset, ADIO_Offset **offset_list_ptr, ADIO_Offset
......@@ -458,6 +478,98 @@ void ADIOI_Calc_others_req(ADIO_File fd, int count_my_req_procs,
int *count_others_req_procs_ptr,
ADIOI_Access **others_req_ptr);
/* Nonblocking Collective I/O internals */
typedef enum {
ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL,
ADIOI_IRC_STATE_GEN_IREADSTRIDEDCOLL_INDIO,
ADIOI_IRC_STATE_ICALC_OTHERS_REQ,
ADIOI_IRC_STATE_ICALC_OTHERS_REQ_MAIN,
ADIOI_IRC_STATE_IREAD_AND_EXCH,
ADIOI_IRC_STATE_IREAD_AND_EXCH_L1_BEGIN,
ADIOI_IRC_STATE_R_IEXCHANGE_DATA,
ADIOI_IRC_STATE_R_IEXCHANGE_DATA_RECV,
ADIOI_IRC_STATE_R_IEXCHANGE_DATA_FILL,
ADIOI_IRC_STATE_COMPLETE
} ADIOI_IRC_State;
typedef enum {
ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL,
ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_INDIO,
ADIOI_IWC_STATE_GEN_IWRITESTRIDEDCOLL_BCAST,
ADIOI_IWC_STATE_ICALC_OTHERS_REQ,
ADIOI_IWC_STATE_ICALC_OTHERS_REQ_MAIN,
ADIOI_IWC_STATE_IEXCH_AND_WRITE,
ADIOI_IWC_STATE_IEXCH_AND_WRITE_L1_BODY,
ADIOI_IWC_STATE_W_IEXCHANGE_DATA,
ADIOI_IWC_STATE_W_IEXCHANGE_DATA_HOLE,
ADIOI_IWC_STATE_W_IEXCHANGE_DATA_SEND,
ADIOI_IWC_STATE_W_IEXCHANGE_DATA_WAIT,
ADIOI_IWC_STATE_COMPLETE
} ADIOI_IWC_State;
typedef struct ADIOI_NBC_Request ADIOI_NBC_Request;
typedef struct ADIOI_GEN_IreadStridedColl_vars ADIOI_GEN_IreadStridedColl_vars;
typedef struct ADIOI_Iread_and_exch_vars ADIOI_Iread_and_exch_vars;
typedef struct ADIOI_R_Iexchange_data_vars ADIOI_R_Iexchange_data_vars;
typedef struct ADIOI_GEN_IwriteStridedColl_vars ADIOI_GEN_IwriteStridedColl_vars;
typedef struct ADIOI_Iexch_and_write_vars ADIOI_Iexch_and_write_vars;
typedef struct ADIOI_W_Iexchange_data_vars ADIOI_W_Iexchange_data_vars;
typedef struct ADIOI_Icalc_others_req_vars {
/* requests */
MPI_Request req1;
MPI_Request *req2;
int num_req2;
/* parameters */
ADIO_File fd;
int count_my_req_procs;
int *count_my_req_per_proc;
ADIOI_Access *my_req;
int nprocs;
int myrank;
int *count_others_req_procs_ptr;
ADIOI_Access **others_req_ptr;
/* stack variables */
int *count_others_req_per_proc;
int count_others_req_procs;
ADIOI_Access *others_req;
/* next function to be called */
void (*next_fn)(ADIOI_NBC_Request *, int *);
} ADIOI_Icalc_others_req_vars;
struct ADIOI_NBC_Request {
int rdwr; /* ADIOI_READ or ADIOI_WRITE */
MPI_Request req; /* MPIX_Grequest */
MPI_Count nbytes; /* data read or written */
union {
struct {
ADIOI_IRC_State state; /* progress state */
ADIOI_GEN_IreadStridedColl_vars *rsc_vars;
ADIOI_Iread_and_exch_vars *rae_vars;
ADIOI_R_Iexchange_data_vars *red_vars;
} rd;
struct {
ADIOI_IWC_State state; /* progress state */
ADIOI_GEN_IwriteStridedColl_vars *wsc_vars;
ADIOI_Iexch_and_write_vars *eaw_vars;
ADIOI_W_Iexchange_data_vars *wed_vars;
} wr;
} data;
ADIOI_Icalc_others_req_vars *cor_vars;
};
void ADIOI_Icalc_others_req(ADIOI_NBC_Request *nbc_req, int *error_code);
void ADIOI_Icalc_others_req_main(ADIOI_NBC_Request *nbc_req, int *error_code);
void ADIOI_Icalc_others_req_fini(ADIOI_NBC_Request *nbc_req, int *error_code);
/* KC && AC - New Collective I/O internals*/
#define TEMP_OFF 0
......@@ -688,6 +800,22 @@ int MPIOI_File_iread(MPI_File fh,
MPI_Datatype datatype,
char *myname,
MPI_Request *request);
int MPIOI_File_iwrite_all(MPI_File fh,
MPI_Offset offset,
int file_ptr_type,
const void *buf,
int count,
MPI_Datatype datatype,
char *myname,
MPI_Request *request);
int MPIOI_File_iread_all(MPI_File fh,
MPI_Offset offset,
int file_ptr_type,
void *buf,
int count,
MPI_Datatype datatype,
char *myname,
MPI_Request *request);
......
......@@ -237,6 +237,20 @@ int MPI_File_sync(MPI_File fh);
int MPI_File_set_errhandler(MPI_File file, MPI_Errhandler errhandler);
int MPI_File_get_errhandler(MPI_File file, MPI_Errhandler *errhandler);
#endif
/* For MPI 3.1 */
int MPIX_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5);
int MPIX_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5);
int MPIX_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype,
MPI_Request *request)
MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4);
int MPIX_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype,
MPI_Request *request)
MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4);
/* End Prototypes */
#ifndef HAVE_MPI_DARRAY_SUBARRAY
......@@ -453,6 +467,20 @@ int PMPI_File_set_errhandler( MPI_File, MPI_Errhandler );
int PMPI_File_get_errhandler( MPI_File, MPI_Errhandler * );
#endif
/* For MPI 3.1 */
int PMPIX_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5);
int PMPIX_File_iwrite_at_all(MPI_File fh, MPI_Offset offset, const void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
MPICH_ATTR_POINTER_WITH_TYPE_TAG(3,5);
int PMPIX_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype,
MPI_Request *request)
MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4);
int PMPIX_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype,
MPI_Request *request)
MPICH_ATTR_POINTER_WITH_TYPE_TAG(2,4);
#ifndef HAVE_MPI_DARRAY_SUBARRAY
/* Section 4.14.4 */
int PMPI_Type_create_subarray(int, int *, int *, int *, int,
......
......@@ -28,10 +28,14 @@ romio_mpi_sources += \
mpi-io/get_size.c \
mpi-io/get_view.c \
mpi-io/iread.c \
mpi-io/iread_all.c \
mpi-io/iread_at.c \
mpi-io/iread_atall.c \
mpi-io/iread_sh.c \
mpi-io/iwrite.c \
mpi-io/iwrite_all.c \
mpi-io/iwrite_at.c \
mpi-io/iwrite_atall.c \
mpi-io/iwrite_sh.c \
mpi-io/open.c \
mpi-io/prealloc.c \
......
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2014 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "mpioimpl.h"
#ifdef HAVE_WEAK_SYMBOLS
#if defined(HAVE_PRAGMA_WEAK)
#pragma weak MPIX_File_iread_all = PMPIX_File_iread_all
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
#pragma _HP_SECONDARY_DEF PMPIX_File_iread_all MPIX_File_iread_all
#elif defined(HAVE_PRAGMA_CRI_DUP)
#pragma _CRI duplicate MPIX_File_iread_all as PMPIX_File_iread_all
/* end of weak pragmas */
#elif defined(HAVE_WEAK_ATTRIBUTE)
int MPIX_File_iread_all(MPI_File fh, void *buf, int count, MPI_Datatype datatype,
MPI_Request *request)
__attribute__((weak,alias("PMPIX_File_iread_all")));
#endif
/* Include mapping from MPI->PMPI */
#define MPIO_BUILD_PROFILING
#include "mpioprof.h"
#endif
#ifdef HAVE_MPI_GREQUEST
#include "mpiu_greq.h"
#endif
/*@
MPIX_File_iread_all - Nonblocking collective read using individual file pointer
Input Parameters:
. fh - file handle (handle)
. count - number of elements in buffer (nonnegative integer)
. datatype - datatype of each buffer element (handle)
Output Parameters:
. buf - initial address of buffer (choice)
. request - request object (handle)
.N fortran
@*/
int MPIX_File_iread_all(MPI_File fh, void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
{
int error_code;
static char myname[] = "MPIX_FILE_IREAD_ALL";
#ifdef MPI_hpux
int fl_xmpi;
HPMP_IO_START(fl_xmpi, BLKMPIFILEREADALL, TRDTBLOCK, fh, datatype, count);
#endif /* MPI_hpux */
error_code = MPIOI_File_iread_all(fh, (MPI_Offset)0,
ADIO_INDIVIDUAL, buf,
count, datatype, myname, request);
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS) {
error_code = MPIO_Err_return_file(fh, error_code);
}
/* --END ERROR HANDLING-- */
#ifdef MPI_hpux
HPMP_IO_END(fl_xmpi, fh, datatype, count);
#endif /* MPI_hpux */
return error_code;
}
/* Note: MPIOI_File_iread_all also used by MPIX_File_iread_at_all */
/* prevent multiple definitions of this routine */
#ifdef MPIO_BUILD_PROFILING
int MPIOI_File_iread_all(MPI_File fh,
MPI_Offset offset,
int file_ptr_type,
void *buf,
int count,
MPI_Datatype datatype,
char *myname,
MPI_Request *request)
{
int error_code;
MPI_Count datatype_size;
ADIO_File adio_fh;
void *xbuf=NULL, *e32_buf=NULL;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
adio_fh = MPIO_File_resolve(fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
MPIO_CHECK_COUNT(adio_fh, count, myname, error_code);
MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) {
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG,
"**iobadoffset", 0);
error_code = MPIO_Err_return_file(adio_fh, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
MPIO_CHECK_READABLE(adio_fh, myname, error_code);
MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code);
MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
/* --END ERROR HANDLING-- */
xbuf = buf;
if (adio_fh->is_external32) {
MPI_Aint e32_size = 0;
error_code = MPIU_datatype_full_size(datatype, &e32_size);
if (error_code != MPI_SUCCESS)
goto fn_exit;
e32_buf = ADIOI_Malloc(e32_size*count);
xbuf = e32_buf;
}
ADIO_IreadStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type,
offset, request, &error_code);
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS)
error_code = MPIO_Err_return_file(adio_fh, error_code);
/* --END ERROR HANDLING-- */
if (e32_buf != NULL) {
error_code = MPIU_read_external32_conversion_fn(xbuf, datatype,
count, e32_buf);
ADIOI_Free(e32_buf);
}
fn_exit:
MPIU_THREAD_CS_EXIT(ALLFUNC,);
return error_code;
}
#endif
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2014 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "mpioimpl.h"
#ifdef HAVE_WEAK_SYMBOLS
#if defined(HAVE_PRAGMA_WEAK)
#pragma weak MPIX_File_iread_at_all = PMPIX_File_iread_at_all
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
#pragma _HP_SECONDARY_DEF PMPIX_File_iread_at_all MPIX_File_iread_at_all
#elif defined(HAVE_PRAGMA_CRI_DUP)
#pragma _CRI duplicate MPIX_File_iread_at_all as PMPIX_File_iread_at_all
/* end of weak pragmas */
#elif defined(HAVE_WEAK_ATTRIBUTE)
int MPIX_File_iread_at_all(MPI_File fh, MPI_Offset offset, void * buf, int count,
MPI_Datatype datatype, MPI_Rquest *request)
__attribute__((weak,alias("PMPIX_File_iread_at_all")));
#endif
/* Include mapping from MPI->PMPI */
#define MPIO_BUILD_PROFILING
#include "mpioprof.h"
#endif
#ifdef HAVE_MPI_GREQUEST
#include "mpiu_greq.h"
#endif
/*@
MPIX_File_iread_at_all - Nonblocking collective read using explicit offset
Input Parameters:
. fh - file handle (handle)
. offset - file offset (nonnegative integer)
. count - number of elements in buffer (nonnegative integer)
. datatype - datatype of each buffer element (handle)
Output Parameters:
. buf - initial address of buffer (choice)
. request - request object (handle)
.N fortran
@*/
int MPIX_File_iread_at_all(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype,
MPI_Request *request)
{
int error_code;
static char myname[] = "MPIX_FILE_IREAD_AT_ALL";
#ifdef MPI_hpux
int fl_xmpi;
HPMP_IO_START(fl_xmpi, BLKMPIFILEIREADATALL, TRDTBLOCK, fh, datatype,
count);
#endif /* MPI_hpux */
error_code = MPIOI_File_iread_all(fh, offset, ADIO_EXPLICIT_OFFSET, buf,
count, datatype, myname, request);
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS)
error_code = MPIO_Err_return_file(fh, error_code);
/* --END ERROR HANDLING-- */
#ifdef MPI_hpux
HPMP_IO_END(fl_xmpi, fh, datatype, count);
#endif /* MPI_hpux */
return error_code;
}
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2014 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*/
#include "mpioimpl.h"
#ifdef HAVE_WEAK_SYMBOLS
#if defined(HAVE_PRAGMA_WEAK)
#pragma weak MPIX_File_iwrite_all = PMPIX_File_iwrite_all
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
#pragma _HP_SECONDARY_DEF PMPIX_File_iwrite_all MPIX_File_iwrite_all
#elif defined(HAVE_PRAGMA_CRI_DUP)
#pragma _CRI duplicate MPIX_File_iwrite_all as PMPIX_File_iwrite_all
/* end of weak pragmas */
#elif defined(HAVE_WEAK_ATTRIBUTE)
int MPIX_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype,
MPI_Request *request)
__attribute__((weak,alias("PMPIX_File_iwrite_all")));
#endif
/* Include mapping from MPI->PMPI */
#define MPIO_BUILD_PROFILING
#include "mpioprof.h"
#endif
#ifdef HAVE_MPI_GREQUEST
#include "mpiu_greq.h"
#endif
/*@
MPIX_File_iwrite_all - Nonblocking collective write using individual file pointer
Input Parameters:
. fh - file handle (handle)
. buf - initial address of buffer (choice)
. count - number of elements in buffer (nonnegative integer)
. datatype - datatype of each buffer element (handle)
Output Parameters:
. request - request object (handle)
.N fortran
@*/
int MPIX_File_iwrite_all(MPI_File fh, ROMIO_CONST void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
{
int error_code;
static char myname[] = "MPIX_FILE_IWRITE_ALL";
#ifdef MPI_hpux
int fl_xmpi;
HPMP_IO_START(fl_xmpi, BLKMPIFILEIWRITEALL, TRDTBLOCK, fh, datatype, count);
#endif /* MPI_hpux */
error_code = MPIOI_File_iwrite_all(fh, (MPI_Offset) 0,
ADIO_INDIVIDUAL, buf,
count, datatype, myname, request);
#ifdef MPI_hpux
HPMP_IO_END(fl_xmpi, fh, datatype, count);
#endif /* MPI_hpux */
return error_code;
}
/* Note: MPIOI_File_iwrite_all also used by MPIX_File_iwrite_at_all */
/* prevent multiple definitions of this routine */
#ifdef MPIO_BUILD_PROFILING
int MPIOI_File_iwrite_all(MPI_File fh,
MPI_Offset offset,
int file_ptr_type,
const void *buf,
int count,
MPI_Datatype datatype,
char *myname,
MPI_Request *request)
{
int error_code;
MPI_Count datatype_size;
ADIO_File adio_fh;
void *e32buf=NULL;
const void *xbuf=NULL;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
adio_fh = MPIO_File_resolve(fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
MPIO_CHECK_COUNT(adio_fh, count, myname, error_code);
MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0)
{
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG,
"**iobadoffset", 0);
error_code = MPIO_Err_return_file(adio_fh, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
MPI_Type_size_x(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHEC