00001
00002
00003
00004
00005
00006
00007
00008 #include "ad_pfs.h"
00009
00010 void ADIOI_PFS_ReadComplete(ADIO_Request *request, ADIO_Status *status,
00011 int *error_code)
00012 {
00013 int err=0;
00014 static char myname[] = "ADIOI_PFS_READCOMPLETE";
00015
00016 if (*request == ADIO_REQUEST_NULL) {
00017 *error_code = MPI_SUCCESS;
00018 return;
00019 }
00020
00021 if ((*request)->queued) {
00022 err = _iowait(*((long *) (*request)->handle));
00023 if (err == -1) {
00024 *error_code = MPIO_Err_create_code(MPI_SUCCESS,
00025 MPIR_ERR_RECOVERABLE, myname,
00026 __LINE__, MPI_ERR_IO, "**io",
00027 "**io %s", strerror(errno));
00028 }
00029 else *error_code = MPI_SUCCESS;
00030 }
00031 else *error_code = MPI_SUCCESS;
00032 #ifdef HAVE_STATUS_SET_BYTES
00033 if ((*request)->nbytes != -1)
00034 MPIR_Status_set_bytes(status, (*request)->datatype, (*request)->nbytes);
00035 #endif
00036
00037 if ((*request)->queued != -1) {
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 if ((*request)->queued) ADIOI_Del_req_from_list(request);
00050
00051 (*request)->fd->async_count--;
00052 if ((*request)->handle) ADIOI_Free((*request)->handle);
00053 ADIOI_Free_request((ADIOI_Req_node *) (*request));
00054 *request = ADIO_REQUEST_NULL;
00055 }
00056 }
00057
00058
00059 void ADIOI_PFS_WriteComplete(ADIO_Request *request, ADIO_Status *status, int *error_code)
00060 {
00061 ADIOI_PFS_ReadComplete(request, status, error_code);
00062 }