00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "ad_sfs.h"
00010
00011 void ADIOI_SFS_IwriteContig(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_WRITE;
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_SFS_WriteContig(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 void ADIOI_SFS_IwriteStrided(ADIO_File fd, void *buf, int count,
00042 MPI_Datatype datatype, int file_ptr_type,
00043 ADIO_Offset offset, ADIO_Request *request, int
00044 *error_code)
00045 {
00046 ADIO_Status status;
00047 #ifdef HAVE_STATUS_SET_BYTES
00048 int typesize;
00049 #endif
00050
00051
00052
00053 *request = ADIOI_Malloc_request();
00054 (*request)->optype = ADIOI_WRITE;
00055 (*request)->fd = fd;
00056 (*request)->queued = 0;
00057 (*request)->datatype = datatype;
00058
00059 ADIOI_SFS_WriteStrided(fd, buf, count, datatype, file_ptr_type,
00060 offset, &status, error_code);
00061
00062 fd->async_count++;
00063 #ifdef HAVE_STATUS_SET_BYTES
00064 if (*error_code == MPI_SUCCESS) {
00065 MPI_Type_size(datatype, &typesize);
00066 (*request)->nbytes = count * typesize;
00067 }
00068 #endif
00069 }