Blame src/mpi/romio/mpi-io/iread_at.c

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_iread_at = PMPI_File_iread_at
Packit Service c5cf8c
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
Packit Service c5cf8c
#pragma _HP_SECONDARY_DEF PMPI_File_iread_at MPI_File_iread_at
Packit Service c5cf8c
#elif defined(HAVE_PRAGMA_CRI_DUP)
Packit Service c5cf8c
#pragma _CRI duplicate MPI_File_iread_at as PMPI_File_iread_at
Packit Service c5cf8c
/* end of weak pragmas */
Packit Service c5cf8c
#elif defined(HAVE_WEAK_ATTRIBUTE)
Packit Service c5cf8c
int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype,
Packit Service c5cf8c
                      MPIO_Request * request) __attribute__ ((weak, alias("PMPI_File_iread_at")));
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_iread_at - Nonblocking read using explicit offset
Packit Service c5cf8c
Packit Service c5cf8c
Input Parameters:
Packit Service c5cf8c
. fh - file handle (handle)
Packit Service c5cf8c
. offset - file offset (nonnegative integer)
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
. request - request object (handle)
Packit Service c5cf8c
Packit Service c5cf8c
.N fortran
Packit Service c5cf8c
@*/
Packit Service c5cf8c
int MPI_File_iread_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype,
Packit Service c5cf8c
                      MPIO_Request * request)
Packit Service c5cf8c
{
Packit Service c5cf8c
    int error_code;
Packit Service c5cf8c
    static char myname[] = "MPI_FILE_IREAD_AT";
Packit Service c5cf8c
Packit Service c5cf8c
#ifdef MPI_hpux
Packit Service c5cf8c
    int fl_xmpi;
Packit Service c5cf8c
Packit Service c5cf8c
    HPMP_IO_START(fl_xmpi, BLKMPIFILEIREADAT, TRDTSYSTEM, fh, datatype, count);
Packit Service c5cf8c
#endif /* MPI_hpux */
Packit Service c5cf8c
Packit Service c5cf8c
Packit Service c5cf8c
    error_code = MPIOI_File_iread(fh, offset, ADIO_EXPLICIT_OFFSET, buf,
Packit Service c5cf8c
                                  count, datatype, myname, request);
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(fh, error_code);
Packit Service c5cf8c
    /* --END ERROR HANDLING-- */
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
}