Hey Par, try this patch, it should also fix the issue with qos' of different 
case.  Also catches the issue where the env var is set.  This patch will be in 
2.2.4.

Danny

Index: src/squeue/print.c
===================================================================
--- src/squeue/print.c  (revision 22780)
+++ src/squeue/print.c  (working copy)
@@ -1355,7 +1355,7 @@
                iterator = list_iterator_create(params.account_list);
                while ((account = list_next(iterator))) {
                         if ((job->account != NULL) &&
-                            (strcmp(account, job->account) == 0)) {
+                            (strcasecmp(account, job->account) == 0)) {
                                filter = 0;
                                break;
                        }
@@ -1370,7 +1370,7 @@
                iterator = list_iterator_create(params.qos_list);
                while ((qos = list_next(iterator))) {
                         if ((job->qos != NULL) &&
-                            (strcmp(qos, job->qos) == 0)) {
+                            (strcasecmp(qos, job->qos) == 0)) {
                                filter = 0;
                                break;
                        }


> When new jobs are created slurmctld converts the specified account into
> lowercase. src/slurmctld/job_mgr.c:_job_create() calls
> xstrtolower(job_desc->account)
> 
> squeue does not do the same when the -A parameter is specified, which I
> think is confusing.
> 
> Submit a job:
>     [paran@kubb ~]$ sbatch -t 15 -A NsC shortjob.sh 
>     Submitted batch job 145658
> 
> Specifying the exact same account to squeue does not list this job:
>     [paran@kubb ~]$ squeue -A NsC
>       JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)
> 
> Unless I use lower case:
>     [paran@kubb ~]$ squeue -A nsc
>       JOBID PARTITION     NAME     USER  ST       TIME  NODES NODELIST(REASON)
>      145658     kappa shortjob    paran  PD       0:00      1 (Priority)
> 
> The following patch converts to lowercase in squeue as well. It is
> tested with 2.2.3 but seems to apply on 2.3.0.pre3 also.
> 
> Regards,
> Pär Andersson
> NSC
> 
> ---
>  src/squeue/opts.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/squeue/opts.c b/src/squeue/opts.c
> index cdd3d43..cd3890d 100644
> --- a/src/squeue/opts.c
> +++ b/src/squeue/opts.c
> @@ -148,10 +148,10 @@ parse_command_line( int argc, char* argv[] )
>               case (int) 'A':
>               case (int) 'U': /* backwards compatibility */
>                       xfree(params.accounts);
> -                     params.accounts = xstrdup(optarg);
> +                     params.accounts = xstrtolower(xstrdup(optarg));
>                       params.account_list =
>                               _build_str_list( params.accounts );
> -             break;
> +                     break;
>               case (int)'a':
>                       params.all_flag = true;
>                       break;
> -- 
> 


Reply via email to