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

Fix IndexMap->global_to_local() #2963

Merged
merged 5 commits into from
Jan 5, 2024
Merged

Conversation

jorgensd
Copy link
Member

@jorgensd jorgensd commented Jan 5, 2024

Issue
Current check for a global value coming into global_to_local has several issues

  1. If the global value is lower than the lowest existing ghost on process
  2. If the value is within the range of the smallest and largest ghost value, but not equal

Fixes

  • Check for equality if not at end of ghost array

Resolves #2962

Add fast handling of ghosts being outside of sorted (global) range.
Check for equality if index is within ghost range.
@jorgensd jorgensd added the bug Something isn't working label Jan 5, 2024
jorgensd added a commit to jorgensd/dolfinx_mpc that referenced this pull request Jan 5, 2024
Copy link
Member

@garth-wells garth-wells left a comment

Choose a reason for hiding this comment

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

Looks good.

Would a test be hard to add?

cpp/dolfinx/common/IndexMap.cpp Outdated Show resolved Hide resolved
cpp/dolfinx/common/IndexMap.cpp Outdated Show resolved Hide resolved
@jorgensd
Copy link
Member Author

jorgensd commented Jan 5, 2024

Looks good.

Would a test be hard to add?

If we expose global_to_local to the Python layer the test is quite easy to make.
A bit more of a pain in the C++ interface

@garth-wells garth-wells added this pull request to the merge queue Jan 5, 2024
Merged via the queue into main with commit 74509f5 Jan 5, 2024
19 checks passed
@garth-wells garth-wells deleted the dokken/fix-imap-global-to-local branch January 5, 2024 15:12
jorgensd added a commit to jorgensd/dolfinx_mpc that referenced this pull request Jan 8, 2024
* Fixes related to
FEniCS/dolfinx#2890
Currently need to rewrite distribute_ghost_data, as it needs all blocks to create the compressed map.
Plan is to add it as extra input

* Resolve issues with global_to_local. See: FEniCS/dolfinx#2963

* Fix option name

* Revert branches

* API changes from: FEniCS/dolfinx#2954
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dolfinx::common::IndexMap->global_to_local is broken
3 participants