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

Re: [Condor-users] Question Regarding Configuration File Syntax

On Thu, 28 Jul 2005 16:43:06 -0400  "Bryan S. Maher" wrote:

> SUSPEND         = ( $(KeyboardBusy) || \
>                  ( (CpuBusyTime > 2 * $(MINUTE)) \
>                     && $(ActivationTimer) > 90 ) )
> In the manual, both KeyboardBusy and CpuBusyTime appear in section
> as "macros to help write the expressions clearly."

sorry, that's wrong.  KeyboardBusy is a macro, as described, but
CpuBusyTime is NOT a macro.  it's something computed for you by the
startd, and automatically inserted into machine classads.  that's why
you don't need (in fact, can't use) the $() macro syntax when refering
to it.  unless you see it in your config file, you can't use $() on it.

> On the first line of the SUSPEND macro, KeyboardBusy is referenced
> using $() on the second line, CpuBusyTime is referenced without the
> $().  I'm very confused by this.

yup, sorry, that's confusing. ;)  the docs are just misleading in this
case.  one really is a macro, the other is a classad expression.  for
clarity, the difference is:

macros are anything you put in the config file that you refer to with
$() to do a simple text substitution.  in general, macros themselves
are not things condor knows about and looks for, but are used to help
define things which condor is looking for from the config file.  

classad expressions are anything that's directly in a classad in
condor (visible with "condor_status -long" or "condor_q -long").
classad expressions can always refer to other classad expressions
(either in the same classad, or in the case of a classad match, in the
"other" classad you're matching against) without any funny syntax. 
many classad expressions are computed automatically for you
(especially in machine ads, but also job ads).  some expressions come
from the config file.

> PREEMPT	        = ( ((Activity == "Suspended") && \
>                     ($(ActivityTimer) > $(MaxSuspendTime))) \
>                     || (SUSPEND && (WANT_SUSPEND == False)) )
> Why aren't $(SUSPEND) and $(WANT_SUSPEND) required in the PREEMPT
> expression?

because SUSPEND and WANT_SUSPEND are both lines from your config file,
*and* they're also classad expressions.  however, it's EVEN WORSE in
this case, since the startd maintains its own internal classads that
aren't even visible with condor_status. ;)  UGH.  so, you'd have no
way of knowing that they're really expressions already in the classad
where the startd evaluates these policy statements, and that's why you
don't need $().  sorry.  

to add to the confusion, in THIS case, you COULD use $() and it'd
still work, since as i said, SUSPEND is both a line in the config file
(and therefore, available for $() text substitution), and a classad
expression.  so, you could also have your PREEMPT refer to
"$(SUSPEND)".  the reason we don't ship the defaults like that is so
that if you do "condor_config_val PREEMPT" and you have a big
complicated SUSPEND expression, things don't get hopelessly too
confusing.  you have a level of indirection to allow the PREEMPT
expression to be more human readable...  see, we do it like this to
avoid confusion, honest. ;)

> Any insight on the proper use of $() is greatly appreciated.

hopefully the above will help.  in my copious free time (yeah, right),
i'll try to make sure the manual is more accurate with some of these
details.  until then, you'll just have to suffer.

again, sorry this is so confusing.  i'll be the first to admit (and
complain) that condor's user interface is quite clumsy, full of legacy
weirdness, inconsistencies, and things that are counter-intuative.  if
we never had to worry about backwards (and i do mean backwards)
compatibility, it would have all been changed long ago...