root/ompi/mca/io/romio321/romio/adio/ad_pfs/ad_pfs_wait.c

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

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_PFS_ReadComplete
  2. ADIOI_PFS_WriteComplete

   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 "ad_pfs.h"
   9 
  10 void ADIOI_PFS_ReadComplete(ADIO_Request *request, ADIO_Status *status,
  11                             int *error_code)
  12 {
  13     int err=0;
  14     static char myname[] = "ADIOI_PFS_READCOMPLETE";
  15 
  16     if (*request == ADIO_REQUEST_NULL) {
  17         *error_code = MPI_SUCCESS;
  18         return;
  19     }
  20 
  21     if ((*request)->queued) {
  22         err = _iowait(*((long *) (*request)->handle));
  23         if (err == -1) {
  24             *error_code = MPIO_Err_create_code(MPI_SUCCESS,
  25                                                MPIR_ERR_RECOVERABLE, myname,
  26                                                __LINE__, MPI_ERR_IO, "**io",
  27                                                "**io %s", strerror(errno));
  28         }
  29         else *error_code = MPI_SUCCESS;
  30     } /* if ((*request)->queued) ... */
  31     else *error_code = MPI_SUCCESS;
  32 #ifdef HAVE_STATUS_SET_BYTES
  33     if ((*request)->nbytes != -1)
  34         MPIR_Status_set_bytes(status, (*request)->datatype, (*request)->nbytes);
  35 #endif
  36 
  37     if ((*request)->queued != -1) {
  38 
  39         /* queued = -1 is an internal hack used when the request must
  40            be completed, but the request object should not be
  41            freed. This is used in ADIOI_Complete_async, because the user
  42            will call MPI_Wait later, which would require status to
  43            be filled. Ugly but works. queued = -1 should be used only
  44            in ADIOI_Complete_async. 
  45            This should not affect the user in any way. */
  46 
  47         /* if request is still queued in the system, it is also there
  48            on ADIOI_Async_list. Delete it from there. */
  49         if ((*request)->queued) ADIOI_Del_req_from_list(request);
  50 
  51         (*request)->fd->async_count--;
  52         if ((*request)->handle) ADIOI_Free((*request)->handle);
  53         ADIOI_Free_request((ADIOI_Req_node *) (*request));
  54         *request = ADIO_REQUEST_NULL;
  55     }
  56 }
  57 
  58 
  59 void ADIOI_PFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, int *error_code)  
  60 {
  61     ADIOI_PFS_ReadComplete(request, status, error_code);
  62 }

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