root/orte/runtime/orte_info_support.c

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

DEFINITIONS

This source file includes following definitions.
  1. orte_info_register_types
  2. orte_info_register_framework_params
  3. orte_info_close_components
  4. orte_info_show_orte_version

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2004-2010 The Trustees of Indiana University and Indiana
   4  *                         University Research and Technology
   5  *                         Corporation.  All rights reserved.
   6  * Copyright (c) 2004-2011 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) 2006-2014 Cisco Systems, Inc.  All rights reserved.
  14  * Copyright (c) 2010-2015 Los Alamos National Security, LLC.
  15  *                         All rights reserved.
  16  * Copyright (c) 2011-2012 University of Houston. All rights reserved.
  17  * Copyright (c) 2018      Intel, Inc.  All rights reserved.
  18  * $COPYRIGHT$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  23  */
  24 
  25 #include "orte_config.h"
  26 #include "orte/constants.h"
  27 #include "orte/types.h"
  28 
  29 #include "opal/class/opal_pointer_array.h"
  30 #include "opal/util/argv.h"
  31 #include "opal/util/printf.h"
  32 #include "opal/runtime/opal_info_support.h"
  33 
  34 #include "orte/include/orte/frameworks.h"
  35 #include "orte/util/proc_info.h"
  36 #include "orte/runtime/runtime.h"
  37 #include "orte/runtime/orte_globals.h"
  38 
  39 #include "orte/runtime/orte_info_support.h"
  40 
  41 const char *orte_info_type_orte = "orte";
  42 
  43 static int orte_info_registered = 0;
  44 
  45 void orte_info_register_types(opal_pointer_array_t *mca_types)
  46 {
  47     int i;
  48 
  49     /* add the top-level type */
  50     opal_pointer_array_add(mca_types, "orte");
  51 
  52     /* push all the types found by autogen */
  53     for (i=0; NULL != orte_frameworks[i]; i++) {
  54         opal_pointer_array_add(mca_types, orte_frameworks[i]->framework_name);
  55     }
  56 }
  57 
  58 int orte_info_register_framework_params(opal_pointer_array_t *component_map)
  59 {
  60     int rc;
  61 
  62     if (orte_info_registered++) {
  63         return ORTE_SUCCESS;
  64     }
  65 
  66     /* Register the ORTE layer's MCA parameters */
  67 
  68     if (ORTE_SUCCESS != (rc = orte_register_params()) &&
  69         ORTE_ERR_BAD_PARAM != rc) {
  70         fprintf(stderr, "orte_info_register: orte_register_params failed\n");
  71         return rc;
  72     }
  73 
  74     rc = opal_info_register_framework_params(component_map);
  75     if (OPAL_SUCCESS != rc) {
  76         return rc;
  77     }
  78 
  79     return opal_info_register_project_frameworks("orte", orte_frameworks, component_map);
  80 }
  81 
  82 void orte_info_close_components(void)
  83 {
  84     int i;
  85 
  86     assert (orte_info_registered);
  87     if (--orte_info_registered) {
  88         return;
  89     }
  90 
  91     for (i=0; NULL != orte_frameworks[i]; i++) {
  92         (void) mca_base_framework_close(orte_frameworks[i]);
  93     }
  94 
  95     opal_info_close_components ();
  96 }
  97 
  98 void orte_info_show_orte_version(const char *scope)
  99 {
 100     char *tmp, *tmp2;
 101 
 102     opal_asprintf(&tmp, "%s:version:full", orte_info_type_orte);
 103     tmp2 = opal_info_make_version_str(scope,
 104                                       ORTE_MAJOR_VERSION, ORTE_MINOR_VERSION,
 105                                       ORTE_RELEASE_VERSION,
 106                                       ORTE_GREEK_VERSION,
 107                                       ORTE_REPO_REV);
 108     opal_info_out("Open RTE", tmp, tmp2);
 109     free(tmp);
 110     free(tmp2);
 111     opal_asprintf(&tmp, "%s:version:repo", orte_info_type_orte);
 112     opal_info_out("Open RTE repo revision", tmp, ORTE_REPO_REV);
 113     free(tmp);
 114     opal_asprintf(&tmp, "%s:version:release_date", orte_info_type_orte);
 115     opal_info_out("Open RTE release date", tmp, ORTE_RELEASE_DATE);
 116     free(tmp);
 117 }

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