[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [HTCondor-users] Question about the conditionals in configuration
Thanks for your reply!
Unfortunately, strcmp() can not solve my problem. I tried it, the strcmp() returns an interger(>0,=0,<0), but the condor conditional can only recognize interger 0 or 1. Then I tried to transform strcmp() result to 0 or 1, but failed, the conditional does not support a complex _expression_.
We're doing a conditional configuration on Startd side. We have two types of resources, defining them as "physical machine" and "virtual machine":
resource_type = "virtual machine" or resource_type = "physical machine"
If the resource_type is "virtual machine", there will be some sepecial attributes added.
Following your hints, I found a function "ifThenElse" to solve this:
START = ifThenElse( resource_type == "virtual machine", ($(START) && TARGET.POOL=="virtual"), $(START))
ifThenElse( resource_type == "virtual machine", 0, 3000)
But ifThenElse is part of _expression_ which would be evaluated everytime when START attribute is used.
If the grammar could be like the following would be better:
if resource_type is "virtual machine"
START = $(START) && TARGET.POOL=="virtual"
RESERVED_MEMORY = 0
RESERVED_MEMORY = 6000
Looking forward some hints or solutions!
(Thank you very much, Christoph!)
Date: 2020-05-07 15:10
Subject: Re: [HTCondor-users] Question about the conditionals in configuration
you can do string comparison, check the classadd language here:
strcmp() is probably what you are looking for.
When it comes to slot definitions though you will need to restart condor to make it happen, hence if you want to reorganise your slots depending on the owner of the job it's not gonna be very straight forward (but that is just a wild guess of course)
Building 02b, Room 009
An: "htcondor-users" <htcondor-users@xxxxxxxxxxx>
Gesendet: Donnerstag, 7. Mai 2020 08:56:22
Betreff: [HTCondor-users] Question about the conditionals in configuration
Does the conditional in configuration support string comparison?
As the htcondor manual, it seems only support bool or simple number.
Can we do this conditional in HTCondor configuration?
group = "cms"
if group == "cms"
num_slots = 4
Thanks in advance!
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
You can also unsubscribe by visiting
The archives can be found at: