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

Re: [HTCondor-users] ifThenElse woes



Its for the later. Thanks.Â

On Tue, Oct 17, 2023 at 4:13âPM Todd Tannenbaum <tannenba@xxxxxxxxxxx> wrote:
On 10/17/2023 9:28 AM, Rita wrote:
I have few(atleastÂ5)ÂHOLD statements. They all work. However, I am trying to put them in a hold reason but for whateverÂreason only of the reasons show up.

Is there a better way to handle this?Â

hold_reason = ifThenElse ( $(A), "held because of policy a",
             ifThenElse ( $(B), "held because of policy b",
             ifThenElse ( $(C), "held because of policy c","unknown")
             )
             )

This doesn't work. Was wondering if there is an easier or more intuitiveÂway to manage this
          ÂÂ

Hi Rita,

You don't say above if you are setting up a hold policy in your job submit file, or in your condor_config (to be applied to all jobs on the access point).ÂÂÂ I will assume the latter.

Yes, there is an easier way assuming you are running HTCondor version 9.5 or above, which is to use SYSTEM_PERIODIC_HOLD_NAMES and friends.ÂÂ See https://htcondor.readthedocs.io/en/latest/admin-manual/configuration-macros.html#SYSTEM_PERIODIC_HOLD_NAMES

This way, you can have separate hold reasons for each policy instead of globbing them all into one _expression_. Plus it is easier to add/remove policies without impacting others. Example from a condor_config file:

# Add a policy for memory
SYSTEM_PERIODIC_HOLD_NAMES = $(SYSTEM_PERIODIC_HOLD_NAMES) Mem
SYSTEM_PERIODIC_HOLD_Mem = MemoryUsage > XXXX
SYSTEM_PERIODIC_HOLD_Mem_REASON = "Memory usage exceeded XXXX"

# Add a policy for disk
SYSTEM_PERIODIC_HOLD_NAMES = $(SYSTEM_PERIODIC_HOLD_NAMES) Disk
SYSTEM_PERIODIC_HOLD_Disk = DiskUsage > YYYY
SYSTEM_PERIODIC_HOLD_Disk_REASON = "Disk usage exceeded YYYY"

Hope the above helps,
Todd




--
--- Get your facts first, then you can distort them as you please.--