Also worth noting is that -hold_jid "foobar*" will only hold on jobs from
the same user (at least that is how our 6.1u3 setup is behaving).

For example,
Job 1 => user1 does: qsub -b y -j y -N user1_job1 sleep 100
Job 2 => user2 does: qsub -b y -j y -N user2_job1 sleep 100
Job 3 => user1 does: qsub -b y -j y -N user1_job2 -hold_jid "user*" sleep
100

For Job 3, it will only hold on Job 1, and not on Job 1 and Job 2.

To get around this, we have a wrapper script that first gets the entire
contents of the queue (i.e., qstat -r -xml -pri -ext -u '\*'), and then we
do a search on the jobname to get the list of jobids that match our search
term, then we pass the Job ID's as the actual -hold_jid. (i.e., -hold_jid
1,2).


On Mon, Feb 23, 2015 at 5:28 AM, Reuti <[email protected]> wrote:

> Am 22.02.2015 um 23:14 schrieb Chris Dagdigian <[email protected]>:
> >
> >
> > Yes SGE can handle dependencies between jobs and even dependencies
> between tasks in a job array.
> >
> > The job dependency syntax depends on job naming in the most common use
> case, here is a simple example:
> >
> >  qsub -N DataStagerTask ./my-SGE-job.sh
> >
> >  qsub -hold_jid DataStagerTask ./my-analytic-job.sh
>
> Small addition (besides using a job id as argument): it's also possible to
> use a wild card in the  argument to -hold_jid, i.e. having jobs
> foobar_north, foobar_south, foobar_west and foobar_east running, one can
> wait for "foorbar*" and the jobs submitted before the waiting one will be
> taken into account (but not later submitted ones which start with "foobar").
>
> -- Reuti
>
>
> > The "-hold_jid <name>" argument is what makes the 2nd job dependent on
> the 1st job exiting before it will run
> >
> > -Chris
> >
> >
> >
> >> Peng Yu <mailto:[email protected]>
> >> February 22, 2015 at 3:26 PM
> >> Hi Ed,
> >>
> >> I am wondering if SGE allows users to specify dependencies between
> >> jobs. For example, I may need job1 be finished before job2 is started,
> >> even thought there might be enough resource to run job2 at a given
> >> time.
> >>
> >> Would you please let me if SGE do so? Thanks.
> >>
> > _______________________________________________
> > users mailing list
> > [email protected]
> > https://gridengine.org/mailman/listinfo/users
>
>
> _______________________________________________
> users mailing list
> [email protected]
> https://gridengine.org/mailman/listinfo/users
>
_______________________________________________
users mailing list
[email protected]
https://gridengine.org/mailman/listinfo/users

Reply via email to