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

Reduce dynamic memory allocations #139

Open
parikshitbajpai opened this issue May 11, 2023 · 2 comments
Open

Reduce dynamic memory allocations #139

parikshitbajpai opened this issue May 11, 2023 · 2 comments
Labels
performance Changes that can help improve the performance of the code

Comments

@parikshitbajpai
Copy link
Collaborator

parikshitbajpai commented May 11, 2023

Reason.
Dynamic memory allocation such as in PolyRegularQKTO takes a significant amount of time such as in the example below.

Proposed Solution
Reserve enough memory at start of program? A proper solution will obviously need more thought and a redesign of the code (or just use Yellowjacket-GEM 😅)

Impact
Faster multiphysics

Additional context
image

@dschwen
Copy link
Collaborator

dschwen commented May 11, 2023

Any fortran array with a size that is dependent on a runtime variable will lead to a malloc/free pair. The profile shows that > 30% of the Thermochimica time is spent in either malloc or free. At first glance it looks like those could largely be avoided by reusing buffer space (sized for the maximim number of species in a given phase for example).

@parikshitbajpai
Copy link
Collaborator Author

@markuspiro any suggestions?

@parikshitbajpai parikshitbajpai added the performance Changes that can help improve the performance of the code label Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Changes that can help improve the performance of the code
Projects
None yet
Development

No branches or pull requests

2 participants