1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 #ifndef OSC_PORTALS4_REQUEST_H
  14 #define OSC_PORTALS4_REQUEST_H
  15 
  16 #include "ompi/request/request.h"
  17 
  18 struct ompi_osc_portals4_request_t {
  19     ompi_request_t super;
  20     int32_t ops_expected;
  21     opal_atomic_int32_t ops_committed;
  22 };
  23 typedef struct ompi_osc_portals4_request_t ompi_osc_portals4_request_t;
  24 
  25 OBJ_CLASS_DECLARATION(ompi_osc_portals4_request_t);
  26 
  27 #define OMPI_OSC_PORTALS4_REQUEST_ALLOC(win, req)                       \
  28     do {                                                                \
  29         opal_free_list_item_t *item;                                    \
  30         item = opal_free_list_wait(&mca_osc_portals4_component.requests); \
  31         req = (ompi_osc_portals4_request_t*) item;                      \
  32         OMPI_REQUEST_INIT(&req->super, false);                          \
  33         req->super.req_mpi_object.win = win;                            \
  34         req->super.req_complete = false;                                \
  35         req->super.req_state = OMPI_REQUEST_ACTIVE;                     \
  36         req->super.req_status.MPI_ERROR = MPI_SUCCESS;                  \
  37         req->ops_expected = 0;                                          \
  38         req->ops_committed = 0;                                         \
  39     } while (0)
  40 
  41 #define OMPI_OSC_PORTALS4_REQUEST_RETURN(req)                           \
  42     do {                                                                \
  43         OMPI_REQUEST_FINI(&request->super);                             \
  44         opal_free_list_return (&mca_osc_portals4_component.requests,    \
  45                               (opal_free_list_item_t*) req);            \
  46     } while (0)
  47 
  48 
  49 #endif