Skip to content

Commit

Permalink
Only count jobs in queue or running
Browse files Browse the repository at this point in the history
Improve grepping for number of jobs (running/queued) in queues
  • Loading branch information
Arne de Laat committed Apr 15, 2014
1 parent 31565a4 commit d78912b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sapphire/corsika/qsub_corsika
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,12 @@ def check_queue(queue):
:return: boolean, True if slots are available, False otherwise.
"""
all_jobs = int(subprocess.check_output('qstat | grep {queue} | grep [QR] |'
' wc -l' .format(queue=queue),
shell=True))
user_jobs = int(subprocess.check_output('qstat -u $USER | grep {queue}'
' | wc -l'.format(queue=queue),
shell=True))
all_jobs = int(subprocess.check_output('qstat | grep {queue} | '
'grep " [QR] " | wc -l'
.format(queue=queue), shell=True))
user_jobs = int(subprocess.check_output('qstat -u $USER | grep {queue} | '
'grep " [QR] " | wc -l'
.format(queue=queue), shell=True))

if queue == 'express':
return 2 - user_jobs
Expand Down

0 comments on commit d78912b

Please sign in to comment.