Skip to content

Commit

Permalink
Merge pull request #453 from DLWoodruff/async_cfg
Browse files Browse the repository at this point in the history
Async cfg
  • Loading branch information
bknueven authored Nov 20, 2024
2 parents eb534de + d3db716 commit 92cfd85
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
9 changes: 1 addition & 8 deletions mpisppy/generic_cylinders.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
from mpisppy import MPI



def _parse_args(m):
# m is the model file module
cfg = config.Config()
Expand All @@ -46,12 +45,6 @@ def _parse_args(m):
description="The string used for a directory of ouput along with a csv and an npv file (default None, which means no soltion output)",
domain=str,
default=None)
cfg.add_to_config(name="run_async",
description="Use APH instead of PH (default False)",
domain=bool,
default=False)


m.inparser_adder(cfg)
# many models, e.g., farmer, need num_scens_required
# in which case, it should go in the inparser_adder function
Expand Down Expand Up @@ -136,7 +129,7 @@ def _do_decomp(module, cfg, scenario_creator, scenario_creator_kwargs, scenario_
# Things needed for vanilla cylinders
beans = (cfg, scenario_creator, scenario_denouement, all_scenario_names)

if cfg.run_async:
if cfg.APH:
# Vanilla APH hub
hub_dict = vanilla.aph_hub(*beans,
scenario_creator_kwargs=scenario_creator_kwargs,
Expand Down
7 changes: 5 additions & 2 deletions mpisppy/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,12 @@ def mip_options(self):
domain=float,
default=None)


def aph_args(self):


self.add_to_config(name="APH",
description="Use APH instead of PH (default False)",
domain=bool,
default=False)
self.add_to_config('aph_gamma',
description='Gamma parameter associated with asychronous projective hedging (default 1.0)',
domain=float,
Expand Down

0 comments on commit 92cfd85

Please sign in to comment.