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

Re: [HTCondor-users] GPU-optional matching?



On 6/13/2016 10:51 AM, Michael V Pelletier wrote:
> So we've got a situation where certain jobs can run better if a GPU is 
> available, but can still run fine without one. This poses an interesting 
> problem - the "request_gpus" line bakes that request into the job 
> requirements expression, so that the job won't run unless it can get a 
> GPU for itself.
> 
> Is there any clever trick anyone can think of which will reserve a GPU 
> and set up the appropriate environment variables if one is available, 
> but still allow the job to match and run even if it can't? 

Untested, but I think perhaps this will do the trick:

  executable = foo.exe
  request_gpus = gpus > 0 ? 1 : 0
  rank = gpus > 0
  queue

Not sure, but I think the fact that condor_submit will put into your Requirements that
   Target.gpus >= Requestgpus
will still evaluate and match ok.

Another untested guess that is more complicated, but has an even higher chance of working since it explicitly deals with gpus being undefined, would be: 

  executable = foo.exe
  request_gpus = ifthenelse(gpus =?= UNDEFINED, 0, ifthenelse(gpus > 0, 1, 0))
  rank = gpus > 0
  queue

Hope the above helps,
Todd