root/ompi/mca/topo/example/topo_example_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) 2004-2007 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2013 The University of Tennessee and The University
   7  *                         of Tennessee Research Foundation.  All rights
   8  *                         reserved.
   9  * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
  10  *                         University of Stuttgart.  All rights reserved.
  11  * Copyright (c) 2004-2005 The Regents of the University of California.
  12  *                         All rights reserved.
  13  * Copyright (c) 2009      Cisco Systems, Inc.  All rights reserved.
  14  * Copyright (c) 2012-2013 Inria.  All rights reserved.
  15  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
  16  *                         reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 
  24 #include "ompi_config.h"
  25 #include "ompi/mca/topo/example/topo_example.h"
  26 
  27 /*
  28  * Public string showing the topo example module version number
  29  */
  30 const char *mca_topo_example_component_version_string =
  31     "Open MPI example topology MCA component version" OMPI_VERSION;
  32 
  33 /*
  34  * Local funtions
  35  */
  36 static int init_query(bool enable_progress_threads, bool enable_mpi_threads);
  37 static struct mca_topo_base_module_t *
  38 comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type);
  39 
  40 /*
  41  * Public component structure
  42  */
  43 mca_topo_base_component_2_2_0_t mca_topo_example_component =
  44 {
  45     .topoc_version = {
  46         MCA_TOPO_BASE_VERSION_2_2_0,
  47 
  48         .mca_component_name = "example",
  49         MCA_BASE_MAKE_VERSION(component, OMPI_MAJOR_VERSION, OMPI_MINOR_VERSION,
  50                               OMPI_RELEASE_VERSION),
  51         /* NULLs for the rest of the function pointers */
  52     },
  53 
  54     .topoc_data = {
  55         /* The component is checkpoint ready */
  56         MCA_BASE_METADATA_PARAM_CHECKPOINT
  57     },
  58 
  59     .topoc_init_query = init_query,
  60     .topoc_comm_query = comm_query,
  61 };
  62 
  63 
  64 static int init_query(bool enable_progress_threads, bool enable_mpi_threads)
  65 {
  66     /* Nothing to do */
  67 
  68     return OMPI_SUCCESS;
  69 }
  70 
  71 
  72 static struct mca_topo_base_module_t *
  73 comm_query(const ompi_communicator_t *comm, int *priority, uint32_t type)
  74 {
  75     mca_topo_example_module_t *example = OBJ_NEW(mca_topo_example_module_t);
  76     if (NULL == example) {
  77         return NULL;
  78     }
  79     if( OMPI_COMM_CART == type ) {
  80         example->super.topo.cart.cart_map = mca_topo_example_cart_map;
  81     } else if( OMPI_COMM_GRAPH == type ) {
  82         example->super.topo.graph.graph_map = mca_topo_example_graph_map;
  83     }
  84 
  85     /* This component has very low priority -- it's an example, after all! */
  86     *priority = 0;
  87     example->super.type = type;
  88     return &(example->super);
  89 }
  90 
  91 

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