root/ompi/mca/pml/example/pml_example_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. mca_pml_example_component_register
  2. mca_pml_example_component_open
  3. mca_pml_example_component_close
  4. mca_pml_example_component_init
  5. mca_pml_example_component_fini

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2005 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
  10  *                         reserved.
  11  * $COPYRIGHT$
  12  *
  13  * Additional copyrights may follow
  14  *
  15  * $HEADER$
  16  */
  17 
  18 #include "ompi_config.h"
  19 
  20 #include "opal/mca/event/event.h"
  21 #include "pml_example.h"
  22 
  23 static int mca_pml_example_component_register(void);
  24 static int mca_pml_example_component_open(void);
  25 static int mca_pml_example_component_close(void);
  26 static mca_pml_base_module_t* mca_pml_example_component_init( int* priority,
  27                             bool *allow_multi_user_threads, bool *have_hidden_threads );
  28 static int mca_pml_example_component_fini(void);
  29 
  30 static int mca_pml_example_priority = 0;
  31 
  32 mca_pml_base_component_2_0_0_t mca_pml_example_component = {
  33 
  34     /* First, the mca_base_component_t struct containing meta
  35      * information about the component itself */
  36 
  37     .pmlm_version = {
  38         MCA_PML_BASE_VERSION_2_0_0,
  39 
  40         .mca_component_name = "example",
  41         MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
  42                               OMPI_RELEASE_VERSION),
  43         .mca_open_component = mca_pml_example_component_open,
  44         .mca_close_component = mca_pml_example_component_close,
  45         .mca_register_component_params = mca_pml_example_component_register,
  46     },
  47     .pmlm_data = {
  48         /* The component is checkpoint ready */
  49         MCA_BASE_METADATA_PARAM_CHECKPOINT
  50     },
  51 
  52     .pmlm_init = mca_pml_example_component_init,
  53     .pmlm_finalize = mca_pml_example_component_fini,
  54 };
  55 
  56 static int mca_pml_example_component_register(void)
  57 {
  58     mca_pml_example_priority = 0;
  59     (void) mca_base_component_var_register(&mca_pml_example_component.pmlm_version,
  60                                            "priority", "Priority of the pml example component",
  61                                            MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  62                                            OPAL_INFO_LVL_9,
  63                                            MCA_BASE_VAR_SCOPE_READONLY,
  64                                            &mca_pml_example_priority);
  65 
  66     return OMPI_SUCCESS;
  67 }
  68 
  69 static int mca_pml_example_component_open(void)
  70 {
  71     return OMPI_SUCCESS;
  72 }
  73 
  74 static int mca_pml_example_component_close(void)
  75 {
  76     return OMPI_SUCCESS;
  77 }
  78 
  79 static mca_pml_base_module_t*
  80 mca_pml_example_component_init( int* priority,
  81                             bool *allow_multi_user_threads,
  82                             bool *have_hidden_threads )
  83 {
  84     *priority = mca_pml_example_priority;
  85     *have_hidden_threads = false;
  86     *allow_multi_user_threads &= true;
  87     return &mca_pml_example.super;
  88 }
  89 
  90 static int mca_pml_example_component_fini(void)
  91 {
  92     return OMPI_SUCCESS;
  93 }
  94 

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