root/ompi/mca/topo/treematch/topo_treematch_component.c

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

DEFINITIONS

This source file includes following definitions.
  1. init_query
  2. comm_query
  3. mca_topo_treematch_component_register

   1 /*
   2  * Copyright (c) 2011-2015 The University of Tennessee and The University
   3  *                         of Tennessee Research Foundation.  All rights
   4  *                         reserved.
   5  * Copyright (c) 2011-2015 INRIA.  All rights reserved.
   6  * Copyright (c) 2011-2015 Université Bordeaux 1
   7  * Copyright (c) 2016      Intel, Inc.  All rights reserved.
   8  * $COPYRIGHT$
   9  *
  10  * Additional copyrights may follow
  11  *
  12  * $HEADER$
  13  */
  14 
  15 #include "ompi_config.h"
  16 #include "ompi/mca/topo/treematch/topo_treematch.h"
  17 
  18 /*
  19  * Public string showing the topo treematch module version number
  20  */
  21 const char *mca_topo_treematch_component_version_string =
  22     "Open MPI treematch topology MCA component version" OMPI_VERSION;
  23 
  24 /*
  25  * Local funtions
  26  */
  27 static int init_query(bool enable_progress_threads, bool enable_mpi_threads);
  28 static struct mca_topo_base_module_t *
  29 comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type);
  30 static int mca_topo_treematch_component_register(void);
  31 
  32 /*
  33  * Public component structure
  34  */
  35 mca_topo_treematch_component_2_2_0_t mca_topo_treematch_component =
  36     {
  37         {
  38             {
  39                 MCA_TOPO_BASE_VERSION_2_2_0,
  40 
  41                 "treematch",
  42                 OMPI_MAJOR_VERSION,
  43                 OMPI_MINOR_VERSION,
  44                 OMPI_RELEASE_VERSION,
  45                 NULL,  /* component open */
  46                 NULL,  /* component close */
  47                 NULL, /* component query */
  48                 mca_topo_treematch_component_register, /* component register */
  49             },
  50 
  51             {
  52                 /* The component is checkpoint ready */
  53                 MCA_BASE_METADATA_PARAM_CHECKPOINT
  54             },
  55 
  56             init_query,
  57             comm_query
  58         },
  59         0  /* reorder: by default centralized */
  60     };
  61 
  62 
  63 static int init_query(bool enable_progress_threads, bool enable_mpi_threads)
  64 {
  65     /* The first time this function is called is too early in the process and
  66      * the HWLOC topology information is not available. Thus we should not check
  67      * for the topology here, but instead delay the check until we really need
  68      * the topology information.
  69      */
  70     return OMPI_SUCCESS;
  71 }
  72 
  73 
  74 static struct mca_topo_base_module_t *
  75 comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type)
  76 {
  77     mca_topo_treematch_module_t *treematch;
  78 
  79     if( OMPI_COMM_DIST_GRAPH != type ) {
  80         return NULL;
  81     }
  82     treematch = OBJ_NEW(mca_topo_treematch_module_t);
  83     if (NULL == treematch) {
  84         return NULL;
  85     }
  86     treematch->super.topo.dist_graph.dist_graph_create = mca_topo_treematch_dist_graph_create;
  87 
  88     /* This component has very low priority -- it's an treematch, after
  89        all! */
  90     *priority = 42;
  91     treematch->super.type = OMPI_COMM_DIST_GRAPH;
  92     return &(treematch->super);
  93 }
  94 
  95 static int mca_topo_treematch_component_register(void)
  96 {
  97     (void)mca_base_component_var_register(&mca_topo_treematch_component.super.topoc_version,
  98                                           "reorder_mode", "If set the reordering will be done in a partially distributed way (default=0). If partially-distributed only local knowledge will be used, possibly leading to less accurate reordering.", MCA_BASE_VAR_TYPE_INT,
  99                                           NULL, 0, 0, OPAL_INFO_LVL_2,
 100                                           MCA_BASE_VAR_SCOPE_READONLY, &mca_topo_treematch_component.reorder_mode);
 101     return OMPI_SUCCESS;
 102 }
 103 

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