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

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

DEFINITIONS

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

   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_Wait = PMPIO_Wait
  14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
  15 #pragma _HP_SECONDARY_DEF PMPIO_Wait MPIO_Wait
  16 #elif defined(HAVE_PRAGMA_CRI_DUP)
  17 #pragma _CRI duplicate MPIO_Wait as PMPIO_Wait
  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_Wait - Waits for the completion of a nonblocking read or write
  30 
  31 Input Parameters:
  32 . request - request object (handle)
  33 
  34 Output Parameters:
  35 . status - status object (Status)
  36 
  37 .N fortran
  38 @*/
  39 #ifdef HAVE_MPI_GREQUEST
  40 int MPIO_Wait(MPIO_Request *request, MPI_Status *status)
  41 {
  42         return(MPI_Wait(request, status));
  43 }
  44 #else
  45 int MPIO_Wait(MPIO_Request *request, MPI_Status *status)
  46 {
  47     int error_code;
  48     static char myname[] = "MPIO_WAIT";
  49     MPID_THREADPRIV_DECL;
  50 
  51 #ifdef MPI_hpux
  52     int fl_xmpi;
  53 
  54     if (*request != MPIO_REQUEST_NULL) {
  55         HPMP_IO_WSTART(fl_xmpi, BLKMPIOWAIT, TRDTBLOCK, (*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 
  67     /* --BEGIN ERROR HANDLING-- */
  68     if ((*request < (MPIO_Request) 0) ||
  69         ((*request)->cookie != ADIOI_REQ_COOKIE))
  70     {
  71         error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  72                                           myname, __LINE__, MPI_ERR_REQUEST,
  73                                           "**request", 0);
  74         error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
  75         goto fn_exit;
  76     }
  77     /* --END ERROR HANDLING-- */
  78 
  79     switch ((*request)->optype) {
  80     case ADIOI_READ:
  81         ADIO_ReadComplete(request, status, &error_code);
  82         break;
  83     case ADIOI_WRITE:
  84         ADIO_WriteComplete(request, status, &error_code);
  85         break;
  86     }
  87 
  88 #ifdef MPI_hpux
  89     HPMP_IO_WEND(fl_xmpi);
  90 #endif /* MPI_hpux */
  91 
  92 fn_exit:
  93     ROMIO_THREAD_CS_EXIT();
  94     return error_code;
  95 }
  96 #endif

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