00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "ad_pvfs.h"
00010
00011 void ADIOI_PVFS_IreadContig(ADIO_File fd, void *buf, int count,
00012 MPI_Datatype datatype, int file_ptr_type,
00013 ADIO_Offset offset, ADIO_Request *request, int *error_code)
00014 {
00015 ADIO_Status status;
00016 int len, typesize;
00017
00018
00019
00020 *request = ADIOI_Malloc_request();
00021 (*request)->optype = ADIOI_READ;
00022 (*request)->fd = fd;
00023 (*request)->queued = 0;
00024 (*request)->datatype = datatype;
00025
00026 MPI_Type_size(datatype, &typesize);
00027 len = count * typesize;
00028 ADIOI_PVFS_ReadContig(fd, buf, len, MPI_BYTE, file_ptr_type, offset, &status,
00029 error_code);
00030
00031 #ifdef HAVE_STATUS_SET_BYTES
00032 if (*error_code == MPI_SUCCESS) {
00033 MPI_Get_elements(&status, MPI_BYTE, &len);
00034 (*request)->nbytes = len;
00035 }
00036 #endif
00037 fd->async_count++;
00038 }
00039
00040
00041
00042 void ADIOI_PVFS_IreadStrided(ADIO_File fd, void *buf, int count,
00043 MPI_Datatype datatype, int file_ptr_type,
00044 ADIO_Offset offset, ADIO_Request *request, int
00045 *error_code)
00046 {
00047 ADIO_Status status;
00048 #ifdef HAVE_STATUS_SET_BYTES
00049 int typesize;
00050 #endif
00051
00052
00053
00054 *request = ADIOI_Malloc_request();
00055 (*request)->optype = ADIOI_READ;
00056 (*request)->fd = fd;
00057 (*request)->queued = 0;
00058 (*request)->datatype = datatype;
00059
00060 ADIOI_PVFS_ReadStrided(fd, buf, count, datatype, file_ptr_type,
00061 offset, &status, error_code);
00062
00063 fd->async_count++;
00064
00065 #ifdef HAVE_STATUS_SET_BYTES
00066 if (*error_code == MPI_SUCCESS) {
00067 MPI_Type_size(datatype, &typesize);
00068 (*request)->nbytes = count * typesize;
00069 }
00070 #endif
00071 }