Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make setup() in scenario switch directory if set #180

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

kejacobson
Copy link
Collaborator

When running a multipoint case, the MPhys scenario class has a run_directory option to run each scenario in a particular directory. The purpose of this is that if a solver writes output files like residual histories, visualization files, restart files, etc. then scenarios will not overwrite each other's files.

Another potential use of switching directories is specifying separate input options for separate scenarios. For example,
Having scenario0/driver.cfg and scenario1/driver.cfg. A typical way this would be implemented is the Builder reading these inputs during initialize(). For a serial Multipoint case, the user would handle reading the inputs separately or switching directories before calling initialize. However in parallel Multipoint cases where initialize() is called within the scenario, the builder currently has no way to know which input file to use.

The change makes a scenario switch directories in setup(), which means that calls to Builders' initialize() will be done while in the scenario directory.

@timryanb timryanb self-requested a review July 22, 2024 15:50
Copy link
Collaborator

@timryanb timryanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm still unsure about using the same directory for both input and output files, but if this is how some of our other libraries run I'm fine with it

@kejacobson kejacobson merged commit a2bd8c6 into OpenMDAO:v2.0.0_beta Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants