|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* Copyright (C) 1997 University of Chicago.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT notice 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_read_all_begin = PMPI_File_read_all_begin
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
|
|
Packit Service |
c5cf8c |
#pragma _HP_SECONDARY_DEF PMPI_File_read_all_begin MPI_File_read_all_begin
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_CRI_DUP)
|
|
Packit Service |
c5cf8c |
#pragma _CRI duplicate MPI_File_read_all_begin as PMPI_File_read_all_begin
|
|
Packit Service |
c5cf8c |
/* end of weak pragmas */
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_WEAK_ATTRIBUTE)
|
|
Packit Service |
c5cf8c |
int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype)
|
|
Packit Service |
c5cf8c |
__attribute__ ((weak, alias("PMPI_File_read_all_begin")));
|
|
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 |
/*@
|
|
Packit Service |
c5cf8c |
MPI_File_read_all_begin - Begin a split collective read using individual file pointer
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Input Parameters:
|
|
Packit Service |
c5cf8c |
. fh - file handle (handle)
|
|
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 |
. buf - initial address of buffer (choice)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N fortran
|
|
Packit Service |
c5cf8c |
@*/
|
|
Packit Service |
c5cf8c |
int MPI_File_read_all_begin(MPI_File fh, void *buf, int count, MPI_Datatype datatype)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int error_code;
|
|
Packit Service |
c5cf8c |
static char myname[] = "MPI_FILE_READ_ALL_BEGIN";
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
error_code = MPIOI_File_read_all_begin(fh, (MPI_Offset) 0,
|
|
Packit Service |
c5cf8c |
ADIO_INDIVIDUAL, buf, count, datatype, myname);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return error_code;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* prevent multiple definitions of this routine */
|
|
Packit Service |
c5cf8c |
#ifdef MPIO_BUILD_PROFILING
|
|
Packit Service |
c5cf8c |
int MPIOI_File_read_all_begin(MPI_File fh,
|
|
Packit Service |
c5cf8c |
MPI_Offset offset,
|
|
Packit Service |
c5cf8c |
int file_ptr_type,
|
|
Packit Service |
c5cf8c |
void *buf, int count, MPI_Datatype datatype, char *myname)
|
|
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 *xbuf = NULL, *e32_buf = 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_READABLE(adio_fh, myname, error_code);
|
|
Packit Service |
c5cf8c |
MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (adio_fh->split_coll_count) {
|
|
Packit Service |
c5cf8c |
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
|
|
Packit Service |
c5cf8c |
myname, __LINE__, MPI_ERR_IO, "**iosplitcoll", 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 |
MPIO_CHECK_COUNT_SIZE(adio_fh, count, datatype_size, myname, error_code);
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
adio_fh->split_coll_count = 1;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
xbuf = buf;
|
|
Packit Service |
c5cf8c |
if (adio_fh->is_external32) {
|
|
Packit Service |
c5cf8c |
MPI_Aint e32_size = 0;
|
|
Packit Service |
c5cf8c |
error_code = MPIU_datatype_full_size(datatype, &e32_size);
|
|
Packit Service |
c5cf8c |
if (error_code != MPI_SUCCESS)
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
e32_buf = ADIOI_Malloc(e32_size * count);
|
|
Packit Service |
c5cf8c |
xbuf = e32_buf;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
ADIO_ReadStridedColl(adio_fh, xbuf, count, datatype, file_ptr_type,
|
|
Packit Service |
c5cf8c |
offset, &adio_fh->split_status, &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 |
if (e32_buf != NULL) {
|
|
Packit Service |
c5cf8c |
error_code = MPIU_read_external32_conversion_fn(buf, datatype, count, e32_buf);
|
|
Packit Service |
c5cf8c |
ADIOI_Free(e32_buf);
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_EXIT();
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return error_code;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
#endif
|