root/ompi/mca/vprotocol/example/vprotocol_example_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. mca_vprotocol_example_component_open
  2. mca_vprotocol_example_component_close
  3. mca_vprotocol_example_component_init
  4. mca_vprotocol_example_component_finalize

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2007 The Trustees of the University of Tennessee.
   4  *                         All rights reserved.
   5  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
   6  *                         reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #include "ompi_config.h"
  15 
  16 #include "ompi/mca/mca.h"
  17 #include "../pml_v.h"
  18 #include "../pml_v_protocol_base.h"
  19 #include "vprotocol_example.h"
  20 
  21 static int mca_vprotocol_example_component_open(void);
  22 static int mca_vprotocol_example_component_close(void);
  23 
  24 static mca_pml_v_protocol_base_module_t *mca_vprotocol_example_component_init( int* priority,
  25                             bool, bool);
  26 static int mca_vprotocol_example_component_finalize(void);
  27 
  28 
  29 static int _priority;
  30 
  31 
  32 mca_pml_v_protocol_base_component_2_0_0_t mca_vprotocol_example_component =
  33 {
  34   /* First, the mca_base_component_t struct containing meta
  35    * information about the component itself */
  36   .pmlm_version = {
  37     MCA_VPROTOCOL_BASE_VERSION_2_0_0,
  38 
  39     .mca_component_name = "example",
  40     MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
  41                           OMPI_RELEASE_VERSION),
  42     .mca_open_component = mca_vprotocol_example_component_open,
  43     .mca_close_component = mca_vprotocol_example_component_close,
  44   },
  45   .pmlm_data = {
  46       /* component is not checkpointable */
  47       MCA_BASE_METADATA_PARAM_NONE
  48   },
  49 
  50   .pmlm_init = mca_vprotocol_example_component_init,
  51   .pmlm_finalize = mca_vprotocol_example_component_finalize,
  52 };
  53 
  54 /** MCA level functions
  55   */
  56 
  57 int mca_vprotocol_example_component_open(void)
  58 {
  59   _priority = mca_param_register_int( "priority", -1);
  60   V_OUTPUT_VERBOSE(10, "vprotocol_example_open, read priority %d", _priority);
  61   return OMPI_SUCCESS;
  62 }
  63 
  64 int mca_vprotocol_example_component_close(void)
  65 {
  66   V_OUTPUT_VERBOSE(10, "vprotocol_example_close");
  67   return OMPI_SUCCESS;
  68 }
  69 
  70 /** VPROTOCOL level functions (same as PML one)
  71   */
  72 
  73 mca_pml_v_protocol_base_module_t *mca_vprotocol_example_component_init( int* priority,
  74                                                                           bool enable_progress_threads,
  75                                                                           bool enable_mpi_threads)
  76 {
  77   V_OUTPUT_VERBOSE(10, "vprotocol_example_init");
  78   *priority = _priority;
  79 
  80 /**
  81   * Some protocols requires sanity check about thread support (those making piecewise deterministic assumption)
  82   if(enable_mpi_threads)
  83   {
  84     OPAL_OUTPUT_VERBOSE( mca_pml_v_verbose, mca_pml_v_output, "vprotocol_example.init: threads are enabled, and not supported by vprotocol example fault tolerant layer, will not load"));
  85     return NULL;
  86   }
  87   */
  88 
  89 /**
  90   * Insert your own protocol initialization here
  91   */
  92 
  93   return &mca_vprotocol_example.super;
  94 }
  95 
  96 int mca_vprotocol_example_component_finalize(void)
  97 {
  98   V_OUTPUT_VERBOSE(10, "vprotocol_example_finalize");
  99 
 100 /**
 101   * Insert your own garbage collecting here
 102   */
 103 
 104   return OMPI_SUCCESS;
 105 }

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