root/ompi/mca/pml/yalla/pml_yalla_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. mca_pml_yalla_component_register
  2. mca_pml_yalla_component_open
  3. mca_pml_yalla_component_close
  4. mca_pml_yalla_component_init
  5. mca_pml_yalla_component_fini

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (C) Mellanox Technologies Ltd. 2001-2011.  ALL RIGHTS RESERVED.
   4  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   5  *                         reserved.
   6  * Copyright (c) 2015 Cisco Systems, Inc.  All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #include "pml_yalla.h"
  15 
  16 #include "ompi/runtime/mpiruntime.h"
  17 
  18 
  19 static int mca_pml_yalla_component_register(void);
  20 static int mca_pml_yalla_component_open(void);
  21 static int mca_pml_yalla_component_close(void);
  22 
  23 static  mca_pml_base_module_t*
  24 mca_pml_yalla_component_init(int* priority, bool enable_progress_threads,
  25                              bool enable_mpi_threads);
  26 static int mca_pml_yalla_component_fini(void);
  27 
  28 
  29 mca_pml_base_component_2_0_0_t mca_pml_yalla_component = {
  30 
  31     /* First, the mca_base_component_t struct containing meta
  32      * information about the component itself */
  33     .pmlm_version = {
  34         MCA_PML_BASE_VERSION_2_0_0,
  35 
  36         .mca_component_name = "yalla",
  37         MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
  38                               OMPI_RELEASE_VERSION),
  39         .mca_open_component = mca_pml_yalla_component_open,
  40         .mca_close_component = mca_pml_yalla_component_close,
  41         .mca_register_component_params = mca_pml_yalla_component_register,
  42     },
  43     .pmlm_data = {
  44         /* This component is not checkpoint ready */
  45         MCA_BASE_METADATA_PARAM_NONE
  46     },
  47 
  48     .pmlm_init = mca_pml_yalla_component_init,
  49     .pmlm_finalize = mca_pml_yalla_component_fini,
  50 };
  51 
  52 static int mca_pml_yalla_component_register(void)
  53 {
  54     ompi_pml_yalla.verbose = 0;
  55     (void) mca_base_component_var_register(&mca_pml_yalla_component.pmlm_version, "verbose",
  56                                            "Verbose level of the yalla component",
  57                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  58                                            OPAL_INFO_LVL_9,
  59                                            MCA_BASE_VAR_SCOPE_LOCAL,
  60                                            &ompi_pml_yalla.verbose);
  61 
  62     ompi_pml_yalla.priority = 50;
  63     (void) mca_base_component_var_register(&mca_pml_yalla_component.pmlm_version, "priority",
  64                                            "Priority of the yalla component",
  65                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  66                                            OPAL_INFO_LVL_3,
  67                                            MCA_BASE_VAR_SCOPE_LOCAL,
  68                                            &ompi_pml_yalla.priority);
  69     return 0;
  70 }
  71 
  72 static int mca_pml_yalla_component_open(void)
  73 {
  74     ompi_pml_yalla.output = opal_output_open(NULL);
  75     opal_output_set_verbosity(ompi_pml_yalla.output, ompi_pml_yalla.verbose);
  76     return mca_pml_yalla_open();
  77 }
  78 
  79 static int mca_pml_yalla_component_close(void)
  80 {
  81     int rc;
  82 
  83     rc = mca_pml_yalla_close();
  84     if (rc != 0) {
  85         return rc;
  86     }
  87 
  88     opal_output_close(ompi_pml_yalla.output);
  89     return 0;
  90 }
  91 
  92 static mca_pml_base_module_t*
  93 mca_pml_yalla_component_init(int* priority, bool enable_progress_threads,
  94                              bool enable_mpi_threads)
  95 {
  96     int ret;
  97 
  98     if ( (ret = mca_pml_yalla_init()) != 0) {
  99         return NULL;
 100     }
 101 
 102     ompi_mpi_dynamics_disable("the Yalla (MXM) PML does not support MPI dynamic process functionality");
 103 
 104     *priority = ompi_pml_yalla.priority;
 105     return &ompi_pml_yalla.super;
 106 }
 107 
 108 static int mca_pml_yalla_component_fini(void)
 109 {
 110     return mca_pml_yalla_cleanup();
 111 }
 112 

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