1

I am using the job scheduler SLURM.

It is possible to get information about CPU usage by Jobs/Steps/Tasks but how to have access to the number of cores a user is currently using ?

The list of jobs of a specific user user_name can be obtained with: squeue | grep user_name and the number of jobs currently running with: squeue | grep user_name | wc -l.

DarkBee
  • 16,592
  • 6
  • 46
  • 58

1 Answers1

0

You can filter the output of squeue with --user=... and set squeue to only display the number of CPUs with -o%C.

$ squeue -hu user_name -o "%C" 
24
24
1
1
1
1

From there, use your preferred method for summing those numbers, for instance

$ squeue -hu user_name -o "%C" | paste -d + -s | bc
52
damienfrancois
  • 52,978
  • 9
  • 96
  • 110