[torqueusers] specify job id : Additional solutions which avoid changing jodib

Coyle, James J [ITACD] jjc at iastate.edu
Thu Jan 26 11:59:05 MST 2012


Hakeem,

   We have two user who do this.

  One captures the job id in the manner that I describe earlier, and keep that in a file on
their webserver to used later.  This technique does not require the webserver
to hold onto the ssh connection, and survives a submittal node restart.

  The second (easier) technique submits a job through qsub, and waits for the result.
They do this using qsub -I -x
(This is available in the 2.5.4 that we run, and likely anything newer.)

You can test it on the head node with my example below.

E.g.

If you make a file names tjob which contains the line

date;sleep 10;date;hostname

and make it executable with chmod u+x tjob

Then you can submit this and wait for the result using
qsub -I -x  tjob


Log:

$ date; qsub -I -x tjob; date
Thu Jan 26 12:52:39 CST 2012
qsub: waiting for job 154029.hpc5 to start
qsub: job 154029.hpc5 ready

Thu Jan 26 12:52:41 CST 2012
Thu Jan 26 12:52:51 CST 2012
node178

qsub: job 154029.hpc5 completed
Thu Jan 26 12:52:49 CST 2012

James Coyle, PhD
High Performance Computing Group
 Iowa State Univ.
web: http://jjc.public.iastate.edu/<http://www.public.iastate.edu/~jjc>


From: torqueusers-bounces at supercluster.org [mailto:torqueusers-bounces at supercluster.org] On Behalf Of Hakeem Almabrazi
Sent: Wednesday, January 25, 2012 4:19 PM
To: Torque Users Mailing List
Subject: Re: [torqueusers] specify job id

Thank you everyone for helping me with this.

The only reason why I want to do that is to be able to track that job specifically.  I am building a service to submit jobs to Torque.  The same service will have to wait till the job is done and return the results back to the call.  So the service need to know when the job is completed to load back the results.  I thought, the best way is for that service to keep asking the Torque on the status of the submitted job rather than looking up file(s) in the file system.

So the service has to assign a number to the job and then force Torque to use that number.  Now if the service wants to know the status of that job, it can asks the Torque server using the same job number.  It might be over kill way of doing things but that is the requirement.   Now there might be a better way of doing that.  I would love to hear it if someone else has better approach than this.

Thanks

.



From: torqueusers-bounces at supercluster.org [mailto:torqueusers-bounces at supercluster.org] On Behalf Of Coyle, James J [ITACD]
Sent: Tuesday, January 24, 2012 1:37 PM
To: Torque Users Mailing List
Subject: Re: [torqueusers] specify job id

Hakeem,

Is there a reason you want the jobid to be something specific?
The only thing that I can think of is to use this after the fact to pick up the
output filenames when you have not used -e and -o
(or to keep track of it for issuing later Torque commands like
qdel or qstat. )

This can be done for a jobscript myjob (in sh , ksh  or bash) via:

qsub myjob
QSUB_RC=$?
JID=`echo ${QSUB_RC} | sed -e 's/\.*$//' `


Then  ${JID}  can be used later.

E.g.
if you had not use -e and -o to name STDERR and STDOUT filenames, these output should be in

myjob.e${JID}
and
myjob.o${JID}


-          Jim


James Coyle, PhD
High Performance Computing Group
 Iowa State Univ.
web: http://jjc.public.iastate.edu/<http://www.public.iastate.edu/~jjc>

From: torqueusers-bounces at supercluster.org [mailto:torqueusers-bounces at supercluster.org] On Behalf Of Hakeem Almabrazi
Sent: Tuesday, January 24, 2012 10:08 AM
To: torqueusers at supercluster.org
Subject: [torqueusers] specify job id

Hi,

Is there a way to specify job id when request a job?

Thanks





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.supercluster.org/pipermail/torqueusers/attachments/20120126/22b70456/attachment-0001.html 


More information about the torqueusers mailing list