slurmsacct

Is it possible to I use `sacct --name` by providing only the beginning of the job's name?


From the sacct man page:

 --name:
               Display jobs that have any of these name(s).
         Use this comma separated list of uids or user names

When I provide full job's name following command works sacct --name [job_name]

$ sacct --name QmRsaBEGcqxQcJbBxCi1LN9iz5bDAGDWR6Hx7ZvWqgqmdR*1*0*-1.sh
       JobID    JobName  Partition    Account  AllocCPUS      State ExitCode
------------ ---------- ---------- ---------- ---------- ---------- --------
43           QmRsaBEGc+      debug      alper          2    TIMEOUT      1:0
43.batch          batch                 alper          2  CANCELLED     0:15

For example, now I want to retrive it by providing the begining of the name such as Qm*. But I obtain an empty string. It sees * as a character.

sacct --name Qm*
       JobID    JobName  Partition    Account  AllocCPUS      State ExitCode
------------ ---------- ---------- ---------- ---------- ---------- --------

[Q] Is it possible to I use sacct --name by providing only the beginning of the job's name? If yes, how?


Solution

  • --name option does not support wildcard patterns. One way to achieve the result you are looking for is to use grep command :

    # list all the jobs from January 2018 and filter it leaving those that contain Qm:
    sacct --format=jobid,jobname,ntasks,elapsed,state -S 010118 -u username |grep Qm