1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 #ifndef MTL_PORTALS_FLOWCTL_H
  11 #define MTL_PORTALS_FLOWCTL_H
  12 
  13 #include "opal/class/opal_free_list.h"
  14 
  15 #include "mtl_portals4_request.h"
  16 
  17 struct mca_mtl_base_endpoint_t;
  18 struct ompi_mtl_portals4_isend_request_t;
  19 
  20 struct ompi_mtl_portals4_pending_request_t {
  21     opal_free_list_item_t super;
  22     mca_pml_base_send_mode_t mode;
  23     void *start;
  24     size_t length;
  25     int contextid;
  26     int tag;
  27     int my_rank;
  28     int fc_notified;
  29     ptl_process_t ptl_proc;
  30     struct ompi_mtl_portals4_isend_request_t *ptl_request;
  31 };
  32 typedef struct ompi_mtl_portals4_pending_request_t ompi_mtl_portals4_pending_request_t;
  33 OBJ_CLASS_DECLARATION(ompi_mtl_portals4_pending_request_t);
  34 
  35 
  36 struct ompi_mtl_portals4_flowctl_t {
  37     int32_t flowctl_active;
  38 
  39     opal_atomic_int32_t send_slots;
  40     int32_t max_send_slots;
  41     opal_list_t pending_sends;
  42     opal_free_list_t pending_fl;
  43 
  44     ompi_mtl_portals4_base_request_t alert_req;
  45     ompi_mtl_portals4_base_request_t fanout_req;
  46 
  47     
  48 
  49     opal_atomic_int64_t epoch_counter;
  50 
  51     
  52     ptl_handle_ct_t trigger_ct_h;
  53     
  54 
  55 
  56     ptl_handle_me_t trigger_me_h;
  57 
  58     
  59     ptl_handle_ct_t alert_ct_h;
  60     
  61     ptl_handle_me_t alert_me_h;
  62 
  63     
  64     ptl_handle_ct_t fanin_ct_h;
  65     
  66     ptl_handle_me_t fanin_me_h;
  67 
  68     
  69     ptl_handle_ct_t fanout_ct_h;
  70     
  71     ptl_handle_me_t fanout_me_h;
  72 
  73     
  74     struct timeval tv;
  75     int backoff_count;
  76 
  77     size_t num_procs;
  78     size_t num_children;
  79     ptl_process_t children[2];
  80     ptl_process_t parent;
  81     ptl_process_t me;
  82     ptl_process_t root;
  83     bool i_am_root;
  84 };
  85 typedef struct ompi_mtl_portals4_flowctl_t ompi_mtl_portals4_flowctl_t;
  86 
  87 
  88 int ompi_mtl_portals4_flowctl_init(void);
  89 
  90 int ompi_mtl_portals4_flowctl_fini(void);
  91 
  92 int ompi_mtl_portals4_flowctl_add_procs(size_t me,
  93                                         size_t npeers,
  94                                         struct ompi_proc_t **procs);
  95 
  96 int ompi_mtl_portals4_flowctl_trigger(void);
  97 
  98 void ompi_mtl_portals4_pending_list_progress(void);
  99 
 100 #endif