diff --git a/NEWS b/NEWS index 88f1e7327afe622d6456c403cad36f6573d3bee8..35ab740e78248209e652ce8cd1d99833a22619af 100644 --- a/NEWS +++ b/NEWS @@ -251,6 +251,10 @@ documents those changes that are of interest to users and admins. to boolean (YES or NO) to match partition parameter. -- Set "DisableRootJobs" for a partition to match the global parameters value for newly created partitions. + -- In sched/wiki and sched/wiki2 report a node's updated features if changed + after startup using "scontrol update ..." command. + -- In sched/wiki and sched/wiki2 report a job's state as "Hold" if it's + dependencies have not been satisfied. * Changes in SLURM 1.2.28 ========================= diff --git a/src/plugins/sched/wiki/get_jobs.c b/src/plugins/sched/wiki/get_jobs.c index 9e23e936a1b2d82ff62e48f5f1de0c262a1004db..88fd77840cf79f2d8a350329ed1aaffe99349f19 100644 --- a/src/plugins/sched/wiki/get_jobs.c +++ b/src/plugins/sched/wiki/get_jobs.c @@ -148,7 +148,10 @@ extern int get_jobs(char *cmd_ptr, int *err_code, char **err_msg) if (buf) buf_size = strlen(buf); tmp_buf = xmalloc(buf_size + 32); - sprintf(tmp_buf, "SC=0 ARG=%d#%s", job_rec_cnt, buf); + if (job_rec_cnt) + sprintf(tmp_buf, "SC=0 ARG=%d#%s", job_rec_cnt, buf); + else + sprintf(tmp_buf, "SC=0 ARG=0#"); xfree(buf); *err_code = 0; *err_msg = tmp_buf; @@ -414,12 +417,15 @@ static char * _get_job_state(struct job_record *job_ptr) return "Running"; } - if (base_state == JOB_PENDING) - return "Idle"; if (base_state == JOB_RUNNING) return "Running"; if (base_state == JOB_SUSPENDED) return "Suspended"; + if (base_state == JOB_PENDING) { + if (job_independent(job_ptr)) + return "Idle"; + return "Hold"; + } if (base_state == JOB_COMPLETE) return "Completed"; diff --git a/src/plugins/sched/wiki/get_nodes.c b/src/plugins/sched/wiki/get_nodes.c index b221d4da024af69b1b50e3374812780840beaa50..1b407ab55247ecc97ac975f75b755adfd0691e12 100644 --- a/src/plugins/sched/wiki/get_nodes.c +++ b/src/plugins/sched/wiki/get_nodes.c @@ -116,7 +116,10 @@ extern int get_nodes(char *cmd_ptr, int *err_code, char **err_msg) if (buf) buf_size = strlen(buf); tmp_buf = xmalloc(buf_size + 32); - sprintf(tmp_buf, "SC=0 ARG=%d#%s", node_rec_cnt, buf); + if (node_rec_cnt) + sprintf(tmp_buf, "SC=0 ARG=%d#%s", node_rec_cnt, buf); + else + sprintf(tmp_buf, "SC=0 ARG=0#"); xfree(buf); *err_code = 0; *err_msg = tmp_buf; @@ -166,6 +169,19 @@ static char * _dump_node(struct node_record *node_ptr, time_t update_time) xstrcat(buf, tmp); } + if (node_ptr->config_ptr + && node_ptr->config_ptr->feature) { + snprintf(tmp, sizeof(tmp), "FEATURES=%s;", + node_ptr->config_ptr->feature); + /* comma separated to colon */ + for (i=0; (tmp[i] != '\0'); i++) { + if ((tmp[i] == ',') + || (tmp[i] == '|')) + tmp[i] = ':'; + } + xstrcat(buf, tmp); + } + if (update_time > 0) return buf; @@ -186,19 +202,6 @@ static char * _dump_node(struct node_record *node_ptr, time_t update_time) } xstrcat(buf, tmp); - if (node_ptr->config_ptr - && node_ptr->config_ptr->feature) { - snprintf(tmp, sizeof(tmp), "FEATURES=%s;", - node_ptr->config_ptr->feature); - /* comma separated to colon */ - for (i=0; (tmp[i] != '\0'); i++) { - if ((tmp[i] == ',') - || (tmp[i] == '|')) - tmp[i] = ':'; - } - xstrcat(buf, tmp); - } - return buf; } diff --git a/src/plugins/sched/wiki/start_job.c b/src/plugins/sched/wiki/start_job.c index 282e0be1e3766f527ac9bbc4efebb27208063662..bab59e541a3ea7612e9e8d56ff508ebd5e4d324b 100644 --- a/src/plugins/sched/wiki/start_job.c +++ b/src/plugins/sched/wiki/start_job.c @@ -47,7 +47,9 @@ static int _start_job(uint32_t jobid, int task_cnt, char *hostlist, char *tasklist, int *err_code, char **err_msg); -/* RET 0 on success, -1 on failure */ +/* Start a job: + * CMD=STARTJOB ARG=<jobid> TASKLIST=<node_list> + * RET 0 on success, -1 on failure */ extern int start_job(char *cmd_ptr, int *err_code, char **err_msg) { char *arg_ptr, *task_ptr, *tasklist, *tmp_char; diff --git a/src/plugins/sched/wiki2/get_jobs.c b/src/plugins/sched/wiki2/get_jobs.c index 8a278e2832977d2b59b849ab5ba976ea139ca83f..40776d6b8bef86af028a7932f379cf182393df16 100644 --- a/src/plugins/sched/wiki2/get_jobs.c +++ b/src/plugins/sched/wiki2/get_jobs.c @@ -177,7 +177,10 @@ extern int get_jobs(char *cmd_ptr, int *err_code, char **err_msg) if (buf) buf_size = strlen(buf); tmp_buf = xmalloc(buf_size + 32); - sprintf(tmp_buf, "SC=0 ARG=%d#%s", job_rec_cnt, buf); + if (job_rec_cnt) + sprintf(tmp_buf, "SC=0 ARG=%d#%s", job_rec_cnt, buf); + else + sprintf(tmp_buf, "SC=0 ARG=0#"); xfree(buf); *err_code = 0; *err_msg = tmp_buf; @@ -531,12 +534,15 @@ static char * _get_job_state(struct job_record *job_ptr) return "Running"; } - if (base_state == JOB_PENDING) - return "Idle"; if (base_state == JOB_RUNNING) return "Running"; if (base_state == JOB_SUSPENDED) return "Suspended"; + if (base_state == JOB_PENDING) { + if (job_independent(job_ptr)) + return "Idle"; + return "Hold"; + } if ((base_state == JOB_COMPLETE) || (base_state == JOB_FAILED)) state_str = "Completed"; diff --git a/src/plugins/sched/wiki2/get_nodes.c b/src/plugins/sched/wiki2/get_nodes.c index 8f1b7c72ec4c3b84fe9a314e703e5a69b540116b..34450f6746a4a318927ad19497c9d41c2e84be0e 100644 --- a/src/plugins/sched/wiki2/get_nodes.c +++ b/src/plugins/sched/wiki2/get_nodes.c @@ -134,7 +134,10 @@ extern int get_nodes(char *cmd_ptr, int *err_code, char **err_msg) if (buf) buf_size = strlen(buf); tmp_buf = xmalloc(buf_size + 32); - sprintf(tmp_buf, "SC=0 ARG=%d#%s", node_rec_cnt, buf); + if (node_rec_cnt) + sprintf(tmp_buf, "SC=0 ARG=%d#%s", node_rec_cnt, buf); + else + sprintf(tmp_buf, "SC=0 ARG=0#"); xfree(buf); *err_code = 0; *err_msg = tmp_buf; @@ -317,6 +320,18 @@ static char * _dump_node(struct node_record *node_ptr, hostlist_t hl, xstrcat(buf, tmp); } + if (node_ptr->config_ptr + && node_ptr->config_ptr->feature) { + snprintf(tmp, sizeof(tmp), "FEATURE=%s;", + node_ptr->config_ptr->feature); + /* comma separator to colon */ + for (i=0; (tmp[i] != '\0'); i++) { + if (tmp[i] == ',') + tmp[i] = ':'; + } + xstrcat(buf, tmp); + } + if (update_time > 0) return buf; @@ -337,18 +352,6 @@ static char * _dump_node(struct node_record *node_ptr, hostlist_t hl, } xstrcat(buf, tmp); - if (node_ptr->config_ptr - && node_ptr->config_ptr->feature) { - snprintf(tmp, sizeof(tmp), "FEATURE=%s;", - node_ptr->config_ptr->feature); - /* comma separator to colon */ - for (i=0; (tmp[i] != '\0'); i++) { - if (tmp[i] == ',') - tmp[i] = ':'; - } - xstrcat(buf, tmp); - } - return buf; } diff --git a/src/plugins/sched/wiki2/start_job.c b/src/plugins/sched/wiki2/start_job.c index 78b17e8f647a17b517413e5ef9eeedd1730bbe4c..bc9f296c6ef945d251bdff8a5a5cf1813ba12b73 100644 --- a/src/plugins/sched/wiki2/start_job.c +++ b/src/plugins/sched/wiki2/start_job.c @@ -122,6 +122,7 @@ extern int start_job(char *cmd_ptr, int *err_code, char **err_msg) task_cnt = 0; tasklist = NULL; } else { + null_term(task_ptr); tasklist = moab2slurm_task_list(task_ptr, &task_cnt); if (tasklist) hl = hostlist_create(tasklist);