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

Reduced the memory allocation in the TimeseriesOutputComp in common use cases. #1096

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

robfalck
Copy link
Contributor

Summary

TimeseriesOutputComp was allocating interpolation and differentiation matrices even when they were not used.
This PR refactors the configuration of TimeseriesOutputComp so that it does not bother constructing or saving the interpolation and or differentiation matrices when they are not used.

The lagrange_matrices function now takes compute_L and compute_D as boolean arguments, and will only construct the interpolation and/or differentiation matrices when requested.

Related Issues

Backwards incompatibilities

None

New Dependencies

None

… matrices.

This is especially important in the Birkhoff transcription where the pseudospectral differentiation matrix is large and dense.
In cases where the component was simply echoing its inputs as outputs, the interpolation matrix is not needed.
If no rate outputs are needed, then the differentiation matrix is not needed.
In light of the Birkhoff transcription, problems should be formulated to remove the need for differentiation matrices.
@coveralls
Copy link

Coverage Status

coverage: 92.528% (-0.2%) from 92.73%
when pulling 9f5ad5a on robfalck:timeseries_memory_fix
into f56e0e9 on OpenMDAO:master.

@robfalck robfalck merged commit be40d14 into OpenMDAO:master Aug 14, 2024
10 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.

TimeseriesOutputComp allocates memory unnecessarily
3 participants