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

Re: [HTCondor-users] transform syntax to build complex ads possible?



Hi Greg & TJ,

many thanks for your suggestions!

Unfortunately, it looks like, that the context available for the Negotiator/GROUP_SORT_EXPR is too constraint for re-writing it more modular-ly.

E.g., in variations of [1] we tried to brake up the nested ifthenelse()'s and merge them into the final string for GROUP_SORT_EXPR (unsure about the elvis chain). But the Negotiator falls back for all to the default 3.4e+38. Probably the "intermediate" is{GROUP} ads are not available in the limited group sort context, or?

Cheers,
  Thomas


[1]
isOps = [ifThenElse(AccountingGroup=?="group_OPS" || regexp("group_OPS",AccountingGroup), 0.01, undefined)] isOther = [ifThenElse(AccountingGroup=?="group_OTHER" || regexp("group_OTHER",AccountingGroup), GroupResourcesInUse/GroupQuota + 4.0,undefined] isOtherMcore = [ifThenElse(AccountingGroup=?="group_OTHER.mcore" || regexp("group_OTHER.mcore",AccountingGroup), GroupResourcesInUse/GroupQuota + 4.0 * 0.8,undefined] isOtherScore = [ifThenElse(AccountingGroup=?="group_OTHER.score" || regexp("group_OTHER.score",AccountingGroup), GroupResourcesInUse/GroupQuota + 4.0 * 0.2,undefined]
isNoneEnd = [ifThenElse(AccountingGroup=?="<none>",3.4e+38, 3.4e+38)]

{eval_set_}GROUP_SORT_EXPR = strcat([isOps :? isBelle :? isOther :? isNoneEnd])



On 07/10/2021 20.32, Greg Thain wrote:

AFAIS it is no macro/function/... where I can return a value, or?

Background is, that I would like to refactor a `GROUP_SORT_EXPR`, that
has grown over time into a forest of IfThenElse()'s.


Depending on what you need your GROUP_SORT_EXPR to do, a classad UserMap (https://htcondor.readthedocs.io/en/latest/misc-concepts/classad-mechanism.html) may be a cleaner way to express the logic.


-greg




_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/


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