Discussion:
[gridengine users] Count slots for a specific User
Rémy Dernat
2013-06-27 12:22:23 UTC
Permalink
Hi,

I would like to count the number of slots used for a specific user.

I am doing something like this:

nb_slots=`qstat -s r|grep -w $USER |awk 'BEGIN { ORS="+" } {print
$9}'`;echo "$nb_slots 0"|bc

However, I don't think it is working for jobs with many threads.

Is there any possibility to check that in an easy way ?

Thanks,

Regards,
Remy
MacMullan, Hugh
2013-06-27 12:59:53 UTC
Permalink
Hi Rémy:

Hmm, not sure why that wouldn’t work. What do you mean by ‘many threads’? It works for me with a mix of single and a few mpi jobs. Only suggestion I would make would be to do the column sum in awk:

qstat -s r | grep -w $USER | awk '{ttl+=$9} END {print ttl}'

There’s probably a better way though I bet. ☺

-Hugh


From: users-***@gridengine.org [mailto:users-***@gridengine.org] On Behalf Of Rémy Dernat
Sent: Thursday, June 27, 2013 8:22 AM
To: ***@gridengine.org
Subject: [gridengine users] Count slots for a specific User

Hi,

I would like to count the number of slots used for a specific user.

I am doing something like this:

nb_slots=`qstat -s r|grep -w $USER |awk 'BEGIN { ORS="+" } {print $9}'`;echo "$nb_slots 0"|bc

However, I don't think it is working for jobs with many threads.

Is there any possibility to check that in an easy way ?

Thanks,

Regards,
Remy
William Hay
2013-06-27 13:12:02 UTC
Permalink
Post by Rémy Dernat
Hi,
I would like to count the number of slots used for a specific user.
nb_slots=`qstat -s r|grep -w $USER |awk 'BEGIN { ORS="+" } {print
$9}'`;echo "$nb_slots 0"|bc
However, I don't think it is working for jobs with many threads.
Is there any possibility to check that in an easy way ?
I can't get the above to work even for a bunch of simple single slot
single threaded jobs.
If I were trying something similar I would use:
echo $(qstat -s r -u ccaawih |tail -n +3| awk '{print $9}')|tr ' ' '+'|bc

With ccaawih being the name of the user.

We have a little script on our cluster that lists out slots per user but it
relies on the fact that we have job_is_first_task true for all PEs:
#!/bin/bash
qstat -u "*" -s r | tail -n +3|awk '{FOO=0;while ( FOO<$9){FOO =
FOO+1;print $4 }}'|sort|uniq -c|sort -n


William
Post by Rémy Dernat
Thanks,
Regards,
Remy
Rémy Dernat
2013-06-27 13:53:19 UTC
Permalink
That is seems very interesting.

To answer Hugh, I thought that it should be a problem with a single job
Reuti
2013-07-11 16:28:10 UTC
Permalink
Hi,
Post by Rémy Dernat
That is seems very interesting.
To answer Hugh, I thought that it should be a problem with a single job that have multiple threads (multithreading).
Loading...