cluster computing - how to get the job id from qsub -


i using cluster. use qsub command distribute job, want can job id can monitor job.

basically, want thing this:

#!/bin/bash jobid=$( qsub job1 ) # monitoring base on $jobid 

i found page http://wiki.ibest.uidaho.edu/index.php/tutorial:_submitting_a_job_using_qsub, , talks variable pbs_jobid don't know how use it. know how it?

(my solution jobid='qsub task | cut -d ' ' -f 3')

qsub has predictable output. many automated submission systems (such grid interfaces) parse output qsub, looking jobid.

an example of parsing available blahp project (european grid middleware).

jobid=`${pbs_binpath}/qsub $bls_tmp_file` # actual submission ...  # job id first numbers in string (slurm support) jobid=`echo $jobid | awk 'match($0,/[0-9]+/){print substr($0, rstart, rlength)}'` 

(source)

this code has been used in production many years, , has worked qsub in both pbs, pbs pro, , slurm.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -