diff --git a/NEWS b/NEWS index d04095df327ff4e106e768e4a7b34cc52c050755..5db92fb6d2b9c5dd14f2e588b49d713a02edef9a 100644 --- a/NEWS +++ b/NEWS @@ -77,8 +77,10 @@ documents those changes that are of interest to users and admins. -- BLUEGENE - env vars such as SLURM_NNODES, SLURM_JOB_NUM_NODES, and SLURM_JOB_CPUS_PER_NODE now reference cnode counts instead of midplane counts. SLURM_NODELIST still references midplane names. - -- Added qos support to salloc/sbatch/srun + -- Added qos support to salloc/sbatch/srun/squeue -- Added to scancel the ability to select jobs by account and qos + -- Recycled the "-A" argument indicate "account" for all the commands that + accept the --account argument (srun -A to allocate is no longer supported.) * Changes in SLURM 2.1.0-pre2 ============================= diff --git a/doc/man/man1/salloc.1 b/doc/man/man1/salloc.1 index e0fe6e747915b89cab06a971f04c36a4ef39f5d4..596be9aba604b18789a19bcb0c0a76c10b768fac 100644 --- a/doc/man/man1/salloc.1 +++ b/doc/man/man1/salloc.1 @@ -24,6 +24,13 @@ user's default shell. .SH "OPTIONS" .LP +.TP +\fB\-A\fR, \fB\-\-account\fR=<\fIaccount\fR> +Charge resources used by this job to specified account. +The \fIaccount\fR is an arbitrary string. The account name may +be changed after job submission using the \fBscontrol\fR +command. + .TP \fB\-\-acctg\-freq\fR=<\fIseconds\fR> Define the job accounting sampling interval. @@ -746,13 +753,6 @@ limit be imposed. Acceptable time formats include "minutes", \fB\-\-tmp\fR=<\fIMB\fR> Specify a minimum amount of temporary disk space. -.TP -\fB\-U\fR, \fB\-\-account\fR=<\fIaccount\fR> -Charge resources used by this job to specified account. -The \fIaccount\fR is an arbitrary string. The account name may -be changed after job submission using the \fBscontrol\fR -command. - .TP \fB\-u\fR, \fB\-\-usage\fR Display brief help message and exit. @@ -869,7 +869,7 @@ variables settings. .TP 22 \fBSALLOC_ACCOUNT\fR -Same as \fB\-U, \-\-account\fR +Same as \fB\-A, \-\-account\fR .TP \fBSALLOC_ACCTG_FREQ\fR Same as \fB\-\-acctg\-freq\fR diff --git a/doc/man/man1/sbatch.1 b/doc/man/man1/sbatch.1 index 59ca487d045cad3f1b94c9193142418f0c7225a6..24ad26eaaab9a0dc31e2417efcc10d571455f9c8 100644 --- a/doc/man/man1/sbatch.1 +++ b/doc/man/man1/sbatch.1 @@ -23,6 +23,13 @@ allocated nodes. .SH "OPTIONS" .LP +.TP +\fB\-A\fR, \fB\-\-account\fR=<\fIaccount\fR> +Charge resources used by this job to specified account. +The \fIaccount\fR is an arbitrary string. The account name may +be changed after job submission using the \fBscontrol\fR +command. + .TP \fB\-\-acctg\-freq\fR=<\fIseconds\fR> Define the job accounting sampling interval. @@ -846,13 +853,6 @@ Equivalent to \fB\-\-ntasks\-per\-node\fR. \fB\-\-tmp\fR=<\fIMB\fR> Specify a minimum amount of temporary disk space. -.TP -\fB\-U\fR, \fB\-\-account\fR=<\fIaccount\fR> -Charge resources used by this job to specified account. -The \fIaccount\fR is an arbitrary string. The account name may -be changed after job submission using the \fBscontrol\fR -command. - .TP \fB\-u\fR, \fB\-\-usage\fR Display brief help message and exit. @@ -973,7 +973,7 @@ environment variables. .TP 22 \fBSBATCH_ACCOUNT\fR -Same as \fB\-U, \-\-account\fR +Same as \fB\-A, \-\-account\fR .TP \fBSBATCH_ACCTG_FREQ\fR Same as \fB\-\-acctg\-freq\fR diff --git a/doc/man/man1/scancel.1 b/doc/man/man1/scancel.1 index df8244cd0bdcb77ec88f30a5e25bffc46ba014a7..e9fc04c05585cb5f722bb4ca5665074f13e08e07 100644 --- a/doc/man/man1/scancel.1 +++ b/doc/man/man1/scancel.1 @@ -17,7 +17,7 @@ be printed and the job will not be signaled. .SH "OPTIONS" .TP -\fB\-a\fR, \fB\-\-account\fR=\fIaccount\fR +\fB\-A\fR, \fB\-\-account\fR=\fIaccount\fR Restrict the scancel operation to jobs under this charge account. .TP @@ -129,7 +129,7 @@ environment variables, along with their corresponding options, are listed below. (Note: commandline options will always override these settings) .TP 20 \fBSCANCEL_ACCOUNT\fR -\fB\-a\fR, \fB\-\-account\fR=\fIaccount\fR +\fB\-A\fR, \fB\-\-account\fR=\fIaccount\fR .TP 20 \fBSCANCEL_BATCH\fR \fB\-b, \-\-batch\fR diff --git a/doc/man/man1/squeue.1 b/doc/man/man1/squeue.1 index 30a0b685fd70ea921c8054fe15d3f91918dffdf0..194086e60378a177e38304d18a8d977c6a232087 100644 --- a/doc/man/man1/squeue.1 +++ b/doc/man/man1/squeue.1 @@ -12,6 +12,11 @@ SLURM. .SH "OPTIONS" +.TP +\fB\-A <account_list>\fR, \fB\-\-account=<account_list>\fR +Specify the accounts of the jobs to view. Accepts a comma separated +list of account names. This has no effect when listing job steps. + .TP \fB\-a\fR, \fB\-\-all\fR Display information about jobs and job steps in all partions. @@ -158,6 +163,8 @@ Job or job step name. Minimum number of threads per core requested by the job. This reports the value of the \fBsrun \-\-minthreads\fR option. .TP +\fB%k\fR +Comment associated with the job. \fB%l\fR Time limit of the job or job step in days\-hours:minutes:seconds. The value may be "NOT_SET" if not yet established or "UNLIMITED" for no limit. @@ -199,8 +206,8 @@ Also see \fB%Q\fR. \fB%P\fR Partition of the job or job step. .TP -\fB%q\fR -Comment associated with the job. +\fB%q\fR +Quality of service associated with the job. .TP \fB%Q\fR Priority of the job (generally a very large unsigned integer). @@ -264,6 +271,11 @@ the job. Specify the partitions of the jobs or steps to view. Accepts a comma separated list of partition names. +.TP +\fB\-q <qos_list>\fR, \fB\-\-qos=<qos_list>\fR +Specify the qos(s) of the jobs or steps to view. Accepts a comma +separated list of qos's. + .TP \fB\-s\fR, \fB\-\-steps\fR Specify the job steps to view. This flag indicates that a comma separated list @@ -298,11 +310,6 @@ FAILED (F), TIMEOUT (TO), and NODE_FAIL (NF). Note the \fB<state_list>\fR supplied is case insensitve ("pd" and "PD" work the same). See the \fBJOB STATE CODES\fR section below for more information. -.TP -\fB\-U <account_list>\fR, \fB\-\-account=<account_list>\fR -Specify the accounts of the jobs to view. Accepts a comma separated -list of account names. This have no effect when listing job steps. - .TP \fB\-u <user_list>\fR, \fB\-\-user=<user_list>\fR Request jobs or job steps from a comma separated list of users. The @@ -417,6 +424,9 @@ below. (Note: Commandline options will always override these settings.) \fBSLURM_CONF\fR The location of the SLURM configuration file. .TP +\fBSQUEUE_ACCOUNT\fR +\fB\-A <account_list>, \-\-account=<account_list>\fR +.TP \fBSQUEUE_ALL\fR \fB\-a, \-\-all\fR .TP @@ -426,6 +436,9 @@ The location of the SLURM configuration file. \fBSQUEUE_PARTITION\fR \fB\-p <part_list>, \-\-partition=<part_list>\fR .TP +\fBSQUEUE_QOS\fR +\fB\-p <qos_list>, \-\-qos=<qos_list>\fR +.TP \fBSQUEUE_SORT\fR \fB\-S <sort_list>, \-\-sort=<sort_list>\fR .TP diff --git a/doc/man/man1/srun.1 b/doc/man/man1/srun.1 index 36e8d04874a8e417a2d9b3ae569af5ce91176653..113356be32ce5c1e70b0e3d879cbfc0159092995 100644 --- a/doc/man/man1/srun.1 +++ b/doc/man/man1/srun.1 @@ -13,6 +13,13 @@ first create a resource allocation in which to run the parallel job. .SH "OPTIONS" .LP +.TP +\fB\-A\fR, \fB\-\-account\fR=<\fIaccount\fR> +Charge resources used by this job to specified account. +The \fIaccount\fR is an arbitrary string. The account name may +be changed after job submission using the \fBscontrol\fR +command. + .TP \fB\-\-acctg\-freq\fR=<\fIseconds\fR> Define the job accounting sampling interval. @@ -974,13 +981,6 @@ for the task being spawned. \fB\-\-tmp\fR=<\fIMB\fR> Specify a minimum amount of temporary disk space. -.TP -\fB\-U\fR, \fB\-\-account\fR=<\fIaccount\fR> -Charge resources used by this job to specified account. -The \fIaccount\fR is an arbitrary string. The account name may -be changed after job submission using the \fBscontrol\fR -command. - .TP \fB\-u\fR, \fB\-\-unbuffered\fR Do not line buffer stdout from remote tasks. This option cannot be used @@ -1290,7 +1290,7 @@ may be required. The location of the SLURM configuration file. .TP \fBSLURM_ACCOUNT\fR -Same as \fB\-U, \-\-account\fR +Same as \fB\-A, \-\-account\fR .TP \fBSLURM_ACCTG_FREQ\fR Same as \fB\-\-acctg\-freq\fR diff --git a/src/salloc/opt.c b/src/salloc/opt.c index ff064328874c74ddfd91f99611277fc8312aeafc..bc972f5ffefc375c94927e5d8c38562b34c58614 100644 --- a/src/salloc/opt.c +++ b/src/salloc/opt.c @@ -548,6 +548,7 @@ void set_options(const int argc, char **argv) int opt_char, option_index = 0; char *tmp; static struct option long_options[] = { + {"account", required_argument, 0, 'A'}, {"extra-node-info", required_argument, 0, 'B'}, {"cpus-per-task", required_argument, 0, 'c'}, {"constraint", required_argument, 0, 'C'}, @@ -573,7 +574,6 @@ void set_options(const int argc, char **argv) {"share", no_argument, 0, 's'}, {"time", required_argument, 0, 't'}, {"usage", no_argument, 0, 'u'}, - {"account", required_argument, 0, 'U'}, {"verbose", no_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, {"nodelist", required_argument, 0, 'w'}, @@ -625,7 +625,8 @@ void set_options(const int argc, char **argv) {"wckey", required_argument, 0, LONG_OPT_WCKEY}, {NULL, 0, 0, 0} }; - char *opt_string = "+B:c:C:d:D:F:g:hHIJ:kK::L:m:n:N:Op:P:QRst:uU:vVw:W:x:"; + char *opt_string = + "+A:B:c:C:d:D:F:g:hHIJ:kK::L:m:n:N:Op:P:QRst:uU:vVw:W:x:"; struct option *optz = spank_option_table_create(long_options); @@ -643,6 +644,11 @@ void set_options(const int argc, char **argv) "information\n"); exit(1); break; + case 'A': + case 'U': /* backwards compatibility */ + xfree(opt.account); + opt.account = xstrdup(optarg); + break; case 'B': opt.extra_set = verify_socket_core_thread_count( optarg, @@ -772,10 +778,6 @@ void set_options(const int argc, char **argv) case 'u': _usage(); exit(0); - case 'U': - xfree(opt.account); - opt.account = xstrdup(optarg); - break; case 'v': opt.verbose++; break; @@ -1726,6 +1728,7 @@ static void _help(void) "Usage: salloc [OPTIONS...] [executable [args...]]\n" "\n" "Parallel run options:\n" +" -A, --account=name charge job to specified account\n" " --begin=time defer job until HH:MM DD/MM/YY\n" " --bell ring the terminal bell when the job is allocated\n" " -c, --cpus-per-task=ncpus number of cpus required per task\n" @@ -1758,7 +1761,6 @@ static void _help(void) " -s, --share share nodes with other jobs\n" " -t, --time=minutes time limit\n" " --uid=user_id user ID to run job as (user root only)\n" -" -U, --account=name charge job to specified account\n" " -v, --verbose verbose mode (multiple -v's increase verbosity)\n" "\n" "Constraint options:\n" @@ -1807,18 +1809,17 @@ static void _help(void) spank_print_options(stdout, 6, 30); - printf("\n" + printf("\n" #ifdef HAVE_AIX /* AIX/Federation specific options */ "AIX related options:\n" -" --network=type communication protocol to be used\n" +" --network=type communication protocol to be used\n" "\n" #endif #ifdef HAVE_BG /* Blue gene specific options */ -"\n" "Blue Gene related options:\n" " -g, --geometry=XxYxZ geometry constraints of the job\n" " -R, --no-rotate disable geometry rotation\n" -" --reboot reboot nodes before starting job\n" +" --reboot reboot block before starting job\n" " --conn-type=type constraint on type of connection, MESH or TORUS\n" " if not set, then tries to fit TORUS else MESH\n" #ifndef HAVE_BGL @@ -1848,6 +1849,6 @@ static void _help(void) "Other options:\n" " -V, --version output version information and exit\n" "\n" -); + ); } diff --git a/src/sbatch/opt.c b/src/sbatch/opt.c index 60b4cc0436616b065cad73f799e6deaa859c0a61..4913f972a15d41043aabc13c6164984540be6f58 100644 --- a/src/sbatch/opt.c +++ b/src/sbatch/opt.c @@ -594,6 +594,7 @@ _process_env_var(env_vars_t *e, const char *val) /*---[ command line option processing ]-----------------------------------*/ static struct option long_options[] = { + {"account", required_argument, 0, 'A'}, {"batch", no_argument, 0, 'b'}, /* batch option is only here for moab tansition @@ -625,7 +626,6 @@ static struct option long_options[] = { {"share", no_argument, 0, 's'}, {"time", required_argument, 0, 't'}, {"usage", no_argument, 0, 'u'}, - {"account", required_argument, 0, 'U'}, {"verbose", no_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, {"nodelist", required_argument, 0, 'w'}, @@ -682,7 +682,7 @@ static struct option long_options[] = { }; static char *opt_string = - "+bB:c:C:d:D:e:F:g:hHi:IJ:kL:m:n:N:o:Op:P:QRst:uU:vVw:x:"; + "+bA:B:c:C:d:D:e:F:g:hHi:IJ:kL:m:n:N:o:Op:P:QRst:uU:vVw:x:"; /* @@ -1050,6 +1050,11 @@ static void _set_options(int argc, char **argv) case '?': fatal("Try \"sbatch --help\" for more information"); break; + case 'A': + case 'U': /* backwards compatibility */ + xfree(opt.account); + opt.account = xstrdup(optarg); + break; case 'b': /* Only here for Moab transition not suppose to do anything */ @@ -1196,10 +1201,6 @@ static void _set_options(int argc, char **argv) case 'u': _usage(); exit(0); - case 'U': - xfree(opt.account); - opt.account = xstrdup(optarg); - break; case 'v': opt.verbose++; break; @@ -2551,6 +2552,7 @@ static void _help(void) "Usage: sbatch [OPTIONS...] executable [args...]\n" "\n" "Parallel run options:\n" +" -A, --account=name charge job to specified account\n" " --begin=time defer job until HH:MM DD/MM/YY\n" " -c, --cpus-per-task=ncpus number of cpus required per task\n" " --comment=name arbitrary comment\n" @@ -2585,7 +2587,6 @@ static void _help(void) " --requeue if set, permit the job to be requeued\n" " -t, --time=minutes time limit\n" " -s, --share share nodes with other jobs\n" -" -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" "\n" @@ -2606,8 +2607,9 @@ static void _help(void) "Consumable resources related options:\n" " --exclusive allocate nodes in exclusive mode when\n" " cpu consumable resource is enabled\n" -" --mem-per-cpu=MB maximum amount of real memory per CPU\n" -" allocated to the job.\n" +" --mem-per-cpu=MB maximum amount of real memory per allocated\n" +" cpu required by the job.\n" +" --mem >= --mem-per-cpu if --mem is specified.\n" "\n" "Affinity/Multi-core options: (when the task/affinity plugin is enabled)\n" " -B --extra-node-info=S[:C[:T]] Expands to:\n" @@ -2632,9 +2634,9 @@ static void _help(void) } slurm_conf_unlock(); - spank_print_options (stdout, 6, 30); + spank_print_options(stdout, 6, 30); - printf( + printf("\n" #ifdef HAVE_AIX /* AIX/Federation specific options */ "AIX related options:\n" " --network=type communication protocol to be used\n" @@ -2674,6 +2676,6 @@ static void _help(void) "Other options:\n" " -V, --version output version information and exit\n" "\n" -); + ); } diff --git a/src/scancel/opt.c b/src/scancel/opt.c index 88b4cc323fe9ee0db934ab171c5f5cca6882fca4..d33f60180ce9fd294026cad89c830d455f1dad65 100644 --- a/src/scancel/opt.c +++ b/src/scancel/opt.c @@ -332,7 +332,7 @@ static void _opt_args(int argc, char **argv) int opt_char; int option_index; static struct option long_options[] = { - {"account", required_argument, 0, 'a'}, + {"account", required_argument, 0, 'A'}, {"batch", no_argument, 0, 'b'}, {"ctld", no_argument, 0, OPT_LONG_CTLD}, {"help", no_argument, 0, OPT_LONG_HELP}, @@ -352,7 +352,7 @@ static void _opt_args(int argc, char **argv) {NULL, 0, 0, 0} }; - while((opt_char = getopt_long(argc, argv, "a:bin:p:Qq:s:t:u:vVw:", + while((opt_char = getopt_long(argc, argv, "A:bin:p:Qq:s:t:u:vVw:", long_options, &option_index)) != -1) { switch (opt_char) { case (int)'?': @@ -361,7 +361,7 @@ static void _opt_args(int argc, char **argv) "information\n"); exit(1); break; - case (int)'a': + case (int)'A': opt.account = xstrdup(optarg); break; case (int)'b': @@ -531,7 +531,7 @@ static void _opt_list(void) static void _usage(void) { - printf("Usage: scancel [-a account] [--batch] [--interactive] [-n job_name]\n"); + printf("Usage: scancel [-A account] [--batch] [--interactive] [-n job_name]\n"); printf(" [-p partition] [-Q] [-q qos] [-s signal | integer]\n"); printf(" [-t PENDING | RUNNING | SUSPENDED] [--usage] [-u user_name]\n"); printf(" [-V] [-v] [-w hosts...] [--wckey=wckey] [job_id[.step_id]]\n"); @@ -540,7 +540,7 @@ static void _usage(void) static void _help(void) { printf("Usage: scancel [OPTIONS] [job_id[.step_id]]\n"); - printf(" -a, --account=account act only on jobs charging this account\n"); + printf(" -A, --account=account act only on jobs charging this account\n"); printf(" -b, --batch signal batch shell for specified job\n"); /* printf(" --ctld route request through slurmctld\n"); */ printf(" -i, --interactive require response from user for each job\n"); diff --git a/src/squeue/opts.c b/src/squeue/opts.c index 49b161245b8f66a13ffd7fc2e92c4afeef9b8568..42c384c38afd7efeaaf78883be7d4d647c89c310 100644 --- a/src/squeue/opts.c +++ b/src/squeue/opts.c @@ -95,6 +95,7 @@ parse_command_line( int argc, char* argv[] ) int opt_char; int option_index; static struct option long_options[] = { + {"accounts", required_argument, 0, 'A'}, {"all", no_argument, 0, 'a'}, {"noheader", no_argument, 0, 'h'}, {"iterate", required_argument, 0, 'i'}, @@ -104,12 +105,12 @@ parse_command_line( int argc, char* argv[] ) {"nodes", required_argument, 0, 'n'}, {"format", required_argument, 0, 'o'}, {"partitions", required_argument, 0, 'p'}, + {"qos", required_argument, 0, 'q'}, {"steps", optional_argument, 0, 's'}, {"sort", required_argument, 0, 'S'}, {"states", required_argument, 0, 't'}, {"user", required_argument, 0, 'u'}, {"users", required_argument, 0, 'u'}, - {"account", required_argument, 0, 'U'}, {"verbose", no_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, {"help", no_argument, 0, OPT_LONG_HELP}, @@ -126,13 +127,20 @@ parse_command_line( int argc, char* argv[] ) params.sort = xstrdup(env_val); while((opt_char = getopt_long(argc, argv, - "ahi:j::ln:o:p:s::S:t:u:U:vV", + "A:ahi:j::ln:o:p:q:s::S:t:u:U:vV", long_options, &option_index)) != -1) { switch (opt_char) { case (int)'?': fprintf(stderr, "Try \"squeue --help\" " "for more information\n"); exit(1); + case (int) 'A': + case (int) 'U': /* backwards compatibility */ + xfree(params.accounts); + params.accounts = xstrdup(optarg); + params.account_list = + _build_str_list( params.accounts ); + break; case (int)'a': params.all_flag = true; break; @@ -179,11 +187,11 @@ parse_command_line( int argc, char* argv[] ) _build_str_list( params.partitions ); params.all_flag = true; break; - case (int) 'U': - xfree(params.accounts); - params.accounts = xstrdup(optarg); - params.account_list = - _build_str_list( params.accounts ); + case (int) 'q': + xfree(params.qoss); + params.qoss = xstrdup(optarg); + params.qos_list = + _build_str_list( params.qoss ); break; case (int) 's': if (optarg) { @@ -284,6 +292,12 @@ parse_command_line( int argc, char* argv[] ) params.nodes = nodenames; } + if ( ( params.accounts == NULL ) && + ( env_val = getenv("SQUEUE_ACCOUNT") ) ) { + params.accounts = xstrdup(env_val); + params.account_list = _build_str_list( params.accounts ); + } + if ( ( params.partitions == NULL ) && ( env_val = getenv("SQUEUE_PARTITION") ) ) { params.partitions = xstrdup(env_val); @@ -291,10 +305,10 @@ parse_command_line( int argc, char* argv[] ) params.all_flag = true; } - if ( ( params.accounts == NULL ) && - ( env_val = getenv("SQUEUE_ACCOUNT") ) ) { - params.accounts = xstrdup(env_val); - params.account_list = _build_str_list( params.accounts ); + if ( ( params.qoss == NULL ) && + ( env_val = getenv("SQUEUE_QOS") ) ) { + params.qoss = xstrdup(env_val); + params.qos_list = _build_str_list( params.qoss ); } if ( ( params.states == NULL ) && @@ -557,6 +571,11 @@ extern int parse_format( char* format ) field_size, right_justify, suffix ); + else if (field[0] == 'k') + job_format_add_comment( params.format_list, + field_size, + right_justify, + suffix ); else if (field[0] == 'l') job_format_add_time_limit( params.format_list, field_size, @@ -602,10 +621,10 @@ extern int parse_format( char* format ) right_justify, suffix ); else if (field[0] == 'q') - job_format_add_comment( params.format_list, - field_size, - right_justify, - suffix ); + job_format_add_qos( params.format_list, + field_size, + right_justify, + suffix ); else if (field[0] == 'Q') job_format_add_priority_long( params.format_list, @@ -1041,25 +1060,29 @@ static void _help(void) { printf("\ Usage: squeue [OPTIONS]\n\ + -A, --account=account(s) comma separated list of accounts\n\ + to view, default is all accounts\n\ -a, --all display jobs in hidden partitions\n\ -h, --noheader no headers on output\n\ --hide do not display jobs in hidden partitions\n\ -i, --iterate=seconds specify an interation period\n\ - -j, --jobs comma separated list of jobs\n\ + -j, --job=job(s) comma separated list of jobs IDs\n\ to view, default is all\n\ -l, --long long report\n\ -n, --nodes=hostlist list of nodes to view, default is \n\ all nodes\n\ -o, --format=format format specification\n\ - -p, --partitions=partitions comma separated list of partitions\n\ + -p, --partition=partition(s) comma separated list of partitions\n\ to view, default is all partitions\n\ - -s, --steps comma separated list of job steps\n\ + -q, --qos=qos(s) comma separated list of qos's\n\ + to view, default is all qos's\n\ + -s, --step=step(s) comma separated list of job steps\n\ to view, default is all\n\ - -S, --sort=fields comma seperated list of fields to sort on\n\ - -t, --states=states comma seperated list of states to view,\n\ + -S, --sort=field(s) comma separated list of fields to sort on\n\ + -t, --state=state(s) comma separated list of states to view,\n\ default is pending and running,\n\ '--states=all' reports all states\n\ - -u, --user=user_name comma separated list of users to view\n\ + -u, --user=user_name(s) comma separated list of users to view\n\ -v, --verbose verbosity level\n\ -V, --version output version information and exit\n\ \nHelp options:\n\ diff --git a/src/squeue/print.c b/src/squeue/print.c index cdda1b7ec36f73fcb3cf4d112a0ffc38404535f5..185e0e657cebda88c12e02965b8a176e6def0dd9 100644 --- a/src/squeue/print.c +++ b/src/squeue/print.c @@ -1024,6 +1024,18 @@ int _print_job_dependency(job_info_t * job, int width, bool right_justify, return SLURM_SUCCESS; } +int _print_job_qos(job_info_t * job, int width, bool right_justify, + char* suffix) +{ + if (job == NULL) /* Print the Header instead */ + _print_str("QOS", width, right_justify, true); + else + _print_str(job->qos, width, right_justify, true); + if (suffix) + printf("%s", suffix); + return SLURM_SUCCESS; +} + int _print_job_select_jobinfo(job_info_t * job, int width, bool right_justify, char* suffix) { @@ -1262,7 +1274,7 @@ static int _filter_job(job_info_t * job) ListIterator iterator; uint32_t *job_id, *user; uint16_t *state_id; - char *part, *account; + char *account, *part, *qos; if (params.job_list) { filter = 1; @@ -1307,6 +1319,21 @@ static int _filter_job(job_info_t * job) return 2; } + if (params.qos_list) { + filter = 1; + iterator = list_iterator_create(params.qos_list); + while ((qos = list_next(iterator))) { + if ((job->qos != NULL) && + (strcmp(qos, job->qos) == 0)) { + filter = 0; + break; + } + } + list_iterator_destroy(iterator); + if (filter == 1) + return 2; + } + if (params.state_list) { filter = 1; iterator = list_iterator_create(params.state_list); diff --git a/src/squeue/print.h b/src/squeue/print.h index 9fa7ebc187389e444d559b37b2905e9fdd0a6018..43fdf1a106456d6d23c0bbc8f4cbee924bc26bae 100644 --- a/src/squeue/print.h +++ b/src/squeue/print.h @@ -164,6 +164,8 @@ int job_format_add_function(List list, int width, bool right_justify, job_format_add_function(list,wid,right,suffix,_print_job_account) #define job_format_add_dependency(list,wid,right,suffix) \ job_format_add_function(list,wid,right,suffix,_print_job_dependency) +#define job_format_add_qos(list,wid,right,suffix) \ + job_format_add_function(list,wid,right,suffix,_print_job_qos) #define job_format_add_select_jobinfo(list,wid,right,suffix) \ job_format_add_function(list,wid,right,suffix,_print_job_select_jobinfo) #define job_format_add_comment(list,wid,right,suffix) \ @@ -256,6 +258,8 @@ int _print_job_account(job_info_t * job, int width, bool right_justify, char* suffix); int _print_job_dependency(job_info_t * job, int width, bool right_justify, char* suffix); +int _print_job_qos(job_info_t * job, int width, bool right_justify, + char* suffix); int _print_job_select_jobinfo(job_info_t * job, int width, bool right_justify, char* suffix); int _print_job_comment(job_info_t * job, int width, bool right_justify, diff --git a/src/squeue/squeue.h b/src/squeue/squeue.h index a4c9bb285f009b263a88a040f59a19eab76f2e76..d448a064eaebd501b6ffd4c875d311ce0cf9f403 100644 --- a/src/squeue/squeue.h +++ b/src/squeue/squeue.h @@ -84,23 +84,25 @@ struct squeue_parameters { int max_procs; int verbose; + char* accounts; + char* format; char* jobs; hostset_t nodes; char* partitions; - char* accounts; + char* qoss; + char* sort; char* states; char* steps; char* users; - char* format; - char* sort; + List account_list; + List format_list; List job_list; List part_list; - List account_list; + List qos_list; List state_list; List step_list; List user_list; - List format_list; }; extern struct squeue_parameters params; diff --git a/src/srun/opt.c b/src/srun/opt.c index c8738f1092ba825233347a4e7592e680710a5f20..96f32e3ec8eee757c0dc97c700d6d4a679d345be 100644 --- a/src/srun/opt.c +++ b/src/srun/opt.c @@ -697,7 +697,7 @@ static void set_options(const int argc, char **argv) struct utsname name; static struct option long_options[] = { {"attach", no_argument, 0, 'a'}, - {"allocate", no_argument, 0, 'A'}, + {"account", required_argument, 0, 'A'}, {"batch", no_argument, 0, 'b'}, {"extra-node-info", required_argument, 0, 'B'}, {"cpus-per-task", required_argument, 0, 'c'}, @@ -732,7 +732,6 @@ static void set_options(const int argc, char **argv) {"time", required_argument, 0, 't'}, {"threads", required_argument, 0, 'T'}, {"unbuffered", no_argument, 0, 'u'}, - {"account", required_argument, 0, 'U'}, {"verbose", no_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, {"nodelist", required_argument, 0, 'w'}, @@ -804,7 +803,7 @@ static void set_options(const int argc, char **argv) {"wckey", required_argument, 0, LONG_OPT_WCKEY}, {NULL, 0, 0, 0} }; - char *opt_string = "+aAbB:c:C:d:D:e:Eg:Hi:IjJ:kKlL:m:n:N:" + char *opt_string = "+aA:bB:c:C:d:D:e:Eg:Hi:IjJ:kKlL:m:n:N:" "o:Op:P:qQr:Rst:T:uU:vVw:W:x:XZ"; struct option *optz = spank_option_table_create (long_options); @@ -828,14 +827,15 @@ static void set_options(const int argc, char **argv) "Try \"srun --help\" for more information\n"); exit(1); break; + case (int)'A': + case (int)'U': /* backwards compatibility */ + xfree(opt.account); + opt.account = xstrdup(optarg); + break; case (int)'a': error("Please use the \"sattach\" command instead of " "\"srun -a/--attach\"."); exit(1); - case (int)'A': - error("Please use the \"salloc\" command instead of " - "\"srun -A/--allocate\"."); - exit(1); case (int)'b': error("Please use the \"sbatch\" command instead of " "\"srun -b/--batch\"."); @@ -1010,10 +1010,6 @@ static void set_options(const int argc, char **argv) case (int)'u': opt.unbuffered = true; break; - case (int)'U': - xfree(opt.account); - opt.account = xstrdup(optarg); - break; case (int)'v': _verbose++; break; @@ -2181,6 +2177,7 @@ static void _help(void) "Usage: srun [OPTIONS...] executable [args...]\n" "\n" "Parallel run options:\n" +" -A, --account=name charge job to specified account\n" " --begin=time defer job until HH:MM DD/MM/YY\n" " -c, --cpus-per-task=ncpus number of cpus required per task\n" " --checkpoint=time job step checkpoint interval\n" @@ -2239,7 +2236,6 @@ static void _help(void) " --task-prolog=program run \"program\" before launching task\n" " -T, --threads=threads set srun launch fanout\n" " -u, --unbuffered do not line-buffer stdout/err\n" -" -U, --account=name charge job to specified account\n" " -v, --verbose verbose mode (multiple -v's increase verbosity)\n" " -W, --wait=sec seconds to wait after first task exits\n" " before killing job\n" @@ -2264,7 +2260,7 @@ static void _help(void) " cpu consumable resource is enabled\n" " or don't share CPUs for job steps\n" " --mem-per-cpu=MB maximum amount of real memory per allocated\n" -" CPU required by the job.\n" +" cpu required by the job.\n" " --mem >= --mem-per-cpu if --mem is specified.\n" " --resv-ports reserve communication ports\n" "\n" @@ -2275,10 +2271,9 @@ static void _help(void) " --threads-per-core=T number of threads per core to allocate\n" " each field can be 'min[-max]' or wildcard '*'\n" " total cpus requested = (N x S x C x T)\n" -" --ntasks-per-socket=n number of tasks to invoke on each socket\n" -" --ntasks-per-core=n number of tasks to invoke on each core\n" "\n" -"\n"); +" --ntasks-per-core=n number of tasks to invoke on each core\n" +" --ntasks-per-socket=n number of tasks to invoke on each socket\n"); conf = slurm_conf_lock(); if (conf->task_plugin != NULL && strcasecmp(conf->task_plugin, "task/affinity") == 0) { @@ -2288,19 +2283,18 @@ static void _help(void) " --hint= Bind tasks according to application hints\n" " (see \"--hint=help\" for options)\n" " --mem_bind= Bind memory to locality domains (ldom)\n" -" (see \"--mem_bind=help\" for options)\n" - ); +" (see \"--mem_bind=help\" for options)\n"); } slurm_conf_unlock(); - spank_print_options (stdout, 6, 30); + + spank_print_options(stdout, 6, 30); printf("\n" #ifdef HAVE_AIX /* AIX/Federation specific options */ "AIX related options:\n" -" --network=type communication protocol to be used\n" +" --network=type communication protocol to be used\n" "\n" #endif - #ifdef HAVE_BG /* Blue gene specific options */ "Blue Gene related options:\n" " -g, --geometry=XxYxZ geometry constraints of the job\n" @@ -2325,8 +2319,8 @@ static void _help(void) #endif "\n" "Help options:\n" -" --help show this help message\n" -" --usage display brief usage message\n" +" -h, --help show this help message\n" +" -u, --usage display brief usage message\n" " --print-request Display job's layout without scheduling it\n" "\n" "Other options:\n"