This source file includes following definitions.
- mca_fbtl_base_find_available
- init_query
- init_query_2_0_0
   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 <stdio.h>
  25 #include <stdlib.h>
  26 
  27 #include "mpi.h"
  28 #include "ompi/constants.h"
  29 #include "opal/class/opal_list.h"
  30 #include "opal/util/output.h"
  31 #include "ompi/mca/mca.h"
  32 #include "opal/mca/base/base.h"
  33 #include "ompi/mca/fbtl/fbtl.h"
  34 #include "ompi/mca/fbtl/base/base.h"
  35 
  36 static int init_query(const mca_base_component_t *m,
  37                       bool enable_progress_threads,
  38                       bool enable_mpi_threads);
  39 static int init_query_2_0_0(const mca_base_component_t *component,
  40                             bool enable_progress_threads,
  41                             bool enable_mpi_threads);
  42 
  43 int mca_fbtl_base_find_available(bool enable_progress_threads,
  44                                bool enable_mpi_threads)
  45 {
  46     mca_base_component_list_item_t *cli, *next;
  47 
  48     
  49 
  50 
  51 
  52     OPAL_LIST_FOREACH_SAFE(cli, next, &ompi_fbtl_base_framework.framework_components, mca_base_component_list_item_t) {
  53          
  54 
  55 
  56          if (OMPI_SUCCESS != init_query(cli->cli_component,
  57                                         enable_progress_threads,
  58                                         enable_mpi_threads)) {
  59              mca_base_component_close(cli->cli_component, ompi_fbtl_base_framework.framework_output);
  60              opal_list_remove_item(&ompi_fbtl_base_framework.framework_components, &cli->super);
  61              OBJ_RELEASE(cli);
  62          }
  63      }
  64 
  65     
  66     if (0 == opal_list_get_size(&ompi_fbtl_base_framework.framework_components)) {
  67          opal_output_verbose (10, ompi_fbtl_base_framework.framework_output,
  68                               "fbtl:find_available: no fbtl components available!");
  69          return OMPI_ERROR;
  70      }
  71 
  72      
  73      return OMPI_SUCCESS;
  74 }
  75 
  76 
  77 static int init_query(const mca_base_component_t *m,
  78                       bool enable_progress_threads,
  79                       bool enable_mpi_threads)
  80 {
  81     int ret;
  82 
  83     opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
  84                         "fbtl:find_available: querying fbtl component %s",
  85                         m->mca_component_name);
  86 
  87     
  88     if (2 == m->mca_type_major_version &&
  89         0 == m->mca_type_minor_version &&
  90         0 == m->mca_type_release_version) {
  91         ret = init_query_2_0_0(m, enable_progress_threads,
  92                                enable_mpi_threads);
  93     } else {
  94         
  95         opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
  96                             "fbtl:find_available:unrecognised fbtl API version (%d.%d.%d)",
  97                             m->mca_type_major_version,
  98                             m->mca_type_minor_version,
  99                             m->mca_type_release_version);
 100         return OMPI_ERROR;
 101     }
 102 
 103     
 104     if (OMPI_SUCCESS != ret) {
 105         opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
 106                             "fbtl:find_available fbtl component %s is not available",
 107                             m->mca_component_name);
 108     } else {
 109         opal_output_verbose(10, ompi_fbtl_base_framework.framework_output,
 110                             "fbtl:find_avalable: fbtl component %s is available",
 111                             m->mca_component_name);
 112 
 113     }
 114     
 115     return ret;
 116 }
 117 
 118 
 119 static int init_query_2_0_0(const mca_base_component_t *component,
 120                             bool enable_progress_threads,
 121                             bool enable_mpi_threads)
 122 {
 123     mca_fbtl_base_component_2_0_0_t *fbtl =
 124         (mca_fbtl_base_component_2_0_0_t *) component;
 125 
 126     return fbtl->fbtlm_init_query(enable_progress_threads,
 127                                   enable_mpi_threads);
 128 }