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

[HTCondor-users] help/warn user if specified value not string wrapped in double quotes



We have a custom Nodeset attribute weâd like to be set for each job. If the user does not specify Nodeset weâd like it to be set to "NORMAL". If the user does specify a Nodeset we'd like it to be set as they specified.

 

A Job Transform like this comes close to doing what we want:

JOB_TRANSFORM_NAMES = $(JOB_TRANSFORM_NAMES) DEFNODESET

JOB_TRANSFORM_DEFNODESET @=ENDDNS

   REQUIREMENTS NODESET IS UNDEFINED

   SET NODESET "NORMAL"

@ENDDNS

 

In particular, if the user does not specify anything, then Nodeset is set to "NORMAL". And if they specify a string in "", it is preserved, e.g.,

$ condor_submit <submit file> -append '+Nodeset="DEBUG"'

This results in Nodeset = "DEBUG" (the job transform is skipped; again, this is desired).

 

However, if the user attempts to specify Nodeset but passes text w/o using double quotes, it seems to be treated as Undefined and is set to "NORMAL". E.g.,

$ condor_submit <submit file> -append '+Nodeset=DEBUG'

Results in Nodeset = "NORMAL" (the job transform takes effect; this is NOT desired).

 

In this case, we either want to make HTCondor wrap the non-string in "", e.g., DEBUG becomes "DEBUG", or otherwise we probably want to skip the Job Transform and use a Submit Requirement to catch the non-string and tell the user to try again with "".

 

Note that we have the additional complication that a Nodeset may be a hostname w/ hyphens, e.g., prj-cluster-sub01. I realize that those hyphens are vastly different if interpreted as minus or unary negation as opposed to the hyphen character in a string.

 

Is there a way to achieve what we're after: Warn/help the user out if they forget to wrap the Nodeset value in "" ?