00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "mpioimpl.h"
00010
00011 #ifdef HAVE_WEAK_SYMBOLS
00012
00013 #if defined(HAVE_PRAGMA_WEAK)
00014 #pragma weak MPIO_Test = PMPIO_Test
00015 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
00016 #pragma _HP_SECONDARY_DEF PMPIO_Test MPIO_Test
00017 #elif defined(HAVE_PRAGMA_CRI_DUP)
00018 #pragma _CRI duplicate MPIO_Test as PMPIO_Test
00019
00020 #endif
00021
00022
00023 #define MPIO_BUILD_PROFILING
00024 #include "mpioprof.h"
00025 #endif
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status)
00042 {
00043 int error_code;
00044 #ifndef PRINT_ERR_MSG
00045 static char myname[] = "MPIO_TEST";
00046 #endif
00047 #ifdef MPI_hpux
00048 int fl_xmpi;
00049
00050 if (*request != MPIO_REQUEST_NULL) {
00051 HPMP_IO_WSTART(fl_xmpi, BLKMPIOTEST, TRDTSYSTEM, (*request)->fd);
00052 }
00053 #endif
00054
00055 if (*request == MPIO_REQUEST_NULL) return MPI_SUCCESS;
00056
00057 if ((*request < (MPIO_Request) 0) ||
00058 ((*request)->cookie != ADIOI_REQ_COOKIE)) {
00059 #ifdef PRINT_ERR_MSG
00060 FPRINTF(stderr, "MPIO_Test: Invalid request object\n");
00061 MPI_Abort(MPI_COMM_WORLD, 1);
00062 #else
00063 error_code = MPIR_Err_setmsg(MPI_ERR_REQUEST, MPIR_ERR_REQUEST_NULL,
00064 myname, (char *) 0, (char *) 0);
00065 return ADIOI_Error(MPI_FILE_NULL, error_code, myname);
00066 #endif
00067 }
00068
00069 switch ((*request)->optype) {
00070 case ADIOI_READ:
00071 *flag = ADIO_ReadDone(request, status, &error_code);
00072 break;
00073 case ADIOI_WRITE:
00074 *flag = ADIO_WriteDone(request, status, &error_code);
00075 break;
00076 }
00077
00078 #ifdef MPI_hpux
00079 HPMP_IO_WEND(fl_xmpi);
00080 #endif
00081 return error_code;
00082 }