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

Re: [HTCondor-users] individual entries in condor_history file created from inside job



On 8/17/2018 2:06 AM, Beyer, Christoph wrote:
Hi,

I hope the subkect is not to misleading in this case.

What I am looking for is a way to pipe some individual return values of the job into the history file/classadd.

For ex if I run a script that has three possible individual exit states (state1 state2 state3) I would like to put the returnstates into the job classadd, hence the condor_history which would enable me later to have a quick look on how my jobs turned out with condor_history.

Is there a simple way to achieve that by the usual condor-mechanisms ?

Best
Christoph


Hi Christoph,

A couple of thoughts -

Idea #1:

The exit code number of the job is recorded in the job classad attribute ExitCode which is written to the history file. So for example, your script could call "exit 1" for state 1, "exit 2" for state 2, etc. If you job id was "50.5", once the job completes you could see the exit code on the submit machine with command:
   condor_history -limit 1 50.5 -af ExitCode


Idea #2:

Your job, as it runs, can insert arbitrary custom attributes into the job classad via condor_chirp. For example, to insert a custom attribute "MyJobHealth" with a string value of "Sick" into the job classad, your running job could invoke:
   condor_chirp set_job_attr_delayed 'MyJobHealth' '"Sick"'
The condor_chirp tool can also be used to append arbitrary messages to the job's event log (if you specified a log in the submit file). See the man page for condor_chirp, or onthe web at
  http://htcondor.org/manual/latest/Condorchirp.html
BTW, if your job happens to be Python, an alternative to invoking the condor_chirp command-line tool from your job would be to use the pure-python package "htchirp" ... see
   https://github.com/htcondor/htchirp


Hope the above helps, and looking forward to seeing you a couple weeks!

regards,
Todd