Search
OpenHPC Build Service
>
Projects
>
OpenHPC
:
1.3
:
Update10
:
Factory
>
mpich-gnu8
> _service:extract_file:8a12577691979dbe3d9281b4c59e38558ab3e777.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File _service:extract_file:8a12577691979dbe3d9281b4c59e38558ab3e777.patch of Package mpich-gnu8
From 8a12577691979dbe3d9281b4c59e38558ab3e777 Mon Sep 17 00:00:00 2001 From: Giuseppe Congiu <gcongiu@anl.gov> Date: Sat, 16 Feb 2019 16:51:01 -0600 Subject: [PATCH] pm/hydra: fix format for slurm nodelist parsing With this fix we should properly detect nodelists of the form: h[00-14]. Additionally if the nodelist format is not recognized we throw an error and abort the launch. --- .../external/slurm_query_node_list.c | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/pm/hydra/tools/bootstrap/external/slurm_query_node_list.c b/src/pm/hydra/tools/bootstrap/external/slurm_query_node_list.c index a6dd3bd0c1..47d07a162d 100644 --- a/src/pm/hydra/tools/bootstrap/external/slurm_query_node_list.c +++ b/src/pm/hydra/tools/bootstrap/external/slurm_query_node_list.c @@ -92,17 +92,17 @@ static HYD_status list_to_nodes(char *str) /* compile element regex for old format: "h14" */ regcomp(&ematch_old, "([a-zA-Z]+[0-9]+)", REG_EXTENDED); - /* compile group-0 regex for new format: "h-[00-12,14] | h-14" */ - regcomp(&gmatch_new[0], "(,|^)([a-zA-Z]+[0-9]*-)(\\[[-,0-9]+\\]|[0-9]+)(,|$)", REG_EXTENDED); + /* compile group-0 regex for new format: "h00-[00-12,14] | h00[00-12,14] | h00-14 | h0014" */ + regcomp(&gmatch_new[0], "(,|^)([a-zA-Z0-9]+-?)(\\[[-,0-9]+\\]|[0-9]*)(,|$)", REG_EXTENDED); - /* compile group-1 regex for new format: "00-12 | 14" */ - regcomp(&gmatch_new[1], "([[,]|^)([0-9]+-[0-9]+|[0-9]+)([],]|$)", REG_EXTENDED); + /* compile group-1 regex for new format: "00-12 | 14 | " */ + regcomp(&gmatch_new[1], "([[,]|^)([0-9]+-[0-9]+|[0-9]*)([],]|$)", REG_EXTENDED); /* compile range regex for new format: "00-12" */ regcomp(&rmatch_new, "([0-9]+)-([0-9]+)", REG_EXTENDED); - /* compile element regex for new format: "14" */ - regcomp(&ematch_new, "([0-9]+)", REG_EXTENDED); + /* compile element regex for new format: "14 | " */ + regcomp(&ematch_new, "([0-9]*)", REG_EXTENDED); gpattern[0] = string; @@ -162,7 +162,7 @@ static HYD_status list_to_nodes(char *str) gpattern[0] += gmatch[0][0].rm_eo; } - /* match new group-0 pattern: (,|^)(h-)([00-12,14] | 00-12 | 14)(,|$) */ + /* match new group-0 pattern: (,|^)(h|h-)([00-12,14] | 00-12 | 14)(,|$) */ while (*gpattern[0] && regexec(&gmatch_new[0], gpattern[0], MAX_GMATCH, gmatch[0], 0) == 0) { /* bound group-0 for group-1 matching: h-[00-h12,14],... -> h-[00-12,14]\0... */ tmp[0] = *(gpattern[0] + gmatch[0][0].rm_eo); @@ -221,6 +221,14 @@ static HYD_status list_to_nodes(char *str) gpattern[0] += gmatch[0][0].rm_eo; } + /* if nodelist format not recognized throw an error message and abort */ + if (global_node_list == NULL) { + fprintf(stdout, + "Error: node list format not recognized. Try using '-hosts=<hostnames>'.\n"); + fflush(stdout); + abort(); + } + /* clean up match patterns */ regfree(&gmatch_old[0]); regfree(&gmatch_new[0]);