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

Re: [Condor-users] DAG POST script classad introspection



On Thu, 25 Feb 2010, Ian Stokes-Rees wrote:

Is there an environment variable or a condor variable (that can go in a
DAG) that would allow my post script to get a snapshot of the job classad?

I am submitting a DAG using the templating mechanism, and in situations
where the DAG node POST script identifies a problem, it would be nice if
it could grab a snapshot of the job classad at that point, which has
been constructed from a parameterized classad template and a VARS entry
for the node in the DAG definition file.

Ideally my POST script would be able to do something like:

condor_q -l $DAG_NODE_JOB_ID >
${DAG_NODE_NAME}.${DAG_NODE_JOB_ID}.snapshot.ca

Here's what to do:

  Job foo foo.sub
  Script Post foo foo.post $JOB $JOBID

($JOB is the DAG node name, and $JOBID is the Condor ID for the job.)

in foo.post:

  (get jobname and jobid from command-line arguments)
  condor_history -l $jobid > $jobname.$jobid.snapshot.ca

(Of course, the exact syntax depends on what language your post script is written in, but hopefully this gives enough of an example to work things out.)

Kent Wenger
Condor Team