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

Re: [Condor-users] Forbid SlotID use in submit files?

Steffen Grunewald wrote:
> On Mon, Apr 20, 2009 at 08:08:51AM -0500, Matthew Farrellee wrote:
>>> I'd like to stop users from running jobs containing SlotID Requirements on
>>> most pool nodes.
>>> Would a START expression of the form 
>>> do the trick? (Did I get the idea of TARGET wrong?)
>>> Thanks,
>>>  Steffen
>> If jobs do have a SlotID, you're golden. If not, and jobs only
>> references the SlotID in their Requirements expressions, you have the
>> right idea with TARGET but that specific use wouldn't work.
> Could you please explain why?
> (Would something along the lines of 
> 	((TARGET.SlotID =!= 1) && (TARGET.SlotID =!= 2)... ) == False)
> make a significant difference?
> (And, BTW, is there no way to logically negate, except comparing to False?)

Because TARGET in a START expression gives you access to attributes on
the Job. Cmd, Arguments, Owner and Requirements are attributes on a Job.
SlotID isn't. SlotID is likely just used within your Requirements
expressions. So you need to check for it there.

If your users submit jobs with a SlotID attribute, then you're probably
ok with START = TARGET.SlotID...

>> You could use regexp instead, e.g. START = regexp(".*SlotID.*",
>> Requirements), but that might get slow.
> Probably I can waste a second when I can save a couple of hours of a machine
> which would be used by mistake otherwise.
>> If you really just want to prevent the old jobs from running, an
>> alternative would be to flag all your old jobs as such, e.g.
>> condor_qedit -const 'regexp(".*SlotID.*", Requirements)' FlaggedOld
>> TRUE. Then your START could check for TARGET.FlaggedOld.
> This would require constant vigilance - what I need is something automatic.
>> Given that you can flag jobs with the old requirements expression, you
>> could look into just rewriting the expressions entirely with condor_qedit.
> But condor_qedit needs jobs already in the queue, and it would be a pain to
> throw them out of their slots again.
> I'd rather like them not to enter Running state at all - which is why RANKs
> wouldn't do...

If you have to worry about users submitting new jobs with SlotID in
their requirements you may want to talk to them, and you'll not be able
to use the qedit solution.

You can disallow use of SlotID with the regexp in START, though be
careful how general your expression is, .*SlotID.* will match a lot of
things but won't match slotid.



> Thanks,
>  Steffen