Skip to content

Commit

Permalink
Update agnostic_cylinders.py
Browse files Browse the repository at this point in the history
add an option and better file names for write solution
  • Loading branch information
DLWoodruff authored Aug 13, 2024
1 parent 4431309 commit 1401c09
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions mpisppy/agnostic/agnostic_cylinders.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def _parse_args(m):
domain=str,
default=None,
argparse=True)
cfg.add_to_config(name="write_solution",
description="send write solution output to a csv, an npv file and a directory with names based on the module",
domain=bool,
default=False)
cfg.popular_args()
cfg.two_sided_args()
cfg.ph_args()
Expand Down Expand Up @@ -138,10 +142,10 @@ def _parse_args(m):
wheel = WheelSpinner(hub_dict, list_of_spoke_dict)
wheel.spin()

write_solution = False
write_solution = cfg.write_solution
if write_solution:
wheel.write_first_stage_solution('farmer_plant.csv')
wheel.write_first_stage_solution('farmer_cyl_nonants.npy',
wheel.write_first_stage_solution(f'{module_fname}.csv')
wheel.write_first_stage_solution(f'{module_fname}.npy',
first_stage_solution_writer=sputils.first_stage_nonant_npy_serializer)
wheel.write_tree_solution('farmer_full_solution')
wheel.write_tree_solution(f'{module_fname}_solution')

0 comments on commit 1401c09

Please sign in to comment.