diff --git a/NEWS b/NEWS index e0c84a01925ccf88566479bbae09b50f0a550e3d..d42645f02c29e6762f34445fe0122d2e8c42dc15 100644 --- a/NEWS +++ b/NEWS @@ -253,6 +253,7 @@ documents those changes that are of interest to users and administrators. -- Eliminate need for user to set user_id on job_update calls. -- Correct list of unavailable nodes reported in a job's "reason" field when that job can not start. + -- Map job --mem-per-cpu=0 to --mem=0. * Changes in Slurm 14.11.7 ========================== diff --git a/src/slurmctld/job_mgr.c b/src/slurmctld/job_mgr.c index d27319070ce3797c52b251f7246620ad87403cda..d1ee76ef34a17b43555573d6452d715ef7008ed1 100644 --- a/src/slurmctld/job_mgr.c +++ b/src/slurmctld/job_mgr.c @@ -7281,6 +7281,10 @@ static int _validate_job_desc(job_desc_msg_t * job_desc_msg, int allocate, } } else if (!_validate_min_mem_partition(job_desc_msg, part_ptr, part_list)) return ESLURM_INVALID_TASK_MEMORY; + if (job_desc_msg->pn_min_memory == MEM_PER_CPU) { + /* Map --mem-per-cpu=0 to --mem=0 for simpler logic */ + job_desc_msg->pn_min_memory = 0; + } /* Validate a job's accounting frequency, if specified */ if (acct_gather_check_acct_freq_task( @@ -10275,7 +10279,6 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs, goto fini; if (job_specs->pn_min_memory != NO_VAL) { - if ((!IS_JOB_PENDING(job_ptr)) || (detail_ptr == NULL)) { error_code = ESLURM_JOB_NOT_PENDING; } else if (job_specs->pn_min_memory @@ -10284,6 +10287,10 @@ static int _update_job(struct job_record *job_ptr, job_desc_msg_t * job_specs, "to old limit for job %u", job_ptr->job_id); } else { char *entity; + if (job_specs->pn_min_memory == MEM_PER_CPU) { + /* Map --mem-per-cpu=0 to --mem=0 */ + job_specs->pn_min_memory = 0; + } if (job_specs->pn_min_memory & MEM_PER_CPU) entity = "cpu"; else diff --git a/src/slurmctld/proc_req.c b/src/slurmctld/proc_req.c index 80545c88ed034e2d25ef4238ebead3721afa224c..6b94a303ddeb742cbae34af3d3c11e46e6686bba 100644 --- a/src/slurmctld/proc_req.c +++ b/src/slurmctld/proc_req.c @@ -4486,9 +4486,6 @@ static int _launch_batch_step(job_desc_msg_t *job_desc_msg, uid_t uid, agent_arg_t *agent_arg_ptr; struct node_record *node_ptr; - if (job_desc_msg->array_inx && job_desc_msg->array_inx[0]) - return ESLURM_INVALID_ARRAY; - /* * Create a job step. Note that a credential is not necessary, * since the slurmctld will be submitting this job directly to @@ -4497,6 +4494,9 @@ static int _launch_batch_step(job_desc_msg_t *job_desc_msg, uid_t uid, job_step_create_request_msg_t req_step_msg; struct step_record *step_rec; + if (job_desc_msg->array_inx && job_desc_msg->array_inx[0]) + return ESLURM_INVALID_ARRAY; + /* * As far as the step record in slurmctld goes, we are just * launching a batch script which will be run on a single diff --git a/testsuite/expect/Makefile.am b/testsuite/expect/Makefile.am index 3b581d68ec2e45b8c0bd04c377b3869a05892cf8..1204e42ae1961651a078c3698dadbf487ded3157 100644 --- a/testsuite/expect/Makefile.am +++ b/testsuite/expect/Makefile.am @@ -527,8 +527,7 @@ EXTRA_DIST = \ etc.33.1.4/testcases \ etc.33.1.4/topology.conf \ test34.1 \ - test34.2 \ - usleep + test34.2 distclean-local: rm -rf *error *output diff --git a/testsuite/expect/Makefile.in b/testsuite/expect/Makefile.in index 3d7e23da745c8687ba20e3167d5e090fac2ec226..87dc0fd90b8887a79818fc021ef8e17fba948886 100644 --- a/testsuite/expect/Makefile.in +++ b/testsuite/expect/Makefile.in @@ -924,8 +924,7 @@ EXTRA_DIST = \ etc.33.1.4/testcases \ etc.33.1.4/topology.conf \ test34.1 \ - test34.2 \ - usleep + test34.2 all: all-am diff --git a/testsuite/expect/globals b/testsuite/expect/globals index 048cf637d3fd4aea0cad307e65368d89b79e0951..2a17a91f7add147dce5436eda7af7c2ee370489b 100755 --- a/testsuite/expect/globals +++ b/testsuite/expect/globals @@ -180,7 +180,6 @@ cset bin_sleep "sleep" cset bin_sort "sort" cset bin_touch "touch" cset bin_uname "uname" -cset bin_usleep "usleep" cset bin_wc "wc" cset bin_printenv "printenv" @@ -423,7 +422,7 @@ proc get_my_gid { } { ################################################################ proc kill_salloc { } { - global bin_id bin_pkill bin_sleep bin_usleep number + global bin_id bin_pkill bin_sleep number spawn $bin_id -u expect { @@ -459,7 +458,7 @@ proc kill_salloc { } { ################################################################ proc kill_srun { } { - global bin_id bin_pkill bin_sleep bin_usleep number + global bin_id bin_pkill bin_sleep number spawn $bin_id -u expect { diff --git a/testsuite/expect/test1.26 b/testsuite/expect/test1.26 index 3726a387dffb8a63b926bd0cde3f76cc6833d5bc..0b72627df6aa3b7129ab766f7662873062b25227 100755 --- a/testsuite/expect/test1.26 +++ b/testsuite/expect/test1.26 @@ -166,16 +166,16 @@ set front_end [test_front_end] set successes 0 for {set inx 0} {$inx < $iterations} {incr inx} { - exec $bin_usleep 250000 + exec $bin_sleep 0.25 set failures 0 set srun_pid [spawn $srun -N1 --nodelist=$nodelist_name -t1 -l $bin_printenv SLURMD_NODENAME] set alloc $spawn_id - set srun_pid1 [spawn $srun -N1 --nodelist=$include_node -Z $bin_usleep 500000] + set srun_pid1 [spawn $srun -N1 --nodelist=$include_node -Z $bin_sleep 0.5] set noalloc1 $spawn_id - set srun_pid2 [spawn $srun -N1 --nodelist=$include_node -Z $bin_usleep 250000] + set srun_pid2 [spawn $srun -N1 --nodelist=$include_node -Z $bin_sleep 0.25] set noalloc2 $spawn_id set timeout 20 diff --git a/testsuite/expect/test17.35 b/testsuite/expect/test17.35 index 198db32b31d1e537b156f887f4e0808b6c0397a9..55f4a6570c44805a8f2d87641ac17b45ce2437dc 100755 --- a/testsuite/expect/test17.35 +++ b/testsuite/expect/test17.35 @@ -56,31 +56,28 @@ wait set match 0 set time_used 100000 set timeout [expr $max_job_delay * 10] -spawn time -f "elapsed %E" ./$file_in +spawn time -p ./$file_in expect { -re "Submitted batch job ($number)" { incr match exp_continue } - -re "elapsed ($number):($digit)($digit).($digit)($digit)" { - set mins $expect_out(1,string) - set secs [expr $expect_out(2,string) * 10 + $expect_out(3,string)] - set tenths $expect_out(4,string) - set hundredths $expect_out(5,string) - set time_used [expr $mins * 60000 + $secs * 1000 + $tenths * 100 + $hundredths * 10] + -re "real *($number).($digit)($digit)" { + set secs $expect_out(1,string) + set tenths $expect_out(2,string) + set hundredths $expect_out(3,string) + set time_used [expr $secs * 1000 + $tenths * 100 + $hundredths * 10] exp_continue } - -re "elapsed ($number):($digit)($digit).($digit)" { - set mins $expect_out(1,string) - set secs [expr $expect_out(2,string) * 10 + $expect_out(3,string)] - set tenths $expect_out(4,string) - set time_used [expr $mins * 60000 + $secs * 1000 + $tenths * 100] + -re "real *($number).($digit)" { + set secs $expect_out(1,string) + set tenths $expect_out(2,string) + set time_used [expr $secs * 1000 + $tenths * 100] exp_continue } - -re "elapsed ($number):($digit)($digit)" { - set mins $expect_out(1,string) - set secs [expr $expect_out(2,string) * 10 + $expect_out(3,string)] - set time_used [expr $mins * 60000 + $secs * 1000] + -re "real *($number)" { + set secs $expect_out(1,string) + set time_used [expr $secs * 1000] exp_continue } timeout { diff --git a/testsuite/expect/test22.1 b/testsuite/expect/test22.1 index b471a48cc3b14742a42f8291872e6a2e78145e17..4676252b936931b2839f5849b2635e05b6cc2e15 100755 --- a/testsuite/expect/test22.1 +++ b/testsuite/expect/test22.1 @@ -89,15 +89,15 @@ print_header $test_id # Fri Thu Jan 31 00:00:00 2008 - Needed only for the 00:00:00 for timing purposes set midnight_time "Thu Jan 31 00:00:00 2008" -set midnight [exec date +%s --date=$midnight_time] +set midnight [exec date -d $midnight_time +%s] # Mon Dec 31 23:00:00 2007 set start_date "Mon Dec 31 23:00:00 2007" -set period_start [exec date +%s --date=$start_date] +set period_start [exec date -d $start_date +%s] # Thu Jan 31 23:59:59 2008 set end_date "Thu Jan 31 23:59:59 2008" -set period_end [exec date +%s --date=$end_date] +set period_end [exec date -d $end_date +%s] set start_str [timestamp -format %Y-%m-%dT%X -seconds $period_start] set end_str [timestamp -format %Y-%m-%dT%X -seconds $period_end] diff --git a/testsuite/expect/test30.1 b/testsuite/expect/test30.1 index 3c19c7f821b8e3f8a1a3ddfd23666eefca92e360..e6616e420c4ae8633751bf7ae85ad34864f60f3b 100755 --- a/testsuite/expect/test30.1 +++ b/testsuite/expect/test30.1 @@ -78,7 +78,7 @@ if {[test_cray] || [test_alps]} { set timeout 1000 exec $bin_rm -fr /tmp/slurm $tar_name /tmp/built_rpms -spawn $bin_cp -L -r -v $src_dir /tmp/slurm +spawn $bin_cp -L -R -v $src_dir /tmp/slurm expect { timeout { send_user "\nFAILURE: $src_dir was not copied\n" diff --git a/testsuite/expect/usleep b/testsuite/expect/usleep deleted file mode 100755 index 9d23052369c76398df09dfecbe3829e3abfbe21f..0000000000000000000000000000000000000000 --- a/testsuite/expect/usleep +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -############################################################################ -# This shell processes usleep commands as required by the test scripts -# on systems lacking the usleep command (e.g. AIX). It does not -# interpret all usleep options, only those required for these tests. -############################################################################ -# Copyright (C) 2002 The Regents of the University of California. -# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). -# Written by Morris Jette <jette1@llnl.gov> -# CODE-OCEC-09-009. All rights reserved. -# -# This file is part of SLURM, a resource management program. -# For details, see <http://slurm.schedmd.com/>. - # Please also read the supplied file: DISCLAIMER. -# -# SLURM is free software; you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation; either version 2 of the License, or (at your option) -# any later version. -# -# SLURM is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# -# You should have received a copy of the GNU General Public License along -# with SLURM; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -############################################################################ -# -# Read command line options -if [ $# -ge 1 ]; then - usec=$1 - sec=$(($usec/1000000)) -else - usec=1 - sec=1 -fi -# Validate command line options -if [ $sec -lt 1 ]; then - sec=1 -fi -# Find the appropriate processes and signal them -sleep $sec