The --define option does not work

Create issue
Issue #998 new
anonymous created an issue

At a simfactory call it should be possible to define a value of a variable by setting

--define VAR=NEWVALUE

Them the variable @VAR@ in a run- or submitscript should be expanded to NEWVALUE.

Using define a shown above leads to the error:

[snip] sim.py: error: --define option requires 2 arguments [snip]

So I have tried also

--define VAR NEWVALUE

Using this --define in this way, the submission is successful, however @VAR@ is never evaluated by simfactory, so in the submit- and runscript @VAR@ instead of NEWVALUE can still be found.

Keyword:

Comments (4)

  1. Ian Hinder
    • removed comment

    I believe that it works for parameter files but not for run scripts. Does it work for optionlists and submit scripts? I think the design should be that all these files are treated in the same way.

  2. anonymous reporter
    • removed comment

    I am on it, and I think i have found a solution, so please wait a bit...

    Alexander

  3. anonymous reporter
    • removed comment

    A fix is available, and checked in into the trunk, because it requires further testing.

    The following changes where required:

    1) in simsubs.py n the set function: disable the if condition

    1. if self.PresetMacros.has_key(define):

    2) in simrestart.py in the functions submit and run, added the dict DefineDatabase.PresetMacros to the dict new_properties.

    Doing so, it is possible to add several --defines to a simfactory submit and / or run. However, because I am not sure about any side effects of the change in simsubs, I am checking in this changes only to the trunk branch right now.

    Alexander

  4. Log in to comment