1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
/*
* Copyright (C) by Argonne National Laboratory
* See COPYRIGHT in top-level directory
*/
#include "mpioimpl.h"
#ifdef HAVE_WEAK_SYMBOLS
#if defined(HAVE_PRAGMA_WEAK)
#pragma weak MPIO_Request_f2c = PMPIO_Request_f2c
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
#pragma _HP_SECONDARY_DEF PMPIO_Request_f2c MPIO_Request_f2c
#elif defined(HAVE_PRAGMA_CRI_DUP)
#pragma _CRI duplicate MPIO_Request_f2c as PMPIO_Request_f2c
/* end of weak pragmas */
#endif
/* Include mapping from MPI->PMPI */
#define MPIO_BUILD_PROFILING
#include "mpioprof.h"
#endif
#include "adio_extern.h"
/*@
MPIO_Request_f2c - Translates a Fortran I/O-request handle to
a C I/O-request handle
Input Parameters:
. request - Fortran I/O-request handle (integer)
Return Value:
C I/O-request handle (handle)
@*/
#ifdef HAVE_MPI_GREQUEST
MPIO_Request MPIO_Request_f2c(MPI_Fint request)
{
return ((MPIO_Request) request);
}
#else
MPIO_Request MPIO_Request_f2c(MPI_Fint request)
{
int error_code;
static char myname[] = "MPIO_REQUEST_F2C";
#ifndef INT_LT_POINTER
return (MPIO_Request) request;
#else
ROMIO_THREAD_CS_ENTER();
if (!request) {
return MPIO_REQUEST_NULL;
}
/* --BEGIN ERROR HANDLING-- */
if ((request < 0) || (request > ADIOI_Reqtable_ptr)) {
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_REQUEST, "**request", 0);
error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
return MPIO_REQUEST_NULL;
}
/* --END ERROR HANDLING-- */
fn_exit:
ROMIO_THREAD_CS_EXIT();
return ADIOI_Reqtable[request];
#endif
}
#endif
|