root/ompi/mca/fbtl/ime/fbtl_ime.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Copyright (c) 2018      DataDirect Networks. All rights reserved.
   3  * $COPYRIGHT$
   4  *
   5  * Additional copyrights may follow
   6  *
   7  * $HEADER$
   8  */
   9 
  10 #ifndef MCA_FBTL_IME_H
  11 #define MCA_FBTL_IME_H
  12 
  13 #include "ime_native.h"
  14 
  15 #include "ompi_config.h"
  16 #include "ompi/mca/mca.h"
  17 #include "ompi/mca/fbtl/fbtl.h"
  18 #include "ompi/mca/common/ompio/common_ompio.h"
  19 #include "ompi/mca/common/ompio/common_ompio_request.h"
  20 
  21 extern int mca_fbtl_ime_priority;
  22 extern int mca_fbtl_ime_iov_max;
  23 extern int mca_fbtl_ime_aio_reqs_max;
  24 
  25 #define FBTL_IME_BASE_PRIORITY      0
  26 #define FBTL_IME_INCREASED_PRIORITY 50
  27 #define FBTL_IME_AIO_REQS_MAX       128
  28 
  29 #ifdef IME_IOV_MAX
  30 #define FBTL_IME_IOV_MAX IME_IOV_MAX
  31 #else
  32 #define FBTL_IME_IOV_MAX 1024
  33 #endif
  34 
  35 
  36 BEGIN_C_DECLS
  37 
  38 int mca_fbtl_ime_component_init_query(bool enable_progress_threads,
  39                                         bool enable_mpi_threads);
  40 struct mca_fbtl_base_module_1_0_0_t *
  41 mca_fbtl_ime_component_file_query (ompio_file_t *file, int *priority);
  42 int mca_fbtl_ime_component_file_unquery (ompio_file_t *file);
  43 
  44 int mca_fbtl_ime_module_init (ompio_file_t *file);
  45 int mca_fbtl_ime_module_finalize (ompio_file_t *file);
  46 
  47 OMPI_MODULE_DECLSPEC extern mca_fbtl_base_component_2_0_0_t mca_fbtl_ime_component;
  48 /*
  49  * ******************************************************************
  50  * ********* functions which are implemented in this module *********
  51  * ******************************************************************
  52  */
  53 
  54 ssize_t mca_fbtl_ime_preadv (ompio_file_t *file );
  55 ssize_t mca_fbtl_ime_pwritev (ompio_file_t *file );
  56 ssize_t mca_fbtl_ime_ipreadv (ompio_file_t *file,
  57                                ompi_request_t *request);
  58 ssize_t mca_fbtl_ime_ipwritev (ompio_file_t *file,
  59                                 ompi_request_t *request);
  60 
  61 bool mca_fbtl_ime_progress     (mca_ompio_request_t *req);
  62 void mca_fbtl_ime_request_free (mca_ompio_request_t *req);
  63 void mca_fbtl_ime_complete_cb  (struct ime_aiocb *aiocb, int err, ssize_t bytes);
  64 
  65 struct mca_fbtl_ime_request_data_t {
  66     int            aio_req_count;       /* total number of aio reqs */
  67     int            aio_open_reqs;       /* number of unfinished reqs */
  68     int            aio_req_type;        /* read or write */
  69     int            aio_req_chunks;      /* max. no. of aio reqs that can be posted at once*/
  70     int            aio_first_active_req; /* first active posted req */
  71     int            aio_last_active_req;  /* last currently active poted req */
  72     int            aio_req_fail_count;   /* number of requests that failed*/
  73     struct iovec      *aio_iovecs;       /* array of iovecs copied from the file handle */
  74     struct ime_aiocb  *aio_reqs;         /* array of aio requests that will be sent to IME */
  75     ssize_t           *aio_req_status;  /* array of status for the IME requests */
  76     ssize_t        aio_total_len;       /* total amount of data written */
  77     ompio_file_t  *aio_fh;       /* pointer back to the mca_io_ompio_fh structure */
  78     void          *allocated_data; /* pointer to the allocated space
  79                             that will contain all the necessary iovecs,
  80                             IME requests and their statuses */
  81 };
  82 typedef struct mca_fbtl_ime_request_data_t mca_fbtl_ime_request_data_t;
  83 
  84 /* define constants for read/write operations */
  85 #define FBTL_IME_READ 1
  86 #define FBTL_IME_WRITE 2
  87 #define FBTL_IME_IN_PROGRESS -1
  88 #define FBTL_IME_REQ_ERROR   -2
  89 #define FBTL_IME_REQ_CLOSED  -3
  90 
  91 /*
  92  * ******************************************************************
  93  * ************ functions implemented in this module end ************
  94  * ******************************************************************
  95  */
  96 
  97 END_C_DECLS
  98 
  99 #endif /* MCA_FBTL_IME_H */

/* [<][>][^][v][top][bottom][index][help] */