root/orte/mca/routed/base/routed_base_frame.c

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

DEFINITIONS

This source file includes following definitions.
  1. orte_routed_base_open
  2. orte_routed_base_close
  3. orte_routed_base_select
  4. construct
  5. destruct

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2007-2015 Los Alamos National Security, LLC. All rights
   4  *                         reserved.
   5  * Copyright (c) 2007      Sun Microsystems, Inc.  All rights reserved.
   6  * Copyright (c) 2004-2010 The Trustees of Indiana University.
   7  *                         All rights reserved.
   8  * Copyright (c) 2004-2011 The University of Tennessee and The University
   9  *                         of Tennessee Research Foundation.  All rights
  10  *                         reserved.
  11  * Copyright (c) 2015      Research Organization for Information Science
  12  *                         and Technology (RIST). All rights reserved.
  13  * Copyright (c) 2016-2019 Intel, Inc.  All rights reserved.
  14  * $COPYRIGHT$
  15  *
  16  * Additional copyrights may follow
  17  *
  18  * $HEADER$
  19  */
  20 
  21 #include "orte_config.h"
  22 #include "orte/constants.h"
  23 
  24 #include "orte/mca/mca.h"
  25 #include "opal/class/opal_bitmap.h"
  26 #include "opal/util/output.h"
  27 #include "opal/mca/base/mca_base_component_repository.h"
  28 
  29 #include "orte/mca/errmgr/errmgr.h"
  30 #include "orte/util/proc_info.h"
  31 #include "orte/runtime/orte_globals.h"
  32 
  33 #include "orte/mca/routed/routed.h"
  34 #include "orte/mca/routed/base/base.h"
  35 
  36 
  37 /* The following file was created by configure.  It contains extern
  38  * statements and the definition of an array of pointers to each
  39  * component's public mca_base_component_t struct. */
  40 #include "orte/mca/routed/base/static-components.h"
  41 
  42 orte_routed_base_t orte_routed_base = {0};
  43 orte_routed_module_t orte_routed = {0};
  44 
  45 static int orte_routed_base_open(mca_base_open_flag_t flags)
  46 {
  47     /* start with routing DISABLED */
  48     orte_routed_base.routing_enabled = false;
  49 
  50     /* Open up all available components */
  51     return mca_base_framework_components_open(&orte_routed_base_framework, flags);
  52 }
  53 
  54 static int orte_routed_base_close(void)
  55 {
  56     orte_routed_base.routing_enabled = false;
  57     if (NULL != orte_routed.finalize) {
  58         orte_routed.finalize();
  59     }
  60     return mca_base_framework_components_close(&orte_routed_base_framework, NULL);
  61 }
  62 
  63 MCA_BASE_FRAMEWORK_DECLARE(orte, routed, "ORTE Message Routing Subsystem", NULL,
  64                            orte_routed_base_open, orte_routed_base_close,
  65                            mca_routed_base_static_components, 0);
  66 
  67 int orte_routed_base_select(void)
  68 {
  69     orte_routed_component_t *best_component = NULL;
  70     orte_routed_module_t *best_module = NULL;
  71 
  72     /*
  73      * Select the best component
  74      */
  75     if( OPAL_SUCCESS != mca_base_select("routed", orte_routed_base_framework.framework_output,
  76                                         &orte_routed_base_framework.framework_components,
  77                                         (mca_base_module_t **) &best_module,
  78                                         (mca_base_component_t **) &best_component, NULL) ) {
  79         /* This will only happen if no component was selected */
  80         /* If we didn't find one to select, that is an error */
  81         return ORTE_ERROR;
  82     }
  83 
  84     /* Save the winner */
  85     orte_routed = *best_module;
  86     if (NULL != orte_routed.initialize) {
  87         orte_routed.initialize();
  88     }
  89     return ORTE_SUCCESS;
  90 }
  91 
  92 static void construct(orte_routed_tree_t *rt)
  93 {
  94     rt->vpid = ORTE_VPID_INVALID;
  95     OBJ_CONSTRUCT(&rt->relatives, opal_bitmap_t);
  96 }
  97 static void destruct(orte_routed_tree_t *rt)
  98 {
  99     OBJ_DESTRUCT(&rt->relatives);
 100 }
 101 OBJ_CLASS_INSTANCE(orte_routed_tree_t,
 102                    opal_list_item_t,
 103                    construct, destruct);

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