root/ompi/mca/io/romio321/romio/mpi-io/ioreq_f2c.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. MPIO_Request_f2c
  2. MPIO_Request_f2c

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

/* [<][>][^][v][top][bottom][index][help] */