From 0c686f01e5963bea54666ca829dd882bde51f95f Mon Sep 17 00:00:00 2001 From: Gilles Gouaillardet Date: Fri, 12 Jan 2018 09:15:00 +0900 Subject: [PATCH] regx: add the extract_node_names callback typedef int (*orte_regx_base_module_extract_node_names_fn_t)(char *regexp, char ***names); among other things, that will make testing way easier. Signed-off-by: Gilles Gouaillardet --- orte/mca/regx/fwd/regx_fwd.c | 5 ++++- orte/mca/regx/regx.h | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/orte/mca/regx/fwd/regx_fwd.c b/orte/mca/regx/fwd/regx_fwd.c index 311f20051a..81b5e6eaed 100644 --- a/orte/mca/regx/fwd/regx_fwd.c +++ b/orte/mca/regx/fwd/regx_fwd.c @@ -1,5 +1,7 @@ /* * Copyright (c) 2016-2018 Intel, Inc. All rights reserved. + * Copyright (c) 2018 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -33,6 +35,7 @@ static int nidmap_create(opal_pointer_array_t *pool, char **regex); static int nidmap_parse(char *regex); +static int extract_node_names(char *regex, char ***node_names); static int encode_nodemap(opal_buffer_t *buffer); static int decode_daemon_nodemap(opal_buffer_t *buffer); static int generate_ppn(orte_job_t *jdata, char **ppn); @@ -41,6 +44,7 @@ static int parse_ppn(orte_job_t *jdata, char *ppn); orte_regx_base_module_t orte_regx_fwd_module = { .nidmap_create = nidmap_create, .nidmap_parse = nidmap_parse, + .extract_node_names = extract_node_names, .encode_nodemap = encode_nodemap, .decode_daemon_nodemap = decode_daemon_nodemap, .generate_ppn = generate_ppn, @@ -98,7 +102,6 @@ OBJ_CLASS_INSTANCE(orte_regex_node_t, opal_list_item_t, orte_regex_node_construct, orte_regex_node_destruct); -static int extract_node_names(char *regexp, char ***names); static int nidmap_create(opal_pointer_array_t *pool, char **regex) { diff --git a/orte/mca/regx/regx.h b/orte/mca/regx/regx.h index 592ea6a6ea..2d3630e0b6 100644 --- a/orte/mca/regx/regx.h +++ b/orte/mca/regx/regx.h @@ -3,6 +3,8 @@ * Copyright (c) 2015-2018 Intel, Inc. All rights reserved. * Copyright (c) 2015 Los Alamos National Security, LLC. All rights * reserved. + * Copyright (c) 2018 Research Organization for Information Science + * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow @@ -59,6 +61,7 @@ typedef int (*orte_regx_base_module_init_fn_t)(void); typedef int (*orte_regx_base_module_nidmap_create_fn_t)(opal_pointer_array_t *pool, char **regex); typedef int (*orte_regx_base_module_nidmap_parse_fn_t)(char *regex); +typedef int (*orte_regx_base_module_extract_node_names_fn_t)(char *regexp, char ***names); /* create a regular expression describing the nodes in the * allocation */ @@ -87,6 +90,7 @@ typedef struct { orte_regx_base_module_init_fn_t init; orte_regx_base_module_nidmap_create_fn_t nidmap_create; orte_regx_base_module_nidmap_parse_fn_t nidmap_parse; + orte_regx_base_module_extract_node_names_fn_t extract_node_names; orte_regx_base_module_encode_nodemap_fn_t encode_nodemap; orte_regx_base_module_decode_daemon_nodemap_fn_t decode_daemon_nodemap; orte_regx_base_module_build_daemon_nidmap_fn_t build_daemon_nidmap;