I’m working with a computation cluster that uses PBS/Torque for job scheduling. The queue can be pretty long at times, for example, I now have a few jobs submitted in a queue of over 800 (as reported by showq which shows a full list of jobs, but as far as I am aware these aren’t necessarily in the order of execution).
I would like to find out where in the queue my jobs are located; how many will be processed before mine? I would like to get some output like: Job <id>: 417/862. This way I would have at least some indication of progress and waiting time. However, I have not been able to find out how to do this. Can it be done, and how?
I wasn’t sure if I could count on it that queued jobs would be executed in the order presented by
showq, but after some more research, it certainly looks like it.The queue printed by
showqhas the following format:Based on this format, I came up with the following bash script to find a job’s place in the idle section of the queue, given the job’s id:
Example output: