From 799152e7fb96b932d734a7558dadf2a8e8e167d1 Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Thu, 21 Dec 2017 17:27:35 +0900 Subject: [PATCH] plm/base: add the orte_plm_base_node_regex_threshold MCA parameter This parameter can be used to set the node regex max length that can be passed to the orted command line. For testing purpose, it can be set to zero in order to force the node regex being retrieved by orted from its parent. Signed-off-by: Gilles Gouaillardet --- orte/mca/plm/base/plm_base_frame.c | 17 +++++++++++++++-- orte/mca/plm/base/plm_base_launch_support.c | 2 +- orte/mca/plm/base/plm_private.h | 3 +++ orte/util/nidmap.h | 4 ++-- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/orte/mca/plm/base/plm_base_frame.c b/orte/mca/plm/base/plm_base_frame.c index 9fc9752b41b..b494b0b1565 100644 --- a/orte/mca/plm/base/plm_base_frame.c +++ b/orte/mca/plm/base/plm_base_frame.c @@ -11,7 +11,7 @@ * All rights reserved. * Copyright (c) 2011-2013 Los Alamos National Security, LLC. * All rights reserved. - * Copyright (c) 2015 Research Organization for Information Science + * Copyright (c) 2015-2017 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -52,6 +52,19 @@ orte_plm_globals_t orte_plm_globals = {0}; orte_plm_base_module_t orte_plm = {0}; +static int mca_plm_base_register(mca_base_register_flag_t flags) +{ + orte_plm_globals.node_regex_threshold = 1024; + (void) mca_base_var_register("orte", "pml", "base", "node_regex_threshold", + "Only pass the node regex on the orted command line if smaller than this threshold", + MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0, + MCA_BASE_VAR_FLAG_INTERNAL, + OPAL_INFO_LVL_9, + MCA_BASE_VAR_SCOPE_READONLY, + &orte_plm_globals.node_regex_threshold); + return ORTE_SUCCESS; +} + static int orte_plm_base_close(void) { int rc; @@ -88,5 +101,5 @@ static int orte_plm_base_open(mca_base_open_flag_t flags) return mca_base_framework_components_open(&orte_plm_base_framework, flags); } -MCA_BASE_FRAMEWORK_DECLARE(orte, plm, NULL, NULL, orte_plm_base_open, orte_plm_base_close, +MCA_BASE_FRAMEWORK_DECLARE(orte, plm, NULL, mca_plm_base_register, orte_plm_base_open, orte_plm_base_close, mca_plm_base_static_components, 0); diff --git a/orte/mca/plm/base/plm_base_launch_support.c b/orte/mca/plm/base/plm_base_launch_support.c index 9932706a64d..4aa45fd3233 100644 --- a/orte/mca/plm/base/plm_base_launch_support.c +++ b/orte/mca/plm/base/plm_base_launch_support.c @@ -1567,7 +1567,7 @@ int orte_plm_base_orted_append_basic_args(int *argc, char ***argv, } /* if this is too long, then we'll have to do it with * a phone home operation instead */ - if (strlen(param) < ORTE_MAX_REGEX_CMD_LENGTH) { + if (strlen(param) < orte_plm_globals.node_regex_threshold) { opal_argv_append(argc, argv, "-"OPAL_MCA_CMD_LINE_ID); opal_argv_append(argc, argv, "orte_node_regex"); opal_argv_append(argc, argv, param); diff --git a/orte/mca/plm/base/plm_private.h b/orte/mca/plm/base/plm_private.h index 047a508394c..3a58c351b34 100644 --- a/orte/mca/plm/base/plm_private.h +++ b/orte/mca/plm/base/plm_private.h @@ -12,6 +12,8 @@ * Copyright (c) 2011-2013 Los Alamos National Security, LLC. * All rights reserved. * Copyright (c) 2017 Intel, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -59,6 +61,7 @@ typedef struct { opal_buffer_t tree_spawn_cmd; /* daemon nodes assigned at launch */ bool daemon_nodes_assigned_at_launch; + size_t node_regex_threshold; } orte_plm_globals_t; /** * Global instance of PLM framework data diff --git a/orte/util/nidmap.h b/orte/util/nidmap.h index e8c6f59bc21..3be3f71dbf9 100644 --- a/orte/util/nidmap.h +++ b/orte/util/nidmap.h @@ -10,6 +10,8 @@ * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * Copyright (c) 2014-2017 Intel, Inc. All rights reserved. + * Copyright (c) 2017 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -37,8 +39,6 @@ BEGIN_C_DECLS -#define ORTE_MAX_REGEX_CMD_LENGTH 1024 - #define ORTE_MAX_NODE_PREFIX 50 #define ORTE_CONTIG_NODE_CMD 0x01 #define ORTE_NON_CONTIG_NODE_CMD 0x02