[torqueusers] Runnig a script after job completion

Martins, Flavio flavio.martins at fttinc.com
Fri Oct 12 10:17:02 MDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

I have done similar things in the past by the following method:

I issue the qsub command in a script. The script then waits for job
completion through a loop that checks qstat for the "C" state (or while
your jobid is still present in the queue). When the job is done, the
main script continues with whatever tests and set-up you need. You could
set all this inside a loop that repeats until your job is converged.
Here is the concept:

# start a loop until convergence
Converged=no
While(converged = no)

   # launch the case and get the job id
   Jobid = qsub my_job
   
   # wait for job to complete
   While(qstat = jobid)
      Sleep 60
   End

   # check for convergence
   Converged = Check_for_convergence()

   # set up next case if not converged
   If(converged = no)
      Set_up_next_run()
   End

End

I hope this helps. Let me know if you need more details in the scripting
part. I kept is generic since I don't know what language you are
scripting in.

Flavio Martins
Senior Engineer
Aerodynamics / CFD
Florida Turbine Technologies Inc.
100 Marquette Road
Suite 110
Jupiter, FL 33458-7101
Phone: (561) 427-6261
Fax: (561) 427-6191
- -----Original Message-----
From: torqueusers-bounces at supercluster.org
[mailto:torqueusers-bounces at supercluster.org] On Behalf Of Chaitanya
Krishna
Sent: Thursday, October 11, 2007 3:45 PM
To: torqueusers at supercluster.org
Subject: [torqueusers] Runnig a script after job completion

Hello all,

I have been searching for a simple solution to my problem but havent
been ablt to find any till now.

I tried the archives too. May be my search terms weren't good enough!!

I want to run a shell script after a job that I submit using qsub is
over. Is this possible? If so how?

To elaborate on the question. I submit a job using qsub, then I need
to check the output to see if the calculation has converged. If it
hasn't converged I need to copy the outputfiles that I have at present
and then continue the job using another qsub command. Is this
possible?

In a nut shell whenever the job submitted using qsub is finished in
should trigger a shell script.

Thanks in advance,
Chaitanya.
TU Delft
_______________________________________________
torqueusers mailing list
torqueusers at supercluster.org
http://www.supercluster.org/mailman/listinfo/torqueusers

-----BEGIN PGP SIGNATURE-----
Version: PGP Universal 2.6.1
Charset: us-ascii

wsBVAwUBRw+dqjxaeRbmFE+LAQj4wQf+O/5cIVUI9EEp5iemLpGaOfN+5HpOzwGR
u4vIEz+6tzQjXvVYUbYLV7FsJaDd5Tnt0+w6X8B5K8M0BNi/gNWk71bLH9zXZhcz
YGPTGPlQ6Vo9XQre5NWijoT0FQ8hRGW589usfKFZmUDT0c7H84ym/BG6eWZoQiPH
dBZJgLDaJc7nHuopAYHwgTfbyyBJyvXT79Bnt8l1vIaVBa3wAbZcECTsTWsRN1Pk
+QeyK0Nak/HvDKRFu0lvC47KtUTcDspOMdPR8HNv8KrzDggDTKns68zECahJthC4
DWxLRyUW9JitTerfZ60zf/DFikVBHaeKKRKvpsY5rqH3sMM9qhkzrg==
=Gv6y
-----END PGP SIGNATURE-----


More information about the torqueusers mailing list