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