Skip to content

Commit e73233f

Browse files
committed
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 <[email protected]>
1 parent e1cfdbf commit e73233f

File tree

4 files changed

+21
-5
lines changed

4 files changed

+21
-5
lines changed

orte/mca/plm/base/plm_base_frame.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* All rights reserved.
1212
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
1313
* All rights reserved.
14-
* Copyright (c) 2015 Research Organization for Information Science
14+
* Copyright (c) 2015-2017 Research Organization for Information Science
1515
* and Technology (RIST). All rights reserved.
1616
* $COPYRIGHT$
1717
*
@@ -52,6 +52,19 @@ orte_plm_globals_t orte_plm_globals = {0};
5252
orte_plm_base_module_t orte_plm = {0};
5353

5454

55+
static int mca_plm_base_register(mca_base_register_flag_t flags)
56+
{
57+
orte_plm_globals.node_regex_threshold = 1024;
58+
(void) mca_base_var_register("orte", "pml", "base", "node_regex_threshold",
59+
"Only pass the node regex on the orted command line if smaller than this threshold",
60+
MCA_BASE_VAR_TYPE_SIZE_T, NULL, 0,
61+
MCA_BASE_VAR_FLAG_INTERNAL,
62+
OPAL_INFO_LVL_9,
63+
MCA_BASE_VAR_SCOPE_READONLY,
64+
&orte_plm_globals.node_regex_threshold);
65+
return ORTE_SUCCESS;
66+
}
67+
5568
static int orte_plm_base_close(void)
5669
{
5770
int rc;
@@ -88,5 +101,5 @@ static int orte_plm_base_open(mca_base_open_flag_t flags)
88101
return mca_base_framework_components_open(&orte_plm_base_framework, flags);
89102
}
90103

91-
MCA_BASE_FRAMEWORK_DECLARE(orte, plm, NULL, NULL, orte_plm_base_open, orte_plm_base_close,
104+
MCA_BASE_FRAMEWORK_DECLARE(orte, plm, NULL, mca_plm_base_register, orte_plm_base_open, orte_plm_base_close,
92105
mca_plm_base_static_components, 0);

orte/mca/plm/base/plm_base_launch_support.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ int orte_plm_base_orted_append_basic_args(int *argc, char ***argv,
15671567
}
15681568
/* if this is too long, then we'll have to do it with
15691569
* a phone home operation instead */
1570-
if (strlen(param) < ORTE_MAX_REGEX_CMD_LENGTH) {
1570+
if (strlen(param) < orte_plm_globals.node_regex_threshold) {
15711571
opal_argv_append(argc, argv, "-"OPAL_MCA_CMD_LINE_ID);
15721572
opal_argv_append(argc, argv, "orte_node_regex");
15731573
opal_argv_append(argc, argv, param);

orte/mca/plm/base/plm_private.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
* Copyright (c) 2011-2013 Los Alamos National Security, LLC.
1313
* All rights reserved.
1414
* Copyright (c) 2017 Intel, Inc. All rights reserved.
15+
* Copyright (c) 2017 Research Organization for Information Science
16+
* and Technology (RIST). All rights reserved.
1517
* $COPYRIGHT$
1618
*
1719
* Additional copyrights may follow
@@ -59,6 +61,7 @@ typedef struct {
5961
opal_buffer_t tree_spawn_cmd;
6062
/* daemon nodes assigned at launch */
6163
bool daemon_nodes_assigned_at_launch;
64+
size_t node_regex_threshold;
6265
} orte_plm_globals_t;
6366
/**
6467
* Global instance of PLM framework data

orte/util/nidmap.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* Copyright (c) 2004-2005 The Regents of the University of California.
1111
* All rights reserved.
1212
* Copyright (c) 2014-2017 Intel, Inc. All rights reserved.
13+
* Copyright (c) 2017 Research Organization for Information Science
14+
* and Technology (RIST). All rights reserved.
1315
* $COPYRIGHT$
1416
*
1517
* Additional copyrights may follow
@@ -37,8 +39,6 @@
3739

3840
BEGIN_C_DECLS
3941

40-
#define ORTE_MAX_REGEX_CMD_LENGTH 1024
41-
4242
#define ORTE_MAX_NODE_PREFIX 50
4343
#define ORTE_CONTIG_NODE_CMD 0x01
4444
#define ORTE_NON_CONTIG_NODE_CMD 0x02

0 commit comments

Comments
 (0)