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

[HTCondor-users] select multiple elements from lists, eval order in job transforms

Dear condor wizards, sorcerers, conjurers and initiates,

for accounting purposes we let our users put something like

accounting_group = a.b.c.d

into their submit files and let condor_submit/schedd complain via submit
requirements if it does not conform to something expected.

Now, we want to modify the given value to only retain the leading two
bits and but it into the AccountingGroup job ad along with the user. For
a single piece of the value this can be easily done via

  Eval_set_AccountingGroup = join(".", split(toLower(AcctGroup),
".")[1], AcctGroupUser);
  Eval_set_AcctGroup = toLower(AcctGroup);

however, I have no idea how to select say the first and second or the
first and third from the result of "split" - is there a direct way?

As a workaround I started creating a number of intermediate results:
Eval_set_AccountingLead = split(toLower(AcctGroup), ".")[0];
Eval_set_AccountingPrio = split(toLower(AcctGroup), ".")[1];
Eval_set_AccountingGroup = join(".", AccountingLead, AccountingPrio,
Eval_set_AcctGroup = toLower(AcctGroup);

however, condor does re-order the eval_sets by alphabet (as can be seen
in the SchedLog:

06/09/20 13:41:39 (pid:3239) JOB_TRANSFORM_TagJob setup as transform
rule #1 :
EVALSET AccountingGroup
EVALSET AccountingLead split(toLower(AcctGroup),".")[0]
EVALSET AccountingPrio split(toLower(AcctGroup),".")[1]
EVALSET AcctGroup toLower(AcctGroup)

And, quite correctly: AccountingGroup = undefined

Changing the job transform slightly:

Eval_set_AccountingALead = split(toLower(AcctGroup), ".")[0];
Eval_set_AccountingAPrio = split(toLower(AcctGroup), ".")[1];
Eval_set_AccountingGroup = join(".", AccountingALead, AccountingAPrio,
Eval_set_AcctGroup = toLower(AcctGroup);

yiekds the wanted result:

AcctGroup = "admin.test.parallel1"

is transformed into

AccountingGroup = "admin.test.carsten"

Now, my two questions:

(1) Is there a way to get multiple elements from a list?

(2) Why is the ordering of job transforms so broken^Wsurprising for the


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

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature