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

Re: [HTCondor-users] enforce classad values in submit file

hi todd,
wow! thanks a lot. i will definitely try this out!

and i would like to say a general thanks to the whole list. the support of htcondor is nothing short of awesome!


Am 2016-03-21 um 17:05 schrieb Todd Tannenbaum:
On 3/18/2016 12:15 PM, Thomas Hartmann wrote:
hi, is there any way to enforce certain classads expressions in a
submit file?

to be more specific, i want this classad to be used for every job and
i want to prevent users from changing it:

request_memory = ifThenElse(MemoryUsage =!= UNDEFINED, ( MemoryUsage
) * 3 / 2, 1024)

another possibility might be using SUBMIT_REQUIREMENT_.... so a job
with a request_memory different from what is specified would be
rejected. but the problem would be here, that the expression would be
evaluated first, so i could not check for the ifthenelse expression,

Hi Thomas,

This is an area we are planning to improve soon in the v8.5 series to make it easier for the admin.  But for right now in currently released versions of HTCondor, I think you can indeed check for the ifthenelse expression via SUBMIT_REQUIREMENT by using the unparse() ClassAd built-in function in your SUBMIT_REQUIREMENTS expression.  See the docs for ClassAd functions at http://is.gd/AmcY3X

So I am thinking today you could append something like the following in your condor_config :

   JOB_DEFAULT_REQUESTMEMORY = ifthenelse(x,y,z)
   SUBMIT_REQUIREMENT_MEMORY = unparse(RequestMemory) =?= "ifthenelse(x,y,z)"
   SUBMIT_REQUIREMENT_MEMORY_REASON = "You are not allowed to set request_memory"

Before setting up the above, you will probably want to do a condor_q -l on a job that has your desired RequestMemory attribute so you can get the whitespacing correct to compare against unparse().  Note that the PROTECTED_JOB_ATTRS setting, which appeared in v8.5.2, will prevent a determined user from changing these attributes after submission with condor_qedit or chirp.

While I think the above will let you do what you want today, I admit it is kinda clunky, which is why we will be improving it soon so the admin will be easily able to tell the schedd things like "override the value of this attribute upon submission".

Hope this helps
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting

The archives can be found at:

Dr. Thomas Hartmann

Centre for Cognitive Neuroscience
FB Psychologie
Universität Salzburg
Hellbrunnerstraße 34/II
5020 Salzburg

Tel: +43 662 8044 5109
Email: thomas.hartmann@xxxxxxxx

"I am a brain, Watson. The rest of me is a mere appendix. " (Arthur Conan Doyle)