root/ompi/mca/topo/basic/topo_basic_component.c

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

DEFINITIONS

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

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2011-2013 The University of Tennessee and The University
   4  *                         of Tennessee Research Foundation.  All rights
   5  *                         reserved.
   6  * Copyright (c) 2011-2013 INRIA.  All rights reserved.
   7  * Copyright (c) 2011-2013 Université Bordeaux 1
   8  * Copyright (c) 2014      Research Organization for Information Science
   9  *                         and Technology (RIST). All rights reserved.
  10  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
  11  *                         reserved.
  12  * $COPYRIGHT$
  13  *
  14  * Additional copyrights may follow
  15  *
  16  * $HEADER$
  17  */
  18 
  19 #include "ompi_config.h"
  20 #include "ompi/mca/topo/basic/topo_basic.h"
  21 
  22 /*
  23  * Public string showing the topo basic module version number
  24  */
  25 const char *mca_topo_basic_component_version_string =
  26     "Open MPI basic topology MCA component version" OMPI_VERSION;
  27 
  28 /*
  29  * Local funtions
  30  */
  31 static int init_query(bool enable_progress_threads, bool enable_mpi_threads);
  32 static struct mca_topo_base_module_t *
  33 comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type);
  34 
  35 /*
  36  * Public component structure
  37  */
  38 mca_topo_basic_component_t mca_topo_basic_component =
  39 {
  40     .topoc_version = {
  41         MCA_TOPO_BASE_VERSION_2_2_0,
  42         .mca_component_name = "basic",
  43         .mca_component_major_version = OMPI_MAJOR_VERSION,
  44         .mca_component_minor_version = OMPI_MINOR_VERSION,
  45         .mca_component_release_version = OMPI_RELEASE_VERSION,
  46         /* NULLs for the rest of the function pointers */
  47     },
  48 
  49     .topoc_data = {
  50         /* The component is checkpoint ready */
  51         MCA_BASE_METADATA_PARAM_CHECKPOINT
  52     },
  53 
  54     .topoc_init_query = init_query,
  55     .topoc_comm_query = comm_query,
  56 };
  57 
  58 
  59 static int init_query(bool enable_progress_threads, bool enable_mpi_threads)
  60 {
  61     /* Nothing to do */
  62     return OMPI_SUCCESS;
  63 }
  64 
  65 
  66 static struct mca_topo_base_module_t *
  67 comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type)
  68 {
  69     /* Don't use OBJ_NEW, we need to zero the memory or the functions pointers
  70      * will not be correctly copied over from the base.
  71      */
  72     mca_topo_base_module_t *basic = calloc(1, sizeof(mca_topo_base_module_t));
  73 
  74     if (NULL == basic) {
  75         return NULL;
  76     }
  77     OBJ_CONSTRUCT(basic, mca_topo_base_module_t);
  78 
  79     /* This component has very low priority -- it's a basic, after all! */
  80     *priority = 0;
  81     basic->type = type;
  82     return basic;
  83 }
  84 
  85 

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