This source file includes following definitions.
- ADIOI_GEN_IreadContig
- ADIOI_GEN_IreadStrided
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 #include "adio.h"
   9 
  10 #ifdef HAVE_UNISTD_H
  11 #include <unistd.h>
  12 #endif
  13 #ifdef HAVE_SIGNAL_H
  14 #include <signal.h>
  15 #endif
  16 #ifdef HAVE_SYS_TYPES_H
  17 #include <sys/types.h>
  18 #endif
  19 #ifdef HAVE_AIO_H
  20 #include <aio.h>
  21 #endif
  22 #ifdef HAVE_SYS_AIO_H
  23 #include <sys/aio.h>
  24 #endif
  25 
  26 #include "mpiu_greq.h"
  27 
  28 #ifdef ROMIO_HAVE_WORKING_AIO
  29 
  30 
  31 
  32 
  33 
  34 
  35 
  36 
  37 
  38 void ADIOI_GEN_IreadContig(ADIO_File fd, void *buf, int count, 
  39                            MPI_Datatype datatype, int file_ptr_type,
  40                            ADIO_Offset offset, MPI_Request *request,
  41                            int *error_code)  
  42 {
  43     MPI_Count len, typesize;
  44     int aio_errno = 0;
  45     static char myname[] = "ADIOI_GEN_IREADCONTIG";
  46 
  47     MPI_Type_size_x(datatype, &typesize);
  48     ADIOI_Assert((count * typesize) == ((ADIO_Offset)(unsigned)count * (ADIO_Offset)typesize));
  49     len = count * typesize;
  50 
  51     if (file_ptr_type == ADIO_INDIVIDUAL) offset = fd->fp_ind;
  52     aio_errno = ADIOI_GEN_aio(fd, buf, len, offset, 0, request);
  53     if (file_ptr_type == ADIO_INDIVIDUAL) fd->fp_ind += len;
  54 
  55     fd->fp_sys_posn = -1;
  56 
  57     
  58     if (aio_errno != 0) {
  59         MPIO_ERR_CREATE_CODE_ERRNO(myname, aio_errno, error_code);
  60         return;
  61     }
  62     
  63     
  64     *error_code = MPI_SUCCESS;
  65 }
  66 #endif
  67 
  68 
  69 
  70 
  71 void ADIOI_GEN_IreadStrided(ADIO_File fd, void *buf, int count, 
  72                             MPI_Datatype datatype, int file_ptr_type,
  73                             ADIO_Offset offset, ADIO_Request *request,
  74                             int *error_code)
  75 {
  76     ADIO_Status status;
  77     MPI_Count typesize;
  78     MPI_Offset nbytes=0;
  79 
  80     
  81 
  82 
  83     ADIO_ReadStrided(fd, buf, count, datatype, file_ptr_type, 
  84                      offset, &status, error_code);  
  85 
  86     if (*error_code == MPI_SUCCESS) {
  87         MPI_Type_size_x(datatype, &typesize);
  88         nbytes = (MPI_Offset)count*(MPI_Offset)typesize;
  89     }
  90     MPIO_Completed_request_create(&fd, nbytes, error_code, request);
  91 }