|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
* (C) 2008 by Argonne National Laboratory.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include "mpioimpl.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_WEAK_SYMBOLS
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#if defined(HAVE_PRAGMA_WEAK)
|
|
Packit Service |
c5cf8c |
#pragma weak MPI_File_iwrite_all = PMPI_File_iwrite_all
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
|
|
Packit Service |
c5cf8c |
#pragma _HP_SECONDARY_DEF PMPI_File_iwrite_all MPI_File_iwrite_all
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_CRI_DUP)
|
|
Packit Service |
c5cf8c |
#pragma _CRI duplicate MPI_File_iwrite_all as PMPI_File_iwrite_all
|
|
Packit Service |
c5cf8c |
/* end of weak pragmas */
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_WEAK_ATTRIBUTE)
|
|
Packit Service |
c5cf8c |
int MPI_File_iwrite_all(MPI_File fh, const void *buf, int count, MPI_Datatype datatype,
|
|
Packit Service |
c5cf8c |
MPI_Request * request)
|
|
Packit Service |
c5cf8c |
__attribute__ ((weak, alias("PMPI_File_iwrite_all")));
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Include mapping from MPI->PMPI */
|
|
Packit Service |
c5cf8c |
#define MPIO_BUILD_PROFILING
|
|
Packit Service |
c5cf8c |
#include "mpioprof.h"
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_MPI_GREQUEST
|
|
Packit Service |
c5cf8c |
#include "mpiu_greq.h"
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/*@
|
|
Packit Service |
c5cf8c |
MPI_File_iwrite_all - Nonblocking collective write using individual file pointer
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Input Parameters:
|
|
Packit Service |
c5cf8c |
. fh - file handle (handle)
|
|
Packit Service |
c5cf8c |
. buf - initial address of buffer (choice)
|
|
Packit Service |
c5cf8c |
. count - number of elements in buffer (nonnegative integer)
|
|
Packit Service |
c5cf8c |
. datatype - datatype of each buffer element (handle)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Output Parameters:
|
|
Packit Service |
c5cf8c |
. request - request object (handle)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N fortran
|
|
Packit Service |
c5cf8c |
@*/
|
|
Packit Service |
c5cf8c |
int MPI_File_iwrite_all(MPI_File fh, ROMIO_CONST void *buf, int count,
|
|
Packit Service |
c5cf8c |
MPI_Datatype datatype, MPI_Request * request)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int error_code;
|
|
Packit Service |
c5cf8c |
static char myname[] = "MPI_FILE_IWRITE_ALL";
|
|
Packit Service |
c5cf8c |
#ifdef MPI_hpux
|
|
Packit Service |
c5cf8c |
int fl_xmpi;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
HPMP_IO_START(fl_xmpi, BLKMPIFILEIWRITEALL, TRDTBLOCK, fh, datatype, count);
|
|
Packit Service |
c5cf8c |
#endif /* MPI_hpux */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
error_code = MPIOI_File_iwrite_all(fh, (MPI_Offset) 0,
|
|
Packit Service |
c5cf8c |
ADIO_INDIVIDUAL, buf, count, datatype, myname, request);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifdef MPI_hpux
|
|
Packit Service |
c5cf8c |
HPMP_IO_END(fl_xmpi, fh, datatype, count);
|
|
Packit Service |
c5cf8c |
#endif /* MPI_hpux */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return error_code;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Note: MPIOI_File_iwrite_all also used by MPI_File_iwrite_at_all */
|
|
Packit Service |
c5cf8c |
/* prevent multiple definitions of this routine */
|
|
Packit Service |
c5cf8c |
#ifdef MPIO_BUILD_PROFILING
|
|
Packit Service |
c5cf8c |
int MPIOI_File_iwrite_all(MPI_File fh,
|
|
Packit Service |
c5cf8c |
MPI_Offset offset,
|
|
Packit Service |
c5cf8c |
int file_ptr_type,
|
|
Packit Service |
c5cf8c |
const void *buf,
|
|
Packit Service |
c5cf8c |
int count, MPI_Datatype datatype, char *myname, MPI_Request * request)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int error_code;
|
|
Packit Service |
c5cf8c |
MPI_Count datatype_size;
|
|
Packit Service |
c5cf8c |
ADIO_File adio_fh;
|
|
Packit Service |
c5cf8c |
void *e32buf = NULL;
|
|
Packit Service |
c5cf8c |
const void *xbuf = NULL;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_ENTER();
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
adio_fh = MPIO_File_resolve(fh);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
|
|
Packit Service |
c5cf8c |
MPIO_CHECK_COUNT(adio_fh, count, myname, error_code);
|
|
Packit Service |
c5cf8c |
MPIO_CHECK_DATATYPE(adio_fh, datatype, myname, error_code);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0) {
|
|
Packit Service |
c5cf8c |
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
|
|
Packit Service |
c5cf8c |
myname, __LINE__, MPI_ERR_ARG, "**iobadoffset", 0);
|
|
Packit Service |
c5cf8c |
error_code = MPIO_Err_return_file(adio_fh, error_code);
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Type_size_x(datatype, &datatype_size);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
MPIO_CHECK_INTEGRAL_ETYPE(adio_fh, count, datatype_size, myname, error_code);
|
|
Packit Service |
c5cf8c |
MPIO_CHECK_WRITABLE(adio_fh, myname, error_code);
|
|
Packit Service |
c5cf8c |
MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code);
|
|
Packit Service |
c5cf8c |
MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
xbuf = buf;
|
|
Packit Service |
c5cf8c |
if (adio_fh->is_external32) {
|
|
Packit Service |
c5cf8c |
error_code = MPIU_external32_buffer_setup(buf, count, datatype, &e32buf);
|
|
Packit Service |
c5cf8c |
if (error_code != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
xbuf = e32buf;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
ADIO_IwriteStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type,
|
|
Packit Service |
c5cf8c |
offset, request, &error_code);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
if (error_code != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
error_code = MPIO_Err_return_file(adio_fh, error_code);
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
if (e32buf != NULL)
|
|
Packit Service |
c5cf8c |
ADIOI_Free(e32buf);
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_EXIT();
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return error_code;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif
|