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

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

DEFINITIONS

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

   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_Test = PMPIO_Test
  14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  15 #pragma _HP_SECONDARY_DEF PMPIO_Test MPIO_Test
  16 #elif defined(HAVE_PRAGMA_CRI_DUP)
  17 #pragma _CRI duplicate MPIO_Test as PMPIO_Test
  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 
  26 /* status object not filled currently */
  27 
  28 /*@
  29     MPIO_Test - Test the completion of a nonblocking read or write
  30                 
  31 Input Parameters:
  32 . request - request object (handle)
  33 
  34 Output Parameters:
  35 . flag - true if operation completed (logical)
  36 . status - status object (Status)
  37 
  38 .N fortran
  39 @*/
  40 #ifdef HAVE_MPI_GREQUEST
  41 int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status)
  42 {
  43         return (MPI_Test(request, flag, status));
  44 }
  45 #else
  46 int MPIO_Test(MPIO_Request *request, int *flag, MPI_Status *status)
  47 {
  48     int error_code;
  49     static char myname[] = "MPIO_TEST";
  50     MPID_THREADPRIV_DECL;
  51 #ifdef MPI_hpux
  52     int fl_xmpi;
  53 
  54     if (*request != MPIO_REQUEST_NULL) {
  55         HPMP_IO_WSTART(fl_xmpi, BLKMPIOTEST, TRDTSYSTEM, (*request)->fd);
  56     }
  57 #endif /* MPI_hpux */
  58 
  59     ROMIO_THREAD_CS_ENTER();
  60 
  61     if (*request == MPIO_REQUEST_NULL) {
  62             error_code = MPI_SUCCESS;
  63             goto fn_exit;
  64     }
  65 
  66     /* --BEGIN ERROR HANDLING-- */
  67     if ((*request < (MPIO_Request) 0) || 
  68         ((*request)->cookie != ADIOI_REQ_COOKIE))
  69     {
  70         error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  71                                           myname, __LINE__, MPI_ERR_REQUEST,
  72                                           "**request", 0);
  73         error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
  74         goto fn_exit;
  75     }
  76     /* --END ERROR HANDLING-- */
  77 
  78     switch ((*request)->optype) {
  79     case ADIOI_READ:
  80         *flag = ADIO_ReadDone(request, status, &error_code);
  81         break;
  82     case ADIOI_WRITE:
  83         *flag = ADIO_WriteDone(request, status, &error_code);
  84         break;
  85     }
  86 
  87 #ifdef MPI_hpux
  88     HPMP_IO_WEND(fl_xmpi);
  89 #endif /* MPI_hpux */
  90 
  91 fn_exit:
  92     ROMIO_THREAD_CS_EXIT();
  93     return error_code;
  94 }
  95 #endif

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