00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #include "mpioimpl.h"
00009 
00010 #ifdef HAVE_WEAK_SYMBOLS
00011 
00012 #if defined(HAVE_PRAGMA_WEAK)
00013 #pragma weak MPIO_Request_f2c = PMPIO_Request_f2c
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPIO_Request_f2c MPIO_Request_f2c
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPIO_Request_f2c as PMPIO_Request_f2c
00018 
00019 #endif
00020 
00021 
00022 #define MPIO_BUILD_PROFILING
00023 #include "mpioprof.h"
00024 #endif
00025 #include "adio_extern.h"
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 #ifdef HAVE_MPI_GREQUEST
00038 MPIO_Request MPIO_Request_f2c(MPI_Fint request) {
00039     return((MPIO_Request) request);
00040 }
00041 #else
00042 MPIO_Request MPIO_Request_f2c(MPI_Fint request)
00043 {
00044     int error_code;
00045     static char myname[] = "MPIO_REQUEST_F2C";
00046     MPIU_THREADPRIV_DECL;
00047 
00048 #ifndef INT_LT_POINTER
00049     return (MPIO_Request) request;
00050 #else
00051 
00052     MPIU_THREAD_CS_ENTER(ALLFUNC,);
00053     
00054     if (!request) {
00055     return MPIO_REQUEST_NULL;
00056     }
00057     
00058     if ((request < 0) || (request > ADIOI_Reqtable_ptr)) {
00059     error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00060                       myname, __LINE__, MPI_ERR_REQUEST,
00061                       "**request", 0);
00062     error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
00063     return MPIO_REQUEST_NULL;
00064     }
00065     
00066 
00067 fn_exit:
00068     MPIU_THREAD_CS_EXIT(ALLFUNC,);
00069     return ADIOI_Reqtable[request];
00070 #endif
00071 }
00072 #endif