Browse files

svn merge -r11347:11350 https://eris.llnl.gov/svn/slurm/branches/slur…

  • Loading branch information...
1 parent 54c4c39 commit 26d00f7af3d720505d6c9b818f8b8298ae708908 Moe Jette committed Apr 11, 2007
Showing with 50 additions and 10 deletions.
  1. +5 −3 NEWS
  2. +44 −7 src/plugins/sched/wiki2/job_modify.c
  3. +1 −0 testsuite/expect/test7.7.prog.c
View
8 NEWS
@@ -281,14 +281,16 @@ documents those changes that are of interest to users and admins.
* Changes in SLURM 1.1.35
=========================
- - In sched/wiki - Add support for CMD=SIGNALJOB to accept option
- of VALUE=SIGXXX in addition to VALUE=# and VALUE=XXX options
+ - In sched/wiki2: Add support for CMD=SIGNALJOB to accept option
+ of VALUE=SIGXXX in addition to VALUE=# and VALUE=XXX options.
+ - In sched/wiki2: Add support for CMD=MODIFYJOB to accept option of
+ DEPEND=afterany:<jobid>, specify jobid=0 to clear.
- Correct logic for job allocation with task count (srun -n ...) AND
FastSchedule=0 AND low CPUs count in Slurm's node configuration.
- Add new and undocumented scancel option, --ctld, to route signal
requests through slurmctld rather than directly to slurmd daemons.
Useful for testing purposes.
- - fixed issue with hostfile support not working in a job step
+ - Fixed issue with hostfile support not working in a job step.
* Changes in SLURM 1.1.34
=========================
View
51 src/plugins/sched/wiki2/job_modify.c
@@ -53,7 +53,24 @@ static void _null_term(char *str)
}
}
+/* return -1 on error */
+static int32_t _get_depend_id(char *str)
+{
+ /* stand-alone job_id */
+ if (isdigit(str[0]))
+ return (int32_t) atol(str);
+
+ if (strncasecmp(str, "afterany:", 9) != 0) /* invalid spec */
+ return (int32_t) -1;
+
+ str += 9;
+ if (!isdigit(str[0]))
+ return (int32_t) -1;
+ return (int32_t) atol(str);
+}
+
static int _job_modify(uint32_t jobid, char *bank_ptr,
+ int32_t depend_id,
uint32_t new_node_cnt, char *part_name_ptr,
uint32_t new_time_limit)
{
@@ -69,6 +86,11 @@ static int _job_modify(uint32_t jobid, char *bank_ptr,
return ESLURM_DISABLED;
}
+ if (depend_id != -1) {
+ info("wiki: changing job dependency to %d", depend_id);
+ job_ptr->dependency = depend_id;
+ }
+
if (new_time_limit) {
time_t old_time = job_ptr->time_limit;
job_ptr->time_limit = new_time_limit;
@@ -125,8 +147,10 @@ static int _job_modify(uint32_t jobid, char *bank_ptr,
/* RET 0 on success, -1 on failure */
extern int job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
{
- char *arg_ptr, *bank_ptr, *nodes_ptr, *part_ptr, *time_ptr, *tmp_char;
+ char *arg_ptr, *bank_ptr, *depend_ptr, *nodes_ptr;
+ char *part_ptr, *time_ptr, *tmp_char;
int slurm_rc;
+ int depend_id = -1;
uint32_t jobid, new_node_cnt = 0, new_time_limit = 0;
static char reply_msg[128];
/* Locks: write job, read node and partition info */
@@ -151,15 +175,28 @@ extern int job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
error("wiki: MODIFYJOB has invalid jobid");
return -1;
}
- bank_ptr = strstr(cmd_ptr, "BANK=");
- nodes_ptr = strstr(cmd_ptr, "NODES=");
- part_ptr = strstr(cmd_ptr, "PARTITION=");
- time_ptr = strstr(cmd_ptr, "TIMELIMIT=");
+ bank_ptr = strstr(cmd_ptr, "BANK=");
+ depend_ptr = strstr(cmd_ptr, "DEPEND=");
+ nodes_ptr = strstr(cmd_ptr, "NODES=");
+ part_ptr = strstr(cmd_ptr, "PARTITION=");
+ time_ptr = strstr(cmd_ptr, "TIMELIMIT=");
if (bank_ptr) {
bank_ptr[4] = ':';
bank_ptr += 5;
_null_term(bank_ptr);
}
+ if (depend_ptr) {
+ depend_ptr[6] = ':';
+ depend_ptr += 7;
+ depend_id = _get_depend_id(depend_ptr);
+ if (depend_id == -1) {
+ *err_code = -300;
+ *err_msg = "MODIFYJOB has invalid DEPEND specificiation";
+ error("wiki: MODIFYJOB has invalid DEPEND spec: %s",
+ depend_ptr);
+ return -1;
+ }
+ }
if (nodes_ptr) {
nodes_ptr[5] = ':';
nodes_ptr += 6;
@@ -186,8 +223,8 @@ extern int job_modify_wiki(char *cmd_ptr, int *err_code, char **err_msg)
}
lock_slurmctld(job_write_lock);
- slurm_rc = _job_modify(jobid, bank_ptr, new_node_cnt, part_ptr,
- new_time_limit);
+ slurm_rc = _job_modify(jobid, bank_ptr, depend_id,
+ new_node_cnt, part_ptr, new_time_limit);
unlock_slurmctld(job_write_lock);
if (slurm_rc != SLURM_SUCCESS) {
*err_code = -700;
View
1 testsuite/expect/test7.7.prog.c
@@ -330,6 +330,7 @@ static void _modify_job(long my_job_id)
"TS=%u AUTH=root DT=CMD=MODIFYJOB ARG=%ld "
/* "PARTITION=pdebug " */
/* "NODES=2 " */
+ /* "DEPEND=afterany:3 " */
/* "INVALID=123 " */
"TIMELIMIT=10 BANK=test_bank",
(uint32_t) now, my_job_id);

0 comments on commit 26d00f7

Please sign in to comment.