root/opal/mca/pmix/pmix4x/pmix/src/runtime/pmix_params.c

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

DEFINITIONS

This source file includes following definitions.
  1. pmix_register_params
  2. pmix_deregister_params

   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-2014 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      Los Alamos National Security, LLC.  All rights
  14  *                         reserved.
  15  * Copyright (c) 2008-2015 Cisco Systems, Inc.  All rights reserved.
  16  * Copyright (c) 2009      Oak Ridge National Labs.  All rights reserved.
  17  * Copyright (c) 2010-2014 Los Alamos National Security, LLC.
  18  *                         All rights reserved.
  19  * Copyright (c) 2014      Hochschule Esslingen.  All rights reserved.
  20  * Copyright (c) 2015-2019 Research Organization for Information Science
  21  *                         and Technology (RIST).  All rights reserved.
  22  * Copyright (c) 2015-2018 Mellanox Technologies, Inc.
  23  *                         All rights reserved.
  24  * Copyright (c) 2016-2019 Intel, Inc.  All rights reserved.
  25  * $COPYRIGHT$
  26  *
  27  * Additional copyrights may follow
  28  *
  29  * $HEADER$
  30  */
  31 
  32 #include "pmix_config.h"
  33 
  34 #include "src/mca/base/pmix_mca_base_var.h"
  35 #include "src/runtime/pmix_rte.h"
  36 #include "src/util/timings.h"
  37 #include "src/client/pmix_client_ops.h"
  38 #include "src/server/pmix_server_ops.h"
  39 
  40 #if PMIX_ENABLE_TIMING
  41 char *pmix_timing_output = NULL;
  42 bool pmix_timing_overhead = true;
  43 #endif
  44 
  45 static bool pmix_register_done = false;
  46 char *pmix_net_private_ipv4 = NULL;
  47 int pmix_event_caching_window = 1;
  48 bool pmix_suppress_missing_data_warning = false;
  49 
  50 pmix_status_t pmix_register_params(void)
  51 {
  52     int ret;
  53 
  54     if (pmix_register_done) {
  55         return PMIX_SUCCESS;
  56     }
  57 
  58     pmix_register_done = true;
  59 
  60 #if PMIX_ENABLE_TIMING
  61     pmix_timing_output = NULL;
  62     (void) pmix_mca_base_var_register ("pmix", "pmix", NULL, "timing_output",
  63                                   "The name of output file for timing information. If this parameter is not set then output will be directed into PMIX debug channel.",
  64                                   PMIX_MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
  65                                   PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_ALL,
  66                                   &pmix_timing_output);
  67 
  68     pmix_timing_overhead = true;
  69     (void) pmix_mca_base_var_register ("pmix", "pmix", NULL, "timing_overhead",
  70                                   "Timing framework introduce additional overhead (malloc's mostly)."
  71                                   " The time spend in such costly routines is measured and may be accounted"
  72                                   " (subtracted from timestamps). 'true' means consider overhead, 'false' - ignore (default: true).",
  73                                   PMIX_MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
  74                                   PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_ALL,
  75                                   &pmix_timing_overhead);
  76 #endif
  77 
  78     /* RFC1918 defines
  79        - 10.0.0./8
  80        - 172.16.0.0/12
  81        - 192.168.0.0/16
  82 
  83        RFC3330 also mentions
  84        - 169.254.0.0/16 for DHCP onlink iff there's no DHCP server
  85     */
  86     pmix_net_private_ipv4 = "10.0.0.0/8;172.16.0.0/12;192.168.0.0/16;169.254.0.0/16";
  87     ret = pmix_mca_base_var_register ("pmix", "pmix", "net", "private_ipv4",
  88                                       "Semicolon-delimited list of CIDR notation entries specifying what networks are considered \"private\" (default value based on RFC1918 and RFC3330)",
  89                                       PMIX_MCA_BASE_VAR_TYPE_STRING, NULL, 0, PMIX_MCA_BASE_VAR_FLAG_SETTABLE,
  90                                       PMIX_INFO_LVL_3, PMIX_MCA_BASE_VAR_SCOPE_ALL_EQ,
  91                                       &pmix_net_private_ipv4);
  92     if (0 > ret) {
  93         return ret;
  94     }
  95 
  96     (void) pmix_mca_base_var_register ("pmix", "pmix", NULL, "event_caching_window",
  97                                        "Time (in seconds) to aggregate events before reporting them - this "
  98                                        "suppresses event cascades when processes abnormally terminate",
  99                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 100                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 101                                        &pmix_event_caching_window);
 102 
 103     (void) pmix_mca_base_var_register ("pmix", "pmix", NULL, "suppress_missing_data_warning",
 104                                        "Suppress warning that PMIx is missing job-level data that "
 105                                        "is supposed to be provided by the host RM.",
 106                                        PMIX_MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 107                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 108                                        &pmix_suppress_missing_data_warning);
 109 
 110     /****   CLIENT: VERBOSE OUTPUT PARAMS   ****/
 111     (void) pmix_mca_base_var_register ("pmix", "pmix", "client", "get_verbose",
 112                                        "Verbosity for client get operations",
 113                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 114                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 115                                        &pmix_client_globals.get_verbose);
 116 
 117     (void) pmix_mca_base_var_register ("pmix", "pmix", "client", "connect_verbose",
 118                                        "Verbosity for client connect operations",
 119                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 120                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 121                                        &pmix_client_globals.connect_verbose);
 122 
 123     (void) pmix_mca_base_var_register ("pmix", "pmix", "client", "fence_verbose",
 124                                        "Verbosity for client fence operations",
 125                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 126                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 127                                        &pmix_client_globals.fence_verbose);
 128 
 129     (void) pmix_mca_base_var_register ("pmix", "pmix", "client", "pub_verbose",
 130                                        "Verbosity for client publish, lookup, and unpublish operations",
 131                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 132                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 133                                        &pmix_client_globals.pub_verbose);
 134 
 135     (void) pmix_mca_base_var_register ("pmix", "pmix", "client", "spawn_verbose",
 136                                        "Verbosity for client spawn operations",
 137                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 138                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 139                                        &pmix_client_globals.spawn_verbose);
 140 
 141     (void) pmix_mca_base_var_register ("pmix", "pmix", "client", "event_verbose",
 142                                        "Verbosity for client event notifications",
 143                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 144                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 145                                        &pmix_client_globals.event_verbose);
 146 
 147     (void) pmix_mca_base_var_register ("pmix", "pmix", "client", "iof_verbose",
 148                                        "Verbosity for client iof operations",
 149                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 150                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 151                                        &pmix_client_globals.iof_verbose);
 152 
 153     (void) pmix_mca_base_var_register ("pmix", "pmix", "client", "base_verbose",
 154                                        "Verbosity for basic client operations",
 155                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 156                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 157                                        &pmix_client_globals.base_verbose);
 158 
 159     /****   SERVER: VERBOSE OUTPUT PARAMS   ****/
 160     (void) pmix_mca_base_var_register ("pmix", "pmix", "server", "get_verbose",
 161                                        "Verbosity for server get operations",
 162                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 163                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 164                                        &pmix_server_globals.get_verbose);
 165 
 166     (void) pmix_mca_base_var_register ("pmix", "pmix", "server", "connect_verbose",
 167                                        "Verbosity for server connect operations",
 168                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 169                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 170                                        &pmix_server_globals.connect_verbose);
 171 
 172     (void) pmix_mca_base_var_register ("pmix", "pmix", "server", "fence_verbose",
 173                                        "Verbosity for server fence operations",
 174                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 175                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 176                                        &pmix_server_globals.fence_verbose);
 177 
 178     (void) pmix_mca_base_var_register ("pmix", "pmix", "server", "pub_verbose",
 179                                        "Verbosity for server publish, lookup, and unpublish operations",
 180                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 181                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 182                                        &pmix_server_globals.pub_verbose);
 183 
 184     (void) pmix_mca_base_var_register ("pmix", "pmix", "server", "spawn_verbose",
 185                                        "Verbosity for server spawn operations",
 186                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 187                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 188                                        &pmix_server_globals.spawn_verbose);
 189 
 190     (void) pmix_mca_base_var_register ("pmix", "pmix", "server", "event_verbose",
 191                                        "Verbosity for server event operations",
 192                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 193                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 194                                        &pmix_server_globals.event_verbose);
 195 
 196     (void) pmix_mca_base_var_register ("pmix", "pmix", "server", "iof_verbose",
 197                                        "Verbosity for server iof operations",
 198                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 199                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 200                                        &pmix_server_globals.iof_verbose);
 201 
 202     (void) pmix_mca_base_var_register ("pmix", "pmix", "server", "base_verbose",
 203                                        "Verbosity for basic server operations",
 204                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 205                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 206                                        &pmix_server_globals.base_verbose);
 207 
 208     /* check for maximum number of pending output messages */
 209     pmix_globals.output_limit = (size_t) INT_MAX;
 210     (void) pmix_mca_base_var_register("pmix", "iof", NULL, "output_limit",
 211                                       "Maximum backlog of output messages [default: unlimited]",
 212                                       PMIX_MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, 0,
 213                                       PMIX_INFO_LVL_9,
 214                                       PMIX_MCA_BASE_VAR_SCOPE_READONLY,
 215                                       &pmix_globals.output_limit);
 216 
 217     pmix_globals.xml_output = false;
 218     (void) pmix_mca_base_var_register ("pmix", "iof", NULL, "xml_output",
 219                                        "Display all output in XML format (default: false)",
 220                                        PMIX_MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 221                                        PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_READONLY,
 222                                        &pmix_globals.xml_output);
 223 
 224     /* whether to tag output */
 225     /* if we requested xml output, be sure to tag the output as well */
 226     pmix_globals.tag_output = pmix_globals.xml_output;
 227     (void) pmix_mca_base_var_register ("pmix", "iof", NULL, "tag_output",
 228                                        "Tag all output with [job,rank] (default: false)",
 229                                        PMIX_MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 230                                        PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_READONLY,
 231                                        &pmix_globals.tag_output);
 232     if (pmix_globals.xml_output) {
 233         pmix_globals.tag_output = true;
 234     }
 235 
 236     /* whether to timestamp output */
 237     pmix_globals.timestamp_output = false;
 238     (void) pmix_mca_base_var_register ("pmix", "iof", NULL, "timestamp_output",
 239                                        "Timestamp all application process output (default: false)",
 240                                        PMIX_MCA_BASE_VAR_TYPE_BOOL, NULL, 0, 0,
 241                                        PMIX_INFO_LVL_9, PMIX_MCA_BASE_VAR_SCOPE_READONLY,
 242                                        &pmix_globals.timestamp_output);
 243 
 244     /* max size of the notification hotel */
 245     pmix_globals.max_events = 512;
 246     (void) pmix_mca_base_var_register ("pmix", "pmix", "max", "events",
 247                                        "Maximum number of event notifications to cache",
 248                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 249                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 250                                        &pmix_globals.max_events);
 251 
 252     /* how long to cache an event */
 253     pmix_globals.event_eviction_time = 120;
 254     (void) pmix_mca_base_var_register ("pmix", "pmix", "event", "eviction_time",
 255                                        "Maximum number of seconds to cache an event",
 256                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 257                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 258                                        &pmix_globals.event_eviction_time);
 259 
 260     /* max number of IOF messages to cache */
 261     pmix_server_globals.max_iof_cache = 1024 * 1024;
 262     (void) pmix_mca_base_var_register ("pmix", "pmix", "max", "iof_cache",
 263                                        "Maximum number of IOF messages to cache",
 264                                        PMIX_MCA_BASE_VAR_TYPE_INT, NULL, 0, 0,
 265                                        PMIX_INFO_LVL_1, PMIX_MCA_BASE_VAR_SCOPE_ALL,
 266                                        &pmix_server_globals.max_iof_cache);
 267 
 268     return PMIX_SUCCESS;
 269 }
 270 
 271 pmix_status_t pmix_deregister_params(void)
 272 {
 273     pmix_register_done = false;
 274 
 275     return PMIX_SUCCESS;
 276 }

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