This source file includes following definitions.
- ompi_mtl_base_select
- ompi_mtl_base_close
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 #include "ompi_config.h"
  23 
  24 #include "ompi/mca/mca.h"
  25 #include "opal/util/output.h"
  26 #include "opal/mca/base/base.h"
  27 
  28 
  29 #include "ompi/constants.h"
  30 #include "ompi/mca/mtl/mtl.h"
  31 #include "ompi/mca/mtl/base/base.h"
  32 
  33 
  34 
  35 
  36 
  37 
  38 
  39 #include "ompi/mca/mtl/base/static-components.h"
  40 
  41 mca_mtl_base_component_t *ompi_mtl_base_selected_component = NULL;
  42 mca_mtl_base_module_t *ompi_mtl = NULL;
  43 
  44 
  45 
  46 
  47 
  48 
  49 
  50 
  51 int
  52 ompi_mtl_base_select (bool enable_progress_threads,
  53                       bool enable_mpi_threads,
  54                       int *priority)
  55 {
  56     int ret = OMPI_ERR_NOT_FOUND;
  57     mca_mtl_base_component_t *best_component = NULL;
  58     mca_mtl_base_module_t *best_module = NULL;
  59     int best_priority;
  60 
  61     
  62 
  63 
  64     if( OPAL_SUCCESS != mca_base_select("mtl", ompi_mtl_base_framework.framework_output,
  65                                         &ompi_mtl_base_framework.framework_components,
  66                                         (mca_base_module_t **) &best_module,
  67                                         (mca_base_component_t **) &best_component,
  68                                         &best_priority) ) {
  69         
  70         return ret;
  71     }
  72 
  73     opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
  74                          "select: initializing %s component %s",
  75                          best_component->mtl_version.mca_type_name,
  76                          best_component->mtl_version.mca_component_name );
  77 
  78     if (NULL == best_component->mtl_init(enable_progress_threads,
  79                                           enable_mpi_threads)) {
  80         opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
  81                              "select: init returned failure for component %s",
  82                              best_component->mtl_version.mca_component_name );
  83     } else {
  84         opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
  85                              "select: init returned success");
  86         ompi_mtl_base_selected_component = best_component;
  87         ompi_mtl = best_module;
  88         *priority = best_priority;
  89         ret = OMPI_SUCCESS;
  90     }
  91 
  92     
  93     if (NULL == ompi_mtl) {
  94         opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
  95                              "select: no component selected");
  96     } else {
  97         opal_output_verbose( 10, ompi_mtl_base_framework.framework_output,
  98                              "select: component %s selected",
  99                              ompi_mtl_base_selected_component->
 100                              mtl_version.mca_component_name );
 101     }
 102     return ret;
 103 }
 104 
 105 
 106 static int
 107 ompi_mtl_base_close(void)
 108 {
 109     
 110     ompi_mtl = NULL;
 111     ompi_mtl_base_selected_component = NULL;
 112 
 113     
 114 
 115     return mca_base_framework_components_close(&ompi_mtl_base_framework, NULL);
 116 }
 117 
 118 MCA_BASE_FRAMEWORK_DECLARE(ompi, mtl, NULL, NULL, NULL, ompi_mtl_base_close,
 119                            mca_mtl_base_static_components, 0);