Skip to content

Commit 1401c09

Browse files
authored
Update agnostic_cylinders.py
add an option and better file names for write solution
1 parent 4431309 commit 1401c09

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Diff for: mpisppy/agnostic/agnostic_cylinders.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ def _parse_args(m):
4141
domain=str,
4242
default=None,
4343
argparse=True)
44+
cfg.add_to_config(name="write_solution",
45+
description="send write solution output to a csv, an npv file and a directory with names based on the module",
46+
domain=bool,
47+
default=False)
4448
cfg.popular_args()
4549
cfg.two_sided_args()
4650
cfg.ph_args()
@@ -138,10 +142,10 @@ def _parse_args(m):
138142
wheel = WheelSpinner(hub_dict, list_of_spoke_dict)
139143
wheel.spin()
140144

141-
write_solution = False
145+
write_solution = cfg.write_solution
142146
if write_solution:
143-
wheel.write_first_stage_solution('farmer_plant.csv')
144-
wheel.write_first_stage_solution('farmer_cyl_nonants.npy',
147+
wheel.write_first_stage_solution(f'{module_fname}.csv')
148+
wheel.write_first_stage_solution(f'{module_fname}.npy',
145149
first_stage_solution_writer=sputils.first_stage_nonant_npy_serializer)
146-
wheel.write_tree_solution('farmer_full_solution')
150+
wheel.write_tree_solution(f'{module_fname}_solution')
147151

0 commit comments

Comments
 (0)