00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "ad_testfs.h"
00010 #include "adioi.h"
00011
00012 void ADIOI_TESTFS_ReadContig(ADIO_File fd, void *buf, int count,
00013 MPI_Datatype datatype, int file_ptr_type,
00014 ADIO_Offset offset, ADIO_Status *status, int
00015 *error_code)
00016 {
00017 int myrank, nprocs, datatype_size;
00018
00019 *error_code = MPI_SUCCESS;
00020
00021 MPI_Comm_size(fd->comm, &nprocs);
00022 MPI_Comm_rank(fd->comm, &myrank);
00023 MPI_Type_size(datatype, &datatype_size);
00024 FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadContig called on %s\n", myrank,
00025 nprocs, fd->filename);
00026 if (file_ptr_type != ADIO_EXPLICIT_OFFSET)
00027 {
00028 offset = fd->fp_ind;
00029 fd->fp_ind += datatype_size * count;
00030 fd->fp_sys_posn = fd->fp_ind;
00031 #if 0
00032 FPRINTF(stdout, "[%d/%d] new file position is %Ld\n", myrank,
00033 nprocs, (long long) fd->fp_ind);
00034 #endif
00035 }
00036 else {
00037 fd->fp_sys_posn = offset + datatype_size * count;
00038 }
00039
00040 FPRINTF(stdout, "[%d/%d] reading (buf = 0x%x, loc = %Ld, sz = %Ld)\n",
00041 myrank, nprocs, (int) buf, (long long) offset,
00042 (long long) datatype_size * count);
00043
00044 #ifdef HAVE_STATUS_SET_BYTES
00045 MPIR_Status_set_bytes(status, datatype, datatype_size * count);
00046 #endif
00047 }
00048
00049 void ADIOI_TESTFS_ReadStrided(ADIO_File fd, void *buf, int count,
00050 MPI_Datatype datatype, int file_ptr_type,
00051 ADIO_Offset offset, ADIO_Status *status, int
00052 *error_code)
00053 {
00054 int myrank, nprocs;
00055
00056 *error_code = MPI_SUCCESS;
00057
00058 MPI_Comm_size(fd->comm, &nprocs);
00059 MPI_Comm_rank(fd->comm, &myrank);
00060 FPRINTF(stdout, "[%d/%d] ADIOI_TESTFS_ReadStrided called on %s\n", myrank,
00061 nprocs, fd->filename);
00062 FPRINTF(stdout, "[%d/%d] calling ADIOI_GEN_ReadStrided\n", myrank,
00063 nprocs);
00064
00065 ADIOI_GEN_ReadStrided(fd, buf, count, datatype, file_ptr_type, offset,
00066 status, error_code);
00067 }