root/opal/mca/btl/ofi/btl_ofi_endpoint.c

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

DEFINITIONS

This source file includes following definitions.
  1. mca_btl_ofi_endpoint_construct
  2. mca_btl_ofi_endpoint_destruct
  3. mca_btl_ofi_endpoint_create

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2014-2018 Los Alamos National Security, LLC. All rights
   4  *                         reserved.
   5  * Copyright (c) 2018      Intel, Inc, All rights reserved
   6  *
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #include "btl_ofi.h"
  15 #include "btl_ofi_endpoint.h"
  16 #include "opal/util/proc.h"
  17 
  18 static void mca_btl_ofi_endpoint_construct (mca_btl_ofi_endpoint_t *endpoint)
  19 {
  20     endpoint->peer_addr = 0;
  21     OBJ_CONSTRUCT(&endpoint->ep_lock, opal_mutex_t);
  22 }
  23 
  24 static void mca_btl_ofi_endpoint_destruct (mca_btl_ofi_endpoint_t *endpoint)
  25 {
  26     endpoint->peer_addr = 0;
  27 
  28     /* set to null, we will free ofi endpoint in module */
  29     endpoint->ofi_endpoint = NULL;
  30 
  31     OBJ_DESTRUCT(&endpoint->ep_lock);
  32 }
  33 
  34 OBJ_CLASS_INSTANCE(mca_btl_ofi_endpoint_t, opal_list_item_t,
  35                    mca_btl_ofi_endpoint_construct,
  36                    mca_btl_ofi_endpoint_destruct);
  37 
  38 mca_btl_base_endpoint_t *mca_btl_ofi_endpoint_create (opal_proc_t *proc, struct fid_ep *ep)
  39 {
  40     mca_btl_ofi_endpoint_t *endpoint = OBJ_NEW(mca_btl_ofi_endpoint_t);
  41 
  42     if (OPAL_UNLIKELY(NULL == endpoint)) {
  43         return NULL;
  44     }
  45 
  46     endpoint->ep_proc = proc;
  47     endpoint->ofi_endpoint = ep;
  48 
  49     return (mca_btl_base_endpoint_t *) endpoint;
  50 }

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