[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Condor-users] checking jobs
- Date: Mon, 9 Jul 2007 16:13:38 -0400
- From: "Ian Chesal" <ICHESAL@xxxxxxxxxx>
- Subject: Re: [Condor-users] checking jobs
> I know that you can check condor by using condor_status condor_q and
> other calls. I was wondering though is there a way to call condor to
> if the jobs are done by calling a function or something of the nature
> and having condor return a yes or no or some type of return value. I
> trying to use another program to be able to tell when condor has
> a job so if condor can return a specific value it would be very
There are a couple of things you can try. You can take a look at the
condor_wait command. This command blocks until all jobs in a cluster
have completed. Useful if you're scripting a post-cluster task.
If you're using Perl you can check out the Condor.pm module in
condor-6.8.x/lib/ directory. This module lets you register a callback
subroutine in your Perl script that gets called every time a job is
done. It accomplishes this goal by watching the job log file. If you
want to watch and react to the job log file in a language other than
Perl this is a good place to start learning about how to interpret all
the log messages you see in that file.
Finally you can combine the leave_in_queue=true submit setting
with liberal use of the condor_q command and it's -format option to
identify jobs in a cluster that are finished and act on them. To see a
list of jobs that have finished you use the JobStatus attribute
condor_q -format "%d." ClusterId -f "%d " ProcId -const 'JobStatus == 4'
If you set leave_in_queue=true a completed job stays in the queue but
shows up with a status value of 4. So you can call condor_q with the
above options periodically from your watch program to get a list of jobs
that are done and when you do your post-job processing you simply call
condor_rm on the job to actually remove it from the queue so the next
time you generate the list it doesn't show up.
Hope that helps get you started.