diff --git a/NEWS b/NEWS index cf475475db943421f5b8bfb6572eea81827ca19c..70784df014f1ebadde47f4fb1449385cd09bf57f 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,8 @@ documents those changes that are of interest to users and admins. -- ALTERED API CALL slurm_get_job_steps 0 has been changed to NO_VAL for both job and step id to recieve all jobs/steps. Please make adjustments to your code. + -- salloc's --wait=<secs> option deprecated by --immediate=<secs> option to + match the srun command. * Changes in SLURM 2.1.0-pre1 ============================= diff --git a/doc/man/man1/salloc.1 b/doc/man/man1/salloc.1 index 51088bf9dd3c0b0efa74442719819c364164cd9e..1b030f15d0e9c2a0f2817f1db66496e9d3a38ce7 100644 --- a/doc/man/man1/salloc.1 +++ b/doc/man/man1/salloc.1 @@ -756,12 +756,7 @@ errors will be displayed. .TP \fB\-W\fR, \fB\-\-wait\fR=<\fIseconds\fR> -If the resources needed to satisy a job allocation are not immediately -available, the job allocation is enqueued and is said to be PENDING. This -option tells salloc how long (in seconds) to wait for the allocation to be -granted before giving up. When the wait limit has been reached, salloc -will exit without running the \fIcommand\fR parameter. By default, salloc -will wait indefinitely. (The \-\-immediate option makes \-\-wait moot.) +This option has been replaced by \fB\-\-immediate\fR=<\fIseconds\fR>. .TP \fB\-w\fR, \fB\-\-nodelist\fR=<\fInode name list\fR> diff --git a/src/salloc/opt.c b/src/salloc/opt.c index 62ca9a98e7ceb2eb04f1668f3c1d195c9b4c303f..3a9450654ed4c9bcbc905a895b94a5f355966032 100644 --- a/src/salloc/opt.c +++ b/src/salloc/opt.c @@ -275,7 +275,6 @@ static void _opt_default() opt.immediate = 0; opt.overcommit = false; - opt.max_wait = 0; opt.quiet = 0; opt.verbose = 0; @@ -349,7 +348,7 @@ env_vars_t env_vars[] = { {"SALLOC_OVERCOMMIT", OPT_OVERCOMMIT, NULL, NULL }, {"SALLOC_PARTITION", OPT_STRING, &opt.partition, NULL }, {"SALLOC_TIMELIMIT", OPT_STRING, &opt.time_limit_str,NULL }, - {"SALLOC_WAIT", OPT_INT, &opt.max_wait, NULL }, + {"SALLOC_WAIT", OPT_IMMEDIATE, NULL, NULL }, {"SALLOC_WCKEY", OPT_STRING, &opt.wckey, NULL }, {NULL, 0, NULL, NULL} }; @@ -670,7 +669,7 @@ void set_options(const int argc, char **argv) break; case 'I': if (optarg) - opt.immediate = strtol(optarg, NULL, 10); + opt.immediate = _get_int(optarg, "immediate"); else opt.immediate = DEFAULT_IMMEDIATE; break; @@ -769,7 +768,9 @@ void set_options(const int argc, char **argv) #endif break; case 'W': - opt.max_wait = _get_int(optarg, "wait"); + verbose("wait option has been deprecated, use " + "immediate option"); + opt.immediate = _get_int(optarg, "wait"); break; case 'x': xfree(opt.exc_nodes); @@ -1313,11 +1314,6 @@ static bool _opt_verify(void) opt.ntasks_per_node); } - if (opt.max_wait) { - /* FIXME: Eliminate max_wait in slurm v2.1 */ - opt.immediate = MAX(opt.immediate, opt.max_wait); - } - return verified; } @@ -1554,7 +1550,6 @@ static void _opt_list() info("time_limit : INFINITE"); else if (opt.time_limit != NO_VAL) info("time_limit : %d", opt.time_limit); - info("wait : %d", opt.max_wait); if (opt.nice) info("nice : %d", opt.nice); info("account : %s", opt.account); @@ -1687,8 +1682,6 @@ static void _help(void) " -U, --account=name charge job to specified account\n" " --uid=user_id user ID to run job as (user root only)\n" " -v, --verbose verbose mode (multiple -v's increase verbosity)\n" -" -W, --wait=sec seconds to wait for allocation if not\n" -" immediately available\n" "\n" "Constraint options:\n" " --contiguous demand a contiguous range of nodes\n" diff --git a/src/salloc/opt.h b/src/salloc/opt.h index 3175f0d48423de9f489ba2619532cdb4341fcacc..3fbfd6d297f0d919c57dedf7d79910bad440ff75 100644 --- a/src/salloc/opt.h +++ b/src/salloc/opt.h @@ -103,7 +103,6 @@ typedef struct salloc_options { int kill_command_signal;/* --kill-command, -K */ bool kill_command_signal_set; uint16_t shared; /* --share, -s */ - int max_wait; /* --wait, -W */ int quiet; int verbose; diff --git a/testsuite/expect/test15.8 b/testsuite/expect/test15.8 index 5ecca86b08a360a7f96729c9cececc00d34e499e..8ab9e5b4521b181e0a708c555af28e48de25d3f8 100755 --- a/testsuite/expect/test15.8 +++ b/testsuite/expect/test15.8 @@ -43,13 +43,18 @@ print_header $test_id # The job can't run immediately with a priority of zero # set timeout 10 -set salloc_pid [spawn $salloc --immediate --hold -t1 -v $bin_pwd] +set salloc_pid [spawn $salloc --immediate=3 --hold -t1 -v $bin_pwd] expect { -re "Pending job allocation ($number)" { set job_id $expect_out(1,string) + incr matches + exp_continue + } + -re "queued and waiting for resources" { + incr matches exp_continue } - -re "Failed to allocate resources" { + -re "Unable to allocate resources" { send_user "This error is expected, no worries\n" incr matches exp_continue @@ -66,12 +71,13 @@ expect { wait } } -if {$matches != 1} { - send_user "\nFAILURE: failed to hold job as requested\n" +if {$matches != 3} { + send_user "\nFAILURE: failed to hold job as requested ($matches != 3)\n" set exit_code 1 +} else { + send_user "\nSo far, so good\n\n" } - # # Spawn a salloc immediate execution job, it should run or fail immediately # Note the small value of timeout