Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions doc/src/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -309,15 +309,23 @@ This is fairly complicated example because it is multi-stage and the
model itself offers a lot of flexibility. The aircond example is
unusual in that the model file, ``aircond.py``, lives in
``mpisppy.tests.examples`` directory. Scripts and bash files that use
it live in ``examples.aircond``. A good place to start is the
``aircond_cylinders.py`` file that starts with some functions that
support the main program. The main program makes use of the
``Config`` object called `cfg` that creates a parser and gets arguments.

The configuration data obtained by the parser are passed directly to the vanilla hub
and spoke creator which knows how to use the arguments from a ``Config`` object.
The arguments unique to aircond are processed by the ``create_kwargs`` function
in the reference model file.
it live in ``examples.aircond``. Because ``aircond.py`` provides
``scenario_creator``, ``inparser_adder``, ``kw_creator``,
``scenario_names_creator`` and ``sample_tree_scen_creator``, runs can
go through ``mpisppy/generic_cylinders.py`` by pointing
``--module-name`` at ``mpisppy/tests/examples/aircond``.

A good place to start reading is the ``aircond_cylinders.py`` file,
which is retained as a worked example of the hand-rolled cylinders
pattern (and, together with ``bundle_pickler.py``, as the canonical
proper-bundles demo). It starts with some functions that support the
main program, and the main program makes use of the ``Config`` object
called `cfg` that creates a parser and gets arguments. The
configuration data obtained by the parser are passed directly to the
vanilla hub and spoke creator which knows how to use the arguments
from a ``Config`` object. The arguments unique to aircond are
processed by the ``create_kwargs`` function in the reference model
file.

A simple example that uses a few of the options is shown in ``aircond_zhat.bash``, which
also calls the ``xhat4xhat`` program to estimate confidence intervals for the solution
Expand Down
File renamed without changes.
10 changes: 10 additions & 0 deletions examples/run_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,16 @@ def do_one_mmw(dirname, modname, runefstring, npyfile, mmwargstring):
"--branching-factors \'4 3 2\' --max-iterations=100 "
"--default-rho=1 --lagrangian --xhatshuffle "
"--solver-name={}".format(solver_name))

# Same aircond run via the generic driver. generic_cylinders requires
# --stage2EFsolvern with multistage xhatshuffle (aircond.py doesn't
# register that option), so this entry uses --xhatxbar instead to
# still exercise the lagrangian + xhat-inner-bound combo.
do_one("aircond", "../../mpisppy/generic_cylinders.py", 3,
"--module-name ../../mpisppy/tests/examples/aircond "
"--branching-factors \'4 3 2\' --max-iterations=100 "
"--default-rho=1 --lagrangian --xhatxbar "
"--solver-name={}".format(solver_name))
do_one("aircond", "aircond_ama.py", 3,
"--branching-factors \'3 3\' --max-iterations=100 "
"--default-rho=1 --lagrangian --xhatshuffle "
Expand Down
Loading