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

[HTCondor-users] Unable to get _HOOK_PREPARE_JOB to add something to job ClassAd



Hi all

I wanted to record some information about the execute nodes to the job's
ClassAd and thought I could utilize a prepare job hook for that.

Set-up was straight forward:

(1) add this to execute node's config

MYHIST_HOOK_PREPARE_JOB = /usr/share/condor/myhist_prepare_hook

(2) create myhist_prepare_hook:
#!/bin/sh

MYHIST="MyHist"

# Read and parse job ClassAd
JOB_NUM=$( /bin/grep -c "$MYHIST" < /dev/stdin )

/usr/bin/printf "$MYHIST%03d = \"%s:::%s\"\n" $(( JOB_NUM+1 )) "Intel(R)
Xeon(R) CPU E3-1220 v3 @ 3.10GHz" 0.8

exit 0

(3) Calling it manually on the execute node works as expected:

/usr/share/condor/ligo_acocunting_prepare_hook < /dev/null
MyHist001 = "Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz:::0.8"

or

echo "MyHist003" | /usr/share/condor/ligo_acocunting_prepare_hook

MyHist002 = "Intel(R) Xeon(R) CPU E3-1220 v3 @ 3.10GHz:::0.8"

(4) By adding something like

echo "hook ran $(date)" >> /tmp/hook.log

to the script I was able to verify that the hook was called by my job
(featuring +HookKeyword = "MYHIST"), but the output key/value never made
it into the job's ClassAd (neither while it was running nor after it was
done - checked with condor_q and condor_history).

Any idea where I left the trail of working configs?

Cheers

Carsten

-- 
Dr. Carsten Aulbert, Max Planck Institute for Gravitational Physics,
CallinstraÃe 38, 30167 Hannover, Germany
Phone: +49 511 762 17185