[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] [newbie question: launch a specific job depending on the exit value of the previous]



On Wed, 7 May 2008, Jean-Pierre Ocalan wrote:

I would like to create kind of system compose of 3 jobs.
First jobs have two possibles exit values, 0 and 1. Based on those exit values I would like to launch one of the other two jobs.
Is it possible to do that, and how can I do it ?

One way to approach it would be to make a V-shaped DAG, and run it with condor_dagman (http://www.cs.wisc.edu/condor/manual/v7.0/2_10DAGMan_Applications.html).

Now, in a DAG, children don't get run if their parents don't have an exit
code of 0.  So you'd have to have a POST script for each parent job that
recorded the "real" job's exit status, and always returned 0. Then, the PRE script for the child job could look at the parents' status, and edit or rename the corresponding Condor submit file to run the job you want.

(One other note on this:  if you do something like renaming the submit
file for the child job, all versions of it must have the same log file specified, and one version must exist at the time the DAG is started, so DAGMan can find the right log file.)

Kent Wenger
Condor Team