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

[HTCondor-users] condor_submit and default values



Hello all,

We are trying to do a seemingly easy thing, but it has become surprisingly difficult.

We want our users to be able to add an extra classad to their jobs (let's say it's a "tag"), and for their convenience we want this tag to be specified either through an environment variable or directly in the submit file, but with the submit file taking precedence. What we have tried (and did *NOT* work):

* Using a wrapper for condor_submit (we already have one of these). condor_submit -append 'Tag = $ENV(TAG)' takes precedence over any line "+Tag = FOO" in the submit file, since it's inserted just before the "Queue" statement (or so the documentation says). It would be nice to have "condor_submite -prepend" to place defaults at the beginning of the submission commands.
* Using a full classad _expression_ as a custom attribute: condor_submit -append Tag = IfThenElse(isUndefined(Tag),$ENV(TAG),Tag) (BTW, trying this with SUBMIT_EXPRS doesn't work either).
* Using a condor_submit macro in SUBMIT_EXPRS:
    Tag = $(DOLLAR)ENV(TAG)
    SUBMIT_EXPRS = $(SUBMIT_EXPRS) Tag
* Using default _CONDOR_* (i.e. setting _CONDOR_TAG)  as seen in https://htcondor-wiki.cs.wisc.edu/index.cgi/wiki?p=HowToInsertCustomClassAdIntoJobs and just placing
    SUBMIT_EXPRS = Tag
    (it takes the environment from the schedd and not from condor_submit?)

We finally found some kind of solution (hey, condor is great), but, frankly, it is a kludge:

* Using a wrapper for condor_submit to set an "environment tag":
    condor_submit -append "EnvTag = $ENV(TAG)"
  And then using SUBMIT_EXPRS (could also be another -append, but we feel this is cleaner) with substitution macros:
    Tag = $(([IfThenElse(isUndefined(Tag),EnvTag,Tag)])

The problem with this is that it gets evaluated after matching, and we would like to have the info (neatly available) even when sitting at the queue... And, moreover, I think it is ugly as hell.

So, why this mail? I would like to know if any of the first four solutions *SHOULD* have worked, and it is us who have done some mistake... And if not, to propose them as future enhancements, because I think the three of them have the potential to be very useful.

Regards,

Joan

-- 
--------------------------------------------------------------------------
Joan Josep Piles Contreras -  Analista de sistemas
I3A - Instituto de Investigación en Ingeniería de Aragón
Tel: 876 55 51 47 (ext. 845147)
http://i3a.unizar.es -- jpiles@xxxxxxxxx
--------------------------------------------------------------------------