[ET Trac] [Einstein Toolkit] #1946: sim setup should create a section for the current machine
Einstein Toolkit
trac-noreply at einsteintoolkit.org
Tue Jul 18 03:33:55 CDT 2017
#1946: sim setup should create a section for the current machine
--------------------------+-------------------------------------------------
Reporter: rhaas | Owner:
Type: enhancement | Status: new
Priority: minor | Milestone:
Component: SimFactory | Version: development version
Resolution: | Keywords:
--------------------------+-------------------------------------------------
Comment (by hinder):
Unfortunately, modifying "sim setup" is very awkward. Instead of direct
python code which asks questions and sets up a data structure which is
eventually written to defs.local.ini, which would be easy to modify, the
questions and actions are defined in terms of a "decision tree" via
configuration files. This means that adding logic which was not
originally intended to the setup process requires the additional step of
adding such logic to the generic decision tree language, then implementing
the change in the configuration file. "sim setup" starts off in sim-
util.py in command_setup, where we have
{{{
dt = simdt.DecisionTree("defaults")
dt.setupTree()
dt.begin()
}}}
Here, "defaults" refers to the file lib/dt/defaults.ini, which contains
the configuration for the "defaults" decision tree. It contains things
like
{{{
[action:1]
prompt = Determining local machine name
action = %GET_LOCAL_MACHINE_NAME()%
dest = @machine@
printresults = yes
}}}
which means that the code should ask for the local machine name, then
execute a "macro" called GET_LOCAL_MACHINE_NAME (maybe for the default?),
then store the result in a section of the ini file, expanded as @.. at . I'm
not sure which machine is referred to here.
Anyway, there is a facility for setting machine-specific options; this is
the question at the end of the setup process which asks if you want to set
explicit machine-specific options. One way to work around the current
problem would be to ask users to set up their sourcebasedir here, but this
is obviously suboptimal.
Perhaps what we want is to copy all the settings from [default] to
[<machine>] after the setup process completes (though presumably not
overriding any which had been explicitly set by the user). If we could
access the ini file from command_setup, we might be able to try this, but
by the time dt.begin() exits, the file has already been written. There's
also no way to hook in to the system between writing the [defaults] and
[<machine>] sections.
In the spirit of the original code, we probably want a concept of copying
everything that was set in one part of the decision tree ([default]) into
another part ([<machine>]).
One suggestion would be to replace the entire "sim setup" code with a
simpler implementation. Unless I am missing something, it seems like it
should be less than a couple of pages of code. We might lose some
"advanced" functionality, but I suspect we don't use that functionality
anyway.
Is anyone already familiar with this code, and would like to take a stab
at fixing the problem in a way which is consistent with the original
implementation? Erik?
--
Ticket URL: <https://trac.einsteintoolkit.org/ticket/1946#comment:1>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit
More information about the Trac
mailing list