MakisH
MakisH

Reputation: 1183

How to see the current user's queue in SLURM

On a cluster that is managed by SLURM, I want to check the queue of the current user (and cluster). Normally, I have to use this command:

squeue --user=username --clusters=clustername

The problem with this, apart from the fact that this is a rather long command to use frequently, is that it needs the username. I have created a script in which at some point I want to check the queue of the user, but I have to get the username first.

I have a workaround for all these, but it would be great if I could use a command like the respective one for LoadLeveller:

llu

Is there anything like that? Or can I somehow specify the "current user" in the --user flag?

Upvotes: 1

Views: 5142

Answers (3)

damienfrancois
damienfrancois

Reputation: 59260

Newer versions of slurm accept

squeue --me

as a shortcut.

Upvotes: 2

jyvet
jyvet

Reputation: 2201

You may use an alias in the /etc/bashrc file (or ~/.bashrc for some users):

alias llu="squeue --user=$USER --clusters=clustername"

EDIT

You could also use this alias which does not depend on an environment variable:

alias llu="squeue --user=`whoami` --clusters=clustername" 

or

alias llu="squeue --user=`logname` --clusters=clustername" 

Upvotes: 4

Carles Fenoy
Carles Fenoy

Reputation: 5377

You can simply use squeue -u $LOGNAME. If you want to query for the jobs on the current cluster it should be the default behavior without having to add the --clusters parameter, so this way the squeue command becomes simplier.

According to this answer https://unix.stackexchange.com/a/76369, $LOGNAME should always be defined in the environment, so this should be completely portable.

Upvotes: 3

Related Questions