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

Refactor examples #253

Merged
merged 18 commits into from
Mar 11, 2024
Merged

Refactor examples #253

merged 18 commits into from
Mar 11, 2024

Conversation

siuwuncheung
Copy link
Member

@siuwuncheung siuwuncheung commented Dec 5, 2023

  • The DMD prediction timers are adjusted to only count the prediction in the final time. Previously, since timers count all the intermediate predictions for the purpose of visualizations, the DMD prediction time is significantly different if visualization is enabled or disabled.
  • BasisGeneratorFinalSummary in two MFEM PROM examples is replaced by finalSummary in BasisGenerator class. (BasisGeneratorFinalSummary in Laghos can be replaced as well.)
  • In BasisGenerator class, loadSampleRange routine is added to enable the capability of using selected range of snapshot indices from col_min to col_max inclusive. The loadSample routine is now based on loadSampleRange using all indices.

@siuwuncheung siuwuncheung changed the title Change DMD prediction timer Refactor examples Dec 18, 2023
@siuwuncheung siuwuncheung requested a review from jtlau January 8, 2024 18:05
@siuwuncheung
Copy link
Member Author

@jtlau I'm using the general combine_samples script for one of my projects, and would like to ask for your PR to make sure all these changes look alright to you.

Copy link
Collaborator

@jtlau jtlau left a comment

Choose a reason for hiding this comment

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

combine_samples looks good to me. Thanks for updating it!

@siuwuncheung siuwuncheung requested a review from axla-io January 16, 2024 21:51
@siuwuncheung siuwuncheung self-assigned this Jan 22, 2024
@siuwuncheung siuwuncheung added the WIP Work in progress label Jan 22, 2024
@chldkdtn
Copy link
Collaborator

This PR needs one more reviewer, @ckendrick @dylan-copeland @dreamer2368 , anyone volunteer?

@dylan-copeland
Copy link
Collaborator

This PR needs one more reviewer, @ckendrick @dylan-copeland @dreamer2368 , anyone volunteer?

This is a WIP, not RFR.

@chldkdtn
Copy link
Collaborator

This PR needs one more reviewer, @ckendrick @dylan-copeland @dreamer2368 , anyone volunteer?

This is a WIP, not RFR.

Oh, I thought this was RFR. @siuwuncheung Can you confirm?

@siuwuncheung siuwuncheung added RFR Ready for review and removed WIP Work in progress labels Feb 22, 2024
@siuwuncheung
Copy link
Member Author

siuwuncheung commented Feb 22, 2024

At this point, I put this PR as RFR. Besides BasisGeneratorFinalSummary, there are still several general-purpose routines in exmaples/prom/mixed_nonlinear_diffusion.cpp and examples/prom/nonlinear_elasticity_global_rom.cpp that I think can be moved to the library. But since they are not related to the MD project, I'll list them here and leave it to a future PR (probably by @ckendrick).

  • GetFirstColumns
  • MergeBasis
  • GetSnapshotMatrix
  • BroadcastUndistributedRomVector

A good point suggested by @dylan-copeland is that, we make deep copies of the matrices in these routines. When they are moved to the library, we'd probably want to find a way to avoid the entire matrix deep copy. However, it is non-trivial since matrices are row-based and we need columns.

lib/linalg/BasisGenerator.h Outdated Show resolved Hide resolved
lib/linalg/BasisGenerator.h Outdated Show resolved Hide resolved
lib/linalg/BasisGenerator.h Outdated Show resolved Hide resolved
lib/linalg/BasisGenerator.cpp Outdated Show resolved Hide resolved
lib/linalg/BasisGenerator.h Outdated Show resolved Hide resolved
examples/misc/combine_samples.cpp Show resolved Hide resolved
@siuwuncheung siuwuncheung merged commit 3881614 into master Mar 11, 2024
4 checks passed
andersonw1 pushed a commit that referenced this pull request Apr 2, 2024
* Add example results

* Count DMD prediction timer only at final time

* Move final summary for basis generator into library

* Stylize

* Add finalSummary to combine_samples

* Enable capabilities in combine_samples.cpp

* Astyle

* Remove spaces

* Run astyle

* Change to 1-base

* Change comments

* Change to energy fraction threshold

* Pass the string by reference

* Astyle

* Modify brief

* Run astyle
@siuwuncheung siuwuncheung deleted the dmd_prediction_time branch April 11, 2024 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants