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

Re: [HTCondor-users] Python and Requirements in a ClassAd



I kept experimenting with this, and finally figured out what I was doing wrong.  The expression is:


            ad["Requirements"] = classad.ExprTree('TARGET.Machine == "%s" && TARGET.SlotID == %s' % (machine, slotID))


On May 13, 2014, at 5:01 PM, Stephen Pietrowicz wrote:

> Hi,
> 
> I'd like to use the Python binding to submit a job. I've successfully submitted jobs while altering the class ad before submitting, and that works. works.
> 
> Now I'm trying to add Requirements to the class ad and ran into a problem.
> 
> A line like this in code:
> 
>            ad["Requirements"] = 'TARGET.Machine == "%s"' % machine
> 
> The Requirements expression for your job is:
> 
>    "TARGET.Machine == \"somemachine.ncsa.uiuc.edu\"" && TARGET.OPSYS == "LINUX" &&
>    TARGET.ARCH == "X86_64" &&
>    TARGET.FileSystemDomain == MY.FileSystemDomain &&
>    TARGET.Disk >= RequestDisk && TARGET.Memory >= RequestMemory
> 
> Note the extra set of quotes around the machine expression.
> 
> What's the right syntax for adding this?  I'd also like to add the slot number, but I simplified the problem for this email.  I think I'm missing something pretty basic here.
> 
> Any help would be appreciated.
> 
> Steve
> _______________________________________________
> HTCondor-users mailing list
> To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
> subject: Unsubscribe
> You can also unsubscribe by visiting
> https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users
> 
> The archives can be found at:
> https://lists.cs.wisc.edu/archive/htcondor-users/
>