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