How to insert custom ClassAd attributes into a job

Known to work with HTCondor version: 7.0

In the following examples, an attribute named Group is added with the value "Physics". You can use whatever attribute name you want, but avoid attribute names that conflict with attributes used by HTCondor. See the manual or run

condor_q -long
on a job to see what attributes are there.

How to insert custom ClassAd attributes into a job via the submit file:

+Group = "Physics"

How to insert custom ClassAd attributes into a job via the configuration file:

Group = "Physics"
SUBMIT_EXPRS = $(SUBMIT_EXPRS) Group

How to insert custom ClassAd attributes into a job via the environment:

Insert desired value into the user's environment (e.g. in a shell setup script or whatever). Example:

export _CONDOR_GROUP='"Physics"'

Then add it in the HTCondor configuration file:

SUBMIT_EXPRS = $(SUBMIT_EXPRS) Group

How to insert {quote: ClassAd} attributes into a job from the machine ad:

Suppose the name of the attribute in the machine ad is X. Then put the following in the HTCondor configuration (on the submit node).

MachineX = "$$([X])"
SUBMIT_EXPRS = $(SUBMIT_EXPRS) MachineX

Actually, X can be any ClassAd expression. It is not just limited to an attribute name. The value that is inserted into the job ClassAd, however, is always stored as a string.

In the job history file, the attribute of the most recent machine on which the job ran will be stored with the name

MATCH_EXP_MachineX