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

Avoid unnecessary queries to n_faces() #45

Merged
merged 3 commits into from
Dec 4, 2023
Merged

Conversation

fdrmrc
Copy link
Owner

@fdrmrc fdrmrc commented Dec 1, 2023

I was impressed by the large times we had during the assembly so I quickly profiled with Kcachegrind. Here's the call-graph with the current master:

n_faceswrong

The function n_faces() (the function which checks the number of faces for an agglomerate) was accidentally called multiple times during the neighbor_of_agglomerated_neighbor(). With this fix the number of calls to n_faces() is now equal to the number of calls to neighbor_of_agglomerated_neighbor (i.e. 780 in the next picture).

This also highlights other costly calls.

pr_n_faces

@luca-heltai

@fdrmrc fdrmrc changed the title Avoid unnecessary query to n_faces Avoid unnecessary queries to n_faces() Dec 1, 2023
@luca-heltai
Copy link
Collaborator

The tests are not passing.

@fdrmrc
Copy link
Owner Author

fdrmrc commented Dec 1, 2023

The failure is related to the function that builds the agglomerated mesh through the Rtree. That one is not yet in the deal.II master. Let me revert the test for the time being, I'll write the missing functionality as an utility.

@fdrmrc
Copy link
Owner Author

fdrmrc commented Dec 3, 2023

Last commit exploits hash tables to store the slaves of each agglomeration. This is used intensively in get_slaves_of_idx(master_cell)

@luca-heltai luca-heltai merged commit dbb3edd into main Dec 4, 2023
3 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.

2 participants