Skip to content

Commit

Permalink
plm/base: add the orte_plm_base_node_regex_threshold MCA parameter
Browse files Browse the repository at this point in the history
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 <gilles@rist.or.jp>
  • Loading branch information
ggouaillardet committed Jan 4, 2018
1 parent f7e2912 commit 799152e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
17 changes: 15 additions & 2 deletions orte/mca/plm/base/plm_base_frame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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$
*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
2 changes: 1 addition & 1 deletion orte/mca/plm/base/plm_base_launch_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions orte/mca/plm/base/plm_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions orte/util/nidmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 799152e

Please sign in to comment.