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_Wait = PMPIO_Wait
00014 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00015 #pragma _HP_SECONDARY_DEF PMPIO_Wait MPIO_Wait
00016 #elif defined(HAVE_PRAGMA_CRI_DUP)
00017 #pragma _CRI duplicate MPIO_Wait as PMPIO_Wait
00018 
00019 #endif
00020 
00021 
00022 #define MPIO_BUILD_PROFILING
00023 #include "mpioprof.h"
00024 #endif
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 #ifdef HAVE_MPI_GREQUEST
00040 int MPIO_Wait(MPIO_Request *request, MPI_Status *status)
00041 {
00042     return(MPI_Wait(request, status));
00043 }
00044 #else
00045 int MPIO_Wait(MPIO_Request *request, MPI_Status *status)
00046 {
00047     int error_code;
00048     static char myname[] = "MPIO_WAIT";
00049     MPIU_THREADPRIV_DECL;
00050 
00051 #ifdef MPI_hpux
00052     int fl_xmpi;
00053 
00054     if (*request != MPIO_REQUEST_NULL) {
00055     HPMP_IO_WSTART(fl_xmpi, BLKMPIOWAIT, TRDTBLOCK, (*request)->fd);
00056     }
00057 #endif 
00058 
00059     MPIU_THREAD_CS_ENTER(ALLFUNC,);
00060 
00061     if (*request == MPIO_REQUEST_NULL) {
00062         error_code = MPI_SUCCESS;
00063         goto fn_exit;
00064     }
00065 
00066 
00067     
00068     if ((*request < (MPIO_Request) 0) ||
00069     ((*request)->cookie != ADIOI_REQ_COOKIE))
00070     {
00071     error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
00072                       myname, __LINE__, MPI_ERR_REQUEST,
00073                       "**request", 0);
00074     error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
00075     goto fn_exit;
00076     }
00077     
00078 
00079     switch ((*request)->optype) {
00080     case ADIOI_READ:
00081         ADIO_ReadComplete(request, status, &error_code);
00082         break;
00083     case ADIOI_WRITE:
00084         ADIO_WriteComplete(request, status, &error_code);
00085         break;
00086     }
00087 
00088 #ifdef MPI_hpux
00089     HPMP_IO_WEND(fl_xmpi);
00090 #endif 
00091 
00092 fn_exit:
00093     MPIU_THREAD_CS_EXIT(ALLFUNC,);
00094     return error_code;
00095 }
00096 #endif