[GE users] job dependency question

Ron Chen ron_chen_123 at yahoo.com
Wed Oct 8 13:14:54 BST 2008


--- On Wed, 10/8/08, Daniel Templeton <Dan.Templeton at Sun.COM> wrote:
> Take a look at the qsub man page, and I think it will be
> clearer.  The 
> option is "-hold_jid".  You don't substitute
> in the JID.  What follows 
> the switch is either the job name or JID.  In this case
> it's the job name, so you don't need to worry about the JID.

Be careful when one is using job name instead of job ID. Job name is not unique (you can submit as many jobs called "pre" as you want!), only job ID is!

 -Ron



> 
> For example:
> 
>  > qsub -N pre commandA.sh
> Your job 340 ("pre") has been submitted
>  > qsub -hold_jid pre commandB.sh
> Your job 341 ("commandB.sh") has been submitted
> 
> 
> Daniel
> 
> Mag Gam wrote:
> > Actually,
> >
> > how would I get that JID? Since JIDs will be changing.
> >
> >
> >
> > On Tue, Oct 7, 2008 at 10:50 PM, Mag Gam
> <magawake at gmail.com> wrote:
> >   
> >> Great Thankyou All.
> >>
> >> I will test it in my Lab tomorrow.
> >>
> >> Thanks everyone again!
> >>
> >> TIA
> >>
> >>
> >> On Tue, Oct 7, 2008 at 10:44 PM, Daniel Templeton
> <Dan.Templeton at sun.com> wrote:
> >>     
> >>> Close.  The second command would be "qsub
> -hold_jid pre commandB.sh".
> >>>
> >>> Daniel
> >>>
> >>> Mag Gam wrote:
> >>>       
> >>>> As usualy, thanks Rayson.
> >>>>
> >>>> So, I have these 2 commands.
> >>>>
> >>>> I suppose I can do:
> >>>>
> >>>> qsub -N pre commandA.sh
> >>>> qsub -hold_pre commandB.sh
> >>>>
> >>>>
> >>>>  commandA.sh
> >>>>  #!/bin/bash
> >>>>  #$ -o output
> >>>> #$ -S /bin/bash
> >>>> #$ -S -V
> >>>> tar -cvf file.tar /large_directory
> >>>>
> >>>> CommandB.sh
> >>>> #!/bin/bash
> >>>>  #$ -o output
> >>>>  #$ -S /bin/bash
> >>>> #$ -S -V
> >>>> gzip file.tar
> >>>>
> >>>> Does this sound right?
> >>>>
> >>>> TIA
> >>>>
> >>>>
> >>>> On Tue, Oct 7, 2008 at 10:38 PM, Rayson Ho
> <rayrayson at gmail.com> wrote:
> >>>>
> >>>>         
> >>>>> Basically, you submit the first job,
> and qsub will return its job id.
> >>>>> You then pass first job's job id
> to -hold_jid when you submit the 2nd
> >>>>> job.
> >>>>>
> >>>>> A more advanced way is to use job
> names, by using -N.
> >>>>>
> >>>>> Anyway, play with a few dummy jobs and
> you will get the concept.
> >>>>>
> >>>>> Rayson
> >>>>>
> >>>>>
> >>>>>
> >>>>> On 10/7/08, Mag Gam
> <magawake at gmail.com> wrote:
> >>>>>
> >>>>>           
> >>>>>> Thanks for the quick reponse.
> >>>>>>
> >>>>>> I believe I have tried this too,
> but I am still confused with the job
> >>>>>> name and job id.
> >>>>>>
> >>>>>> I looked at
> >>>>>>
> https://lists.sdsc.edu/pipermail/npaci-rocks-discussion/2007-June/025538.html,
> >>>>>>  and
> >>>>>>
> http://gridengine.sunsource.net/servlets/ReadMsg?list=users&msgNo=447
> >>>>>>
> >>>>>> Do I need another script to check
> for jobs? Sorry for such a newbie
> >>>>>> question
> >>>>>>
> >>>>>>
> >>>>>> TIA
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> On Tue, Oct 7, 2008 at 10:25 PM,
> Rayson Ho <rayrayson at gmail.com> wrote:
> >>>>>>
> >>>>>>             
> >>>>>>> The link in your email is for
> job arrays.
> >>>>>>>
> >>>>>>> You should read the qsub
> manpage instead, and look up the "hold_jid"
> >>>>>>> option. If you google
> "qsub" and "hold_jid", the results
> should at
> >>>>>>> least include a few examples.
> >>>>>>>
> >>>>>>> Rayson
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>> On 10/7/08, Mag Gam
> <magawake at gmail.com> wrote:
> >>>>>>>
> >>>>>>>               
> >>>>>>>> I have been reading many
> SGE job dependency pages online (such as
> >>>>>>>>
> http://open.rsp.com.au/?page_id=11) but I am still not able
> to do the
> >>>>>>>> task I wanted to do. Or
> perhaps I may be looking at the wrong thing.
> >>>>>>>> Here is what I am looking
> for:
> >>>>>>>>
> >>>>>>>> I have 2 commands. Command
> A and Command B. Command A needs to run
> >>>>>>>> first and then execute
> Command B once Command A is completed. In other
> >>>>>>>> words Command B depends on
> Command A.
> >>>>>>>>
> >>>>>>>> commandA.sh
> >>>>>>>>
> >>>>>>>> #!/bin/bash
> >>>>>>>> #$ -o output
> >>>>>>>> #$ -S /bin/bash
> >>>>>>>> #$ -S -V
> >>>>>>>> tar -cvf file.tar
> /large_directory
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> CommandB.sh
> >>>>>>>> #!/bin/bash
> >>>>>>>> #$ -o output
> >>>>>>>> #$ -S /bin/bash
> >>>>>>>> #$ -S -V
> >>>>>>>> gzip file.tar
> >>>>>>>>
> >>>>>>>>
> >>>>>>>> Basically, I want to
> submit both of the jobs to our GRID but with
> >>>>>>>> commandB running after
> CommandA
> >>>>>>>>
> >>>>>>>> TIA
> >>>>>>>>
> >>>>>>>>
> ---------------------------------------------------------------------
> >>>>>>>> To unsubscribe, e-mail:
> users-unsubscribe at gridengine.sunsource.net
> >>>>>>>> For additional commands,
> e-mail: users-help at gridengine.sunsource.net
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>                 
> >>>>>>>
> ---------------------------------------------------------------------
> >>>>>>> To unsubscribe, e-mail:
> users-unsubscribe at gridengine.sunsource.net
> >>>>>>> For additional commands,
> e-mail: users-help at gridengine.sunsource.net
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>               
> >>>>>>
> ---------------------------------------------------------------------
> >>>>>> To unsubscribe, e-mail:
> users-unsubscribe at gridengine.sunsource.net
> >>>>>> For additional commands, e-mail:
> users-help at gridengine.sunsource.net
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>             
> >>>>>
> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail:
> users-unsubscribe at gridengine.sunsource.net
> >>>>> For additional commands, e-mail:
> users-help at gridengine.sunsource.net
> >>>>>
> >>>>>
> >>>>>
> >>>>>           
> >>>>
> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail:
> users-unsubscribe at gridengine.sunsource.net
> >>>> For additional commands, e-mail:
> users-help at gridengine.sunsource.net
> >>>>
> >>>>
> >>>>         
> >>>
> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail:
> users-unsubscribe at gridengine.sunsource.net
> >>> For additional commands, e-mail:
> users-help at gridengine.sunsource.net
> >>>
> >>>
> >>>       
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> users-unsubscribe at gridengine.sunsource.net
> > For additional commands, e-mail:
> users-help at gridengine.sunsource.net
> >
> >   
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe at gridengine.sunsource.net
> For additional commands, e-mail:
> users-help at gridengine.sunsource.net


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list