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

Raise error when DSP is used without IndexSet #16975

Open
tjhei opened this issue May 7, 2024 · 5 comments
Open

Raise error when DSP is used without IndexSet #16975

tjhei opened this issue May 7, 2024 · 5 comments

Comments

@tjhei
Copy link
Member

tjhei commented May 7, 2024

A very annoying and subtle bug is when you forget to provide an IndexSet to DynamicSparsityPattern: Everything works but the memory requirements for the data structure are O(total DoFs) instead of O(locally owned DoFs) in parallel.

My suggestion:
Add an AssertThrow() to distribute_sparsity_pattern() to check that the DSP has an IndexSet set, which is not the whole set.

Can you do this, @vyushut ?

@bangerth
Copy link
Member

bangerth commented May 7, 2024

What do you do if you run a parallel code on one processor? What if you run it on two processors, but you only have one cell and consequently all DoFs on one process are locally owned?

@tjhei
Copy link
Member Author

tjhei commented May 7, 2024

I would compare the IndexSet passed to distribute_sparsity_pattern() with the one stored inside the DSP: if the argument doesn't contain all DoFs, then the DSP should also not store all lines. I think all your cases should work (but we should test this as well!).

@tjhei
Copy link
Member Author

tjhei commented May 7, 2024

It is a hard to catch bug as you can see in #16878, where none of the reviewers caught it (including myself). :-)

@bangerth
Copy link
Member

bangerth commented May 7, 2024

Ha, yes, for sure. I think comparing the index sets is a good strategy!

@vyushut
Copy link
Contributor

vyushut commented May 16, 2024

#17033
I subtract one IndexSets from another and expect the number of indexes to be zero.

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

No branches or pull requests

3 participants