1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 #ifndef AD_PANFS_INCLUDE
  10 #define AD_PANFS_INCLUDE
  11 
  12 #include <unistd.h>
  13 #include <sys/types.h>
  14 #include <fcntl.h>
  15 #include "adio.h"
  16 
  17 #ifndef NO_AIO
  18 # ifdef AIO_SUN
  19 # include <sys/asynch.h>
  20 # else
  21   #ifdef HAVE_AIO_LITE_H
  22   #include <aio-lite.h>
  23   #else
  24    #ifdef  HAVE_AIO_H
  25    #include <aio.h>
  26    #endif
  27    #ifdef HAVE_SYS_AIO_H
  28    #include <sys/aio.h>
  29    #endif
  30   #endif
  31 # endif
  32 #endif
  33 
  34 void ADIOI_PANFS_Open(ADIO_File fd, int *error_code);
  35 
  36 void ADIOI_PANFS_Open6(ADIO_File fd, int *error_code);
  37 void ADIOI_PANFS_SetInfo(ADIO_File fd, MPI_Info users_info, int *error_code);
  38 void ADIOI_PANFS_ReadContig(ADIO_File fd, void *buf, int count, 
  39                           MPI_Datatype datatype, int file_ptr_type,
  40                           ADIO_Offset offset, ADIO_Status *status,
  41                           int *error_code);
  42 void ADIOI_PANFS_Resize(ADIO_File fd, ADIO_Offset size, int *error_code);
  43 void ADIOI_PANFS_WriteContig(ADIO_File fd, const void *buf, int count,
  44                            MPI_Datatype datatype, int file_ptr_type,
  45                            ADIO_Offset offset, ADIO_Status *status,
  46                            int *error_code);
  47 
  48 
  49 
  50 #if defined(NEEDS_USLEEP_DECL)
  51 int usleep(useconds_t usec);
  52 #endif
  53 
  54 
  55 #define AD_PANFS_RETRY_DELAY 1000
  56 
  57 #define AD_PANFS_RETRY(_op_,_rc_) \
  58 { \
  59     _rc_ = (_op_); \
  60     while(_rc_ == -1 && errno == EAGAIN) \
  61     { \
  62         if(usleep(AD_PANFS_RETRY_DELAY) == -1) \
  63         { \
  64             break; \
  65         } \
  66         _rc_ = (_op_); \
  67     } \
  68 }
  69 
  70 #endif