root/ompi/mca/osc/ucx/osc_ucx_request.h

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

INCLUDED FROM


   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2011-2013 Sandia National Laboratories.  All rights reserved.
   4  * Copyright (c) 2015      Los Alamos National Security, LLC.  All rights
   5  *                         reserved.
   6  * Copyright (C) Mellanox Technologies Ltd. 2001-2017. ALL RIGHTS RESERVED.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #ifndef OMPI_OSC_UCX_REQUEST_H
  15 #define OMPI_OSC_UCX_REQUEST_H
  16 
  17 #include "ompi/request/request.h"
  18 
  19 typedef struct ompi_osc_ucx_request {
  20     ompi_request_t super;
  21 } ompi_osc_ucx_request_t;
  22 
  23 OBJ_CLASS_DECLARATION(ompi_osc_ucx_request_t);
  24 
  25 #define OMPI_OSC_UCX_REQUEST_ALLOC(win, req)                            \
  26     do {                                                                \
  27         opal_free_list_item_t *item;                                    \
  28         do {                                                            \
  29             item = opal_free_list_get(&mca_osc_ucx_component.requests); \
  30             if (item == NULL) {                                         \
  31                 if (mca_osc_ucx_component.num_incomplete_req_ops > 0) { \
  32                     opal_common_ucx_wpool_progress(mca_osc_ucx_component.wpool); \
  33                 }                                                       \
  34             }                                                           \
  35         } while (item == NULL);                                         \
  36         req = (ompi_osc_ucx_request_t*) item;                           \
  37         OMPI_REQUEST_INIT(&req->super, false);                          \
  38         req->super.req_mpi_object.win = win;                            \
  39         req->super.req_complete = false;                                \
  40         req->super.req_state = OMPI_REQUEST_ACTIVE;                     \
  41         req->super.req_status.MPI_ERROR = MPI_SUCCESS;                  \
  42     } while (0)
  43 
  44 #define OMPI_OSC_UCX_REQUEST_RETURN(req)                                \
  45     do {                                                                \
  46         OMPI_REQUEST_FINI(&request->super);                             \
  47         opal_free_list_return (&mca_osc_ucx_component.requests,         \
  48                                (opal_free_list_item_t*) req);           \
  49     } while (0)
  50 
  51 void req_completion(void *request);
  52 
  53 #endif /* OMPI_OSC_UCX_REQUEST_H */

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