root/ompi/mca/mtl/ofi/mtl_ofi_endpoint.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. ompi_mtl_ofi_get_endpoint

   1 /*
   2  * Copyright (c) 2013-2016 Intel, Inc. All rights reserved
   3  *
   4  * $COPYRIGHT$
   5  *
   6  * Additional copyrights may follow
   7  *
   8  * $HEADER$
   9  */
  10 
  11 #ifndef OMPI_MTL_OFI_ENDPOINT_H
  12 #define OMPI_MTL_OFI_ENDPOINT_H
  13 
  14 BEGIN_C_DECLS
  15 
  16 extern int ompi_mtl_ofi_add_procs(struct mca_mtl_base_module_t *mtl,
  17                                   size_t nprocs,
  18                                   struct ompi_proc_t **procs);
  19 
  20 OBJ_CLASS_DECLARATION(mca_mtl_ofi_endpoint_t);
  21 
  22 /**
  23  * An abstraction that represents a connection to a endpoint process.
  24  * An instance of mca_mtl_ofi_endpoint_t is associated with each process
  25  * and MTL pair at startup. However, connections to the endpoint
  26  * are established dynamically on an as-needed basis:
  27  */
  28 
  29 struct mca_mtl_ofi_endpoint_t {
  30     opal_list_item_t super;
  31 
  32     /** MTL instance that created this connection */
  33     struct mca_mtl_ofi_module_t *mtl_ofi_module;
  34 
  35     /** The peer's fi_addr */
  36     fi_addr_t peer_fiaddr;
  37 };
  38 
  39 typedef struct mca_mtl_ofi_endpoint_t  mca_mtl_ofi_endpoint_t;
  40 
  41 static inline mca_mtl_ofi_endpoint_t *ompi_mtl_ofi_get_endpoint (struct mca_mtl_base_module_t* mtl, ompi_proc_t *ompi_proc)
  42 {
  43     if (OPAL_UNLIKELY(NULL == ompi_proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL])) {
  44         if (OPAL_UNLIKELY(OMPI_SUCCESS != ompi_mtl_ofi_add_procs(mtl, 1, &ompi_proc))) {
  45             /* Fatal error. exit() out */
  46             opal_output(0, "%s:%d: *** The Open MPI OFI MTL is aborting the MPI job (via exit(3)).\n",
  47                            __FILE__, __LINE__);
  48             fflush(stderr);
  49             exit(1);
  50         }
  51     }
  52 
  53     return ompi_proc->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_MTL];
  54 }
  55 
  56 END_C_DECLS
  57 #endif

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