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

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

DEFINITIONS

This source file includes following definitions.
  1. request_cancel
  2. request_free
  3. request_construct
  4. req_completion

   1 /*
   2  * Copyright (C) Mellanox Technologies Ltd. 2001-2017. ALL RIGHTS RESERVED.
   3  * $COPYRIGHT$
   4  *
   5  * Additional copyrights may follow
   6  *
   7  * $HEADER$
   8  */
   9 
  10 #include "ompi_config.h"
  11 
  12 #include "ompi/request/request.h"
  13 #include "ompi/mca/osc/osc.h"
  14 #include "ompi/mca/osc/base/base.h"
  15 #include "ompi/mca/osc/base/osc_base_obj_convert.h"
  16 
  17 #include "osc_ucx.h"
  18 #include "osc_ucx_request.h"
  19 
  20 static int request_cancel(struct ompi_request_t *request, int complete)
  21 {
  22     return MPI_ERR_REQUEST;
  23 }
  24 
  25 static int request_free(struct ompi_request_t **ompi_req)
  26 {
  27     ompi_osc_ucx_request_t *request = (ompi_osc_ucx_request_t*) *ompi_req;
  28 
  29     if (true != (bool)(request->super.req_complete)) {
  30         return MPI_ERR_REQUEST;
  31     }
  32 
  33     OMPI_OSC_UCX_REQUEST_RETURN(request);
  34 
  35     *ompi_req = MPI_REQUEST_NULL;
  36 
  37     return OMPI_SUCCESS;
  38 }
  39 
  40 static void request_construct(ompi_osc_ucx_request_t *request)
  41 {
  42     request->super.req_type = OMPI_REQUEST_WIN;
  43     request->super.req_status._cancelled = 0;
  44     request->super.req_free = request_free;
  45     request->super.req_cancel = request_cancel;
  46 }
  47 
  48 void req_completion(void *request) {
  49     ompi_osc_ucx_request_t *req = (ompi_osc_ucx_request_t *)request;
  50     ompi_request_complete(&(req->super), true);
  51     mca_osc_ucx_component.num_incomplete_req_ops--;
  52     assert(mca_osc_ucx_component.num_incomplete_req_ops >= 0);
  53 }
  54 
  55 OBJ_CLASS_INSTANCE(ompi_osc_ucx_request_t, ompi_request_t,
  56                    request_construct, NULL);

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