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

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

DEFINITIONS

This source file includes following definitions.
  1. ADIOI_PFS_ReadDone
  2. ADIOI_PFS_WriteDone

   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 int ADIOI_PFS_ReadDone(ADIO_Request *request, ADIO_Status *status,
  11                        int *error_code)  
  12 {
  13     int done=0;
  14     static char myname[] = "ADIOI_PFS_READDONE";
  15 
  16     if (*request == ADIO_REQUEST_NULL) {
  17         *error_code = MPI_SUCCESS;
  18         return 1;
  19     }
  20 
  21     if ((*request)->queued)
  22         done = _iodone(*((long *) (*request)->handle));
  23     else done = 1; /* ADIOI_Complete_Async completed this request, 
  24                       but request object was not freed. */
  25 
  26 #ifdef HAVE_STATUS_SET_BYTES
  27     if ((done >= 0) && ((*request)->nbytes != -1))
  28         MPIR_Status_set_bytes(status, (*request)->datatype, (*request)->nbytes);
  29 #endif
  30 
  31     if (done >= 0) {
  32         /* if request is still queued in the system, it is also there
  33            on ADIOI_Async_list. Delete it from there. */
  34         if ((*request)->queued) ADIOI_Del_req_from_list(request);
  35 
  36         (*request)->fd->async_count--;
  37         if ((*request)->handle) ADIOI_Free((*request)->handle);
  38         ADIOI_Free_request((ADIOI_Req_node *) (*request));
  39         *request = ADIO_REQUEST_NULL;
  40     }
  41     
  42     if (done == -1 && errno != 0) {
  43         *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
  44                                            myname, __LINE__, MPI_ERR_IO,
  45                                            "**io",
  46                                            "**io %s", strerror(errno));
  47     }
  48     else *error_code = MPI_SUCCESS;
  49     return done;
  50 }
  51 
  52 
  53 int ADIOI_PFS_WriteDone(ADIO_Request *request, ADIO_Status *status,
  54                         int *error_code)
  55 {
  56     return ADIOI_PFS_ReadDone(request, status, error_code);
  57 } 

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