2

I'm using PBS Torque to run multiple jobs. The idea is simple, each job works on a shunk of data. The PBS_Torque job_script to launch a job is called run_appli.sh

Here is the simple code (code 1) to launch 10 jobs

for i in 1 2 3 4 5 6 7 9 10 do; qsub run_appli.sh ; done 

Indeed, I can monitor the execution of each of those jobs using qstat (see the command below) and have elapsed time of each job.

watch -n1 -d `qstat`

However, I am interested by the overall elapsed time. That means the time starting from when I launched all the jobs (code 1) and when the last job finished its execution.

Does anyone have an idea on how to do this ?

Fopa Léon Constantin
  • 11,863
  • 8
  • 48
  • 82

1 Answers1

2

If you know the job id of the first job, you can look at it's ctime (creation time, or the time it is queued). You can then check the end time for the last job's comp_time. The difference between the two would be the total time elapsed.

qstat -f $first_job_id | grep ctime # Shows the first job's queued time
qstat -f $last_job_id | grep comp_time # Shows the final job's completion time.

If the last job's isn't completed, then the running elapsed time would just be the current time - the first job's queue time.

dbeer
  • 6,963
  • 3
  • 31
  • 47