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

Re: [HTCondor-users] if/endif conditionals in new/old style job transforms/routes



The new job router syntax is more like submit or config language than the classad language, so you can use if/else/endif in a route in the new syntax.

For instance, to add a NeedMultipleGPUs attribute to jobs that ask for more than a single GPU, you could use an If statement referring to the job attribute by using the My prefix.  


JOB_ROUTER_ROUTE_FOO @=end

  if defined My.RequestGPUs
       EVALSET NeedMultipleGpus $(My.RequestGPUs) > 2
  endif

@end

The above transform has no effect on jobs that don't have a RequestGPUs attribute, and will set a NeedMultpleGPUs attribute to either true or false
in jobs that do have a RequestGpus attribute

This only works if you use the new job router syntax. 

-tj


From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> on behalf of Thomas Hartmann <thomas.hartmann@xxxxxxx>
Sent: Tuesday, February 23, 2021 9:59 AM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] if/endif conditionals in new/old style job transforms/routes
 
Hi all,

can actually the if/else/endif semantic [1] be used in job
transforms/routes?
Maybe just in the '[new]' or 'old/internal' ad language?

Cheers,
   Thomas

[1]
https://htcondor.readthedocs.io/en/latest/users-manual/submitting-a-job.html?highlight=endif#using-conditionals-in-the-submit-description-file