root/orte/mca/oob/base/oob_base_frame.c

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

DEFINITIONS

This source file includes following definitions.
  1. orte_oob_base_register
  2. orte_oob_base_close
  3. orte_oob_base_open
  4. pr_cons
  5. pr_des

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2005 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) 2007      Cisco Systems, Inc.  All rights reserved.
  14  * Copyright (c) 2013-2017 Los Alamos National Security, LLC. All rights
  15  *                         reserved.
  16  * Copyright (c) 2015-2016 Research Organization for Information Science
  17  *                         and Technology (RIST). All rights reserved.
  18  * Copyright (c) 2017      Intel, Inc.  All rights reserved.
  19  * $COPYRIGHT$
  20  *
  21  * Additional copyrights may follow
  22  *
  23  * $HEADER$
  24  */
  25 
  26 
  27 #include "orte_config.h"
  28 #include "orte/constants.h"
  29 
  30 #include "opal/class/opal_bitmap.h"
  31 #include "orte/mca/mca.h"
  32 #include "opal/runtime/opal_progress_threads.h"
  33 #include "opal/util/output.h"
  34 #include "opal/mca/base/base.h"
  35 
  36 #include "orte/mca/rml/base/base.h"
  37 #include "orte/mca/oob/base/base.h"
  38 
  39 #if OPAL_ENABLE_FT_CR == 1
  40 #include "orte/mca/state/state.h"
  41 #endif
  42 
  43 /*
  44  * The following file was created by configure.  It contains extern
  45  * statements and the definition of an array of pointers to each
  46  * component's public mca_base_component_t struct.
  47  */
  48 
  49 #include "orte/mca/oob/base/static-components.h"
  50 
  51 /*
  52  * Global variables
  53  */
  54 orte_oob_base_t orte_oob_base = {0};
  55 
  56 static int orte_oob_base_register(mca_base_register_flag_t flags)
  57 {
  58     orte_oob_base.num_threads = 0;
  59     (void)mca_base_var_register("orte", "oob", "base", "num_progress_threads",
  60                                 "Number of independent progress OOB messages for each interface",
  61                                 MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
  62                                 OPAL_INFO_LVL_9,
  63                                 MCA_BASE_VAR_SCOPE_READONLY,
  64                                 &orte_oob_base.num_threads);
  65 
  66 #if OPAL_ENABLE_TIMING
  67     /* Detailed timing setup */
  68     orte_oob_base.timing = false;
  69     (void) mca_base_var_register ("orte", "oob", "base", "timing",
  70                                   "Enable OOB timings",
  71                                   MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
  72                                   OPAL_INFO_LVL_9, MCA_BASE_VAR_SCOPE_READONLY,
  73                                   &orte_oob_base.timing);
  74 #endif
  75     return ORTE_SUCCESS;
  76 }
  77 
  78 static int orte_oob_base_close(void)
  79 {
  80     mca_oob_base_component_t *component;
  81     mca_base_component_list_item_t *cli;
  82     opal_object_t *value;
  83     uint64_t key;
  84 
  85     /* shutdown all active transports */
  86     while (NULL != (cli = (mca_base_component_list_item_t *) opal_list_remove_first (&orte_oob_base.actives))) {
  87         component = (mca_oob_base_component_t*)cli->cli_component;
  88         if (NULL != component->shutdown) {
  89             component->shutdown();
  90         }
  91         OBJ_RELEASE(cli);
  92     }
  93 
  94     if (!ORTE_PROC_IS_APP && !ORTE_PROC_IS_TOOL) {
  95         opal_progress_thread_finalize("OOB-BASE");
  96     }
  97 
  98     /* destruct our internal lists */
  99     OBJ_DESTRUCT(&orte_oob_base.actives);
 100 
 101     /* release all peers from the hash table */
 102     OPAL_HASH_TABLE_FOREACH(key, uint64, value, &orte_oob_base.peers) {
 103         if (NULL != value) {
 104             OBJ_RELEASE(value);
 105         }
 106     }
 107 
 108     OBJ_DESTRUCT(&orte_oob_base.peers);
 109 
 110     return mca_base_framework_components_close(&orte_oob_base_framework, NULL);
 111 }
 112 
 113 /**
 114  * Function for finding and opening either all MCA components,
 115  * or the one that was specifically requested via a MCA parameter.
 116  */
 117 static int orte_oob_base_open(mca_base_open_flag_t flags)
 118 {
 119     /* setup globals */
 120     orte_oob_base.max_uri_length = -1;
 121     OBJ_CONSTRUCT(&orte_oob_base.peers, opal_hash_table_t);
 122     opal_hash_table_init(&orte_oob_base.peers, 128);
 123     OBJ_CONSTRUCT(&orte_oob_base.actives, opal_list_t);
 124 
 125     if (ORTE_PROC_IS_APP || ORTE_PROC_IS_TOOL) {
 126         orte_oob_base.ev_base = orte_event_base;
 127     } else {
 128         orte_oob_base.ev_base = opal_progress_thread_init("OOB-BASE");
 129     }
 130 
 131 
 132 #if OPAL_ENABLE_FT_CR == 1
 133     /* register the FT events callback */
 134     orte_state.add_job_state(ORTE_JOB_STATE_FT_CHECKPOINT, orte_oob_base_ft_event, ORTE_ERROR_PRI);
 135     orte_state.add_job_state(ORTE_JOB_STATE_FT_CONTINUE, orte_oob_base_ft_event, ORTE_ERROR_PRI);
 136     orte_state.add_job_state(ORTE_JOB_STATE_FT_RESTART, orte_oob_base_ft_event, ORTE_ERROR_PRI);
 137 #endif
 138 
 139      /* Open up all available components */
 140     return mca_base_framework_components_open(&orte_oob_base_framework, flags);
 141 }
 142 
 143 MCA_BASE_FRAMEWORK_DECLARE(orte, oob, "Out-of-Band Messaging Subsystem",
 144                            orte_oob_base_register, orte_oob_base_open, orte_oob_base_close,
 145                            mca_oob_base_static_components, 0);
 146 
 147 
 148 OBJ_CLASS_INSTANCE(orte_oob_send_t,
 149                    opal_object_t,
 150                    NULL, NULL);
 151 
 152 static void pr_cons(orte_oob_base_peer_t *ptr)
 153 {
 154     ptr->component = NULL;
 155     OBJ_CONSTRUCT(&ptr->addressable, opal_bitmap_t);
 156     opal_bitmap_init(&ptr->addressable, 8);
 157 }
 158 static void pr_des(orte_oob_base_peer_t *ptr)
 159 {
 160     OBJ_DESTRUCT(&ptr->addressable);
 161 }
 162 OBJ_CLASS_INSTANCE(orte_oob_base_peer_t,
 163                    opal_object_t,
 164                    pr_cons, pr_des);

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