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

Re: [HTCondor-users] Counting job num of holds for a given reason



> Hi,
> 
> I want to set a periodic release for a job in case the job is held with 
> code 34 only so I can request more memory next time when it is released. 
> However, I want the periodic_release to be triggered only once for these 
> set of jobs. I got most of the logic figured out, but am missing on how 
> to put the counter in place for number of times the job was held with 
> holdcode 34. Is there a macro or standard job classad attribute I am 
> missing?
> 

No easy way to have a counter like you ask above, but I think you could still achieve the policy you want (only increase the memory once).  How about a submit file like the following?  I didn't test it, but I think it will demonstrate the gist of what you want.  The trick it to record the initial memory request in the ad, and then compare the current memory request to the initial request to decide when to stop releasing the job instead of relying on a (non-existent) counter.

  executable = foo.exe
  +initial_memory = 256
  request_memory = ifthenelse(isUndefined(MemoryUsage),initial_memory,2*MemoryUsage)
  periodic_release = (HoldReasonCode =?= 34) && (request_memory < (2 * initial_memory))
  
regards,
Todd