Skip to content
Snippets Groups Projects
Commit 7aed3382 authored by Moe Jette's avatar Moe Jette
Browse files

In sched/wiki2: accept hostname expression as input for GETNODES command.

parent ee2074b7
No related branches found
No related tags found
No related merge requests found
......@@ -10,8 +10,9 @@ documents those changes that are of interest to users and admins.
changes in real time changes in operating system. These values are reported
by "scontrol show node" plus the sched/wiki and sched/wiki2 plugins for Maui
and Moab respectively.
-- In sched/wiki and sched/wiki2, add HostFormat and HidePartitionJobs to
-- In sched/wiki and sched/wiki2: add HostFormat and HidePartitionJobs to
"scontrol show config" SCHEDULER_CONF output.
-- In sched/wiki2: accept hostname expression as input for GETNODES command.
* Changes in SLURM 1.3.0-pre9
=============================
......
......@@ -107,6 +107,11 @@ extern int get_nodes(char *cmd_ptr, int *err_code, char **err_msg)
node_name = strtok_r(tmp_char, ":", &tmp2_char);
while (node_name) {
node_ptr = find_node_record(node_name);
if (node_ptr == NULL) {
error("sched/wiki2: bad hostname %s",
node_name);
continue;
}
tmp_buf = _dump_node(node_ptr, state_info);
if (node_rec_cnt > 0)
xstrcat(buf, "#");
......
......@@ -112,21 +112,31 @@ extern int get_nodes(char *cmd_ptr, int *err_code, char **err_msg)
buf = _dump_all_nodes(&node_rec_cnt, state_info);
} else {
struct node_record *node_ptr = NULL;
char *node_name = NULL, *tmp2_char = NULL;
node_name = strtok_r(tmp_char, ":", &tmp2_char);
while (node_name) {
node_ptr = find_node_record(node_name);
if (!node_ptr)
continue;
tmp_buf = _dump_node(node_ptr, NULL, state_info);
if (node_rec_cnt > 0)
xstrcat(buf, "#");
xstrcat(buf, tmp_buf);
xfree(tmp_buf);
node_rec_cnt++;
node_name = strtok_r(NULL, ":", &tmp2_char);
char *node_name, *slurm_hosts;
int node_cnt;
hostset_t slurm_hostset;
slurm_hosts = moab2slurm_task_list(tmp_char, &node_cnt);
if ((slurm_hostset = hostset_create(slurm_hosts))) {
while ((node_name = hostset_shift(slurm_hostset))) {
node_ptr = find_node_record(node_name);
if (node_ptr == NULL) {
error("sched/wiki2: bad hostname %s",
node_name);
continue;
}
tmp_buf = _dump_node(node_ptr, NULL, state_info);
if (node_rec_cnt > 0)
xstrcat(buf, "#");
xstrcat(buf, tmp_buf);
xfree(tmp_buf);
node_rec_cnt++;
}
hostset_destroy(slurm_hostset);
} else {
error("hostset_create(%s): %m", slurm_hosts);
}
xfree(slurm_hosts);
}
unlock_slurmctld(node_read_lock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment