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

On loadBalance(...) "addCornerCells" should be called "addEdgeCells"? #808

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aritorto
Copy link
Member

@aritorto aritorto commented Nov 28, 2024

In an attempt to assign unique point ids on a distributed grid with LGRs, I invoked loadBalance, enabling the inclusion of cells that share corners with interior cells on each process by setting addCornerCells = true (one of the function arguments in loadBalance). However, instead of adding corner-sharing cells, this configuration primarily adds cells that share edges, in addition to the overlap layer of size 1. As a result, cells that share only a corner are not included, which can impact the uniqueness of point ids in certain cases.

In the test addLgrsOnDistributedGrid_test.cpp, both escenarios are included:

cases where setting addCornerCells=true fix the issue of unique point ids
cases where setting addCornerCells=true is not enough to achieve unique point ids (cells that share only corners - and not edges - are not included).

Not relevant for the Reference Manual.

Replacement for #806

@aritorto
Copy link
Member Author

jenkins build this serial please

@aritorto aritorto force-pushed the recoverAddCornerCells branch from 3a776e7 to 71f3c18 Compare December 3, 2024 08:05
@aritorto
Copy link
Member Author

aritorto commented Dec 3, 2024

jenkins build this serial please

@aritorto aritorto force-pushed the recoverAddCornerCells branch from 71f3c18 to 7916b3d Compare December 3, 2024 11:49
@aritorto
Copy link
Member Author

aritorto commented Dec 3, 2024

jenkins build this serial please

@aritorto aritorto force-pushed the recoverAddCornerCells branch from 7916b3d to 07c812d Compare December 19, 2024 18:14
@aritorto
Copy link
Member Author

jenkins build this serial please

@lisajulia lisajulia self-requested a review December 20, 2024 15:05
which in particular means that cells that share corners or edges (and not faces) with interior cells are not considered/
seen by the process. Therefore, depending how the LGRs are distributed, there may be "multiple ids" for the same points.*/
seen by the process. Therefore, depending how the LGRs are distributed, there may be "multiple ids" for the same points.
To achieve unique point global ids, IN SOME CASES, we invoke loanBalance( parts, false, true) where parts determines
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: loadBalance

for (int rank = 0; rank < 4; ++rank) {
for (const auto& elemIdx : cells_per_rank[rank]) {
parts[elemIdx] = rank;
}
}
if(grid.comm().size()>1)
{
grid.loadBalance(parts);
grid.loadBalance(parts); // ownerFirst = false, addCornerCells = false, overlapLayerSize =1
// IT's not necessary to change the default values since the LGRs are fully interior.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: It

@@ -397,9 +397,12 @@ void refinePatch_and_check(Dune::CpGrid& coarse_grid,
BOOST_CHECK( static_cast<int>(allGlobalIds_cells.size()) == global_cells_count);
BOOST_CHECK( allGlobalIds_cells.size() == allGlobalIds_cells_set.size() );

/** [Bug] Uniqueness of point global ids cannot be checked in general since current code sets overlap layer size equal to 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

Did I get that right?
We call grid.loadBalance(parts, false, true) with addCornerCells = true to get unique IDs, correct?
Can you add that to the explanation here?
Otherwise I'd merge this PR :)

@lisajulia
Copy link
Contributor

Only minor changes in the documentation 👍

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