00001
00002
00003
00004
00005
00006
00007
00008 #include "adio.h"
00009 #include "mpiu_greq.h"
00010
00011
00012
00013
00014 void ADIOI_FAKE_IreadContig(ADIO_File fd, void *buf, int count,
00015 MPI_Datatype datatype, int file_ptr_type,
00016 ADIO_Offset offset, ADIO_Request *request,
00017 int *error_code)
00018 {
00019 ADIO_Status status;
00020 int typesize;
00021 MPI_Offset len;
00022
00023 MPI_Type_size(datatype, &typesize);
00024 len = (MPI_Offset)count * (MPI_Offset)typesize;
00025
00026
00027
00028
00029 ADIOI_Assert(len == (int) len);
00030 ADIO_ReadContig(fd, buf, (int)len, MPI_BYTE, file_ptr_type, offset,
00031 &status, error_code);
00032 if (*error_code != MPI_SUCCESS) {
00033 len=0;
00034 }
00035 MPIO_Completed_request_create(&fd, len, error_code, request);
00036 }
00037
00038
00039
00040
00041
00042 void ADIOI_FAKE_IreadStrided(ADIO_File fd, void *buf, int count,
00043 MPI_Datatype datatype, int file_ptr_type,
00044 ADIO_Offset offset, ADIO_Request *request,
00045 int *error_code)
00046 {
00047 ADIO_Status status;
00048 int typesize;
00049 MPI_Offset nbytes=0;
00050
00051
00052
00053
00054 ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type,
00055 offset, &status, error_code);
00056 if (*error_code == MPI_SUCCESS) {
00057 MPI_Type_size(datatype, &typesize);
00058 nbytes = (MPI_Offset)count*(MPI_Offset)typesize;
00059 }
00060 MPIO_Completed_request_create(&fd, nbytes, error_code, request);
00061 }