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

Add dry run capability #1286

Merged
merged 3 commits into from
Oct 14, 2024
Merged

Add dry run capability #1286

merged 3 commits into from
Oct 14, 2024

Conversation

mbkuhn
Copy link
Contributor

@mbkuhn mbkuhn commented Oct 14, 2024

Summary

Had a request for a dry run capability so the setup could be viewed without running a simulation. This is a sort-of automated way of doing the least amount of work while still populating arrays and outputting a plotfile. I also made sure that a plotfile will still be written when doing a dry run for a restart.

Pull request type

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Checklist

The following is included:

  • new unit-test(s)
  • new regression test(s)
  • documentation for new capability

This PR was tested by running:

  • the unit tests
    • on GPU
    • on CPU
  • the regression tests
    • on GPU
    • on CPU

Additional background

Before merging, I'll need to add this to the documentation. I could incorporate it into it's own reg test, but I'm not sure it's worth the hassle.

@mbkuhn
Copy link
Contributor Author

mbkuhn commented Oct 14, 2024

This approach to a dry run would still require similar memory demands to the actual simulation, but it would require basically no time and very little computing power. Not sure how to avoid memory needs when the goal is to actually initialize the arrays.

@mbkuhn
Copy link
Contributor Author

mbkuhn commented Oct 14, 2024

It would be good to chat with @hgopalan, @rthedin, and @MaxPal to see if this would be useful for their workflows.

@hgopalan
Copy link
Contributor

I think if it is for the complex terrain support, we need to read the TerrainDrag module which initializes the terrain_blank field and provides information on the terrain mapping before running simulations. I register the velocity field to create amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi since I did not know how to do it otherwise with all new variables. If there is a way to avoid calling the velocity field, I can update the TerrainDrag and we would need only to register the new variables and plot them.

@marchdf
Copy link
Contributor

marchdf commented Oct 14, 2024

I don't think we need a regtest for this. But documentation would be good ;)

@mbkuhn
Copy link
Contributor Author

mbkuhn commented Oct 14, 2024

I think if it is for the complex terrain support, we need to read the TerrainDrag module which initializes the terrain_blank field and provides information on the terrain mapping before running simulations. I register the velocity field to create amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi since I did not know how to do it otherwise with all new variables. If there is a way to avoid calling the velocity field, I can update the TerrainDrag and we would need only to register the new variables and plot them.

Thanks for sharing. For the sake of the terrain, there probably could be a standalone tool devised to address that need, which would be nimbler in terms of memory needs. This approach is more general and should help others who would appreciate the capability with different problems. One nice thing with this approach is it uses the actual code path of AMR-Wind, so it should run into the same problems that a real run would (e.g., if something is not set up properly in the input).

@mbkuhn mbkuhn marked this pull request as ready for review October 14, 2024 22:19
@mbkuhn mbkuhn enabled auto-merge (squash) October 14, 2024 22:21
@mbkuhn mbkuhn merged commit 365eb0f into Exawind:main Oct 14, 2024
15 checks passed
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.

4 participants