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

Comments/Documentation for New Ghosting Architecture #3189

Merged

Conversation

ryar9534
Copy link
Contributor

Companion to #3063 where I have added comments as I have walked through the new ghosting code

@ryar9534 ryar9534 self-assigned this Jun 26, 2024
@ryar9534 ryar9534 linked an issue Jun 26, 2024 that may be closed by this pull request
23 tasks
@TotoGaz
Copy link
Contributor

TotoGaz commented Jun 26, 2024

Are you sure you do not want to merge into #3063 instead?

@ryar9534 ryar9534 changed the title Comments / Documentation for New Ghosting Architecture Comments/Documentation for New Ghosting Architecture Jun 26, 2024
@ryar9534 ryar9534 changed the base branch from develop to feature/TotoGaz/newGhosting June 26, 2024 22:56
@@ -219,6 +225,8 @@ FaceMgrImpl makeFlavorlessFaceMgrImpl( std::size_t const & numFaces,
toFlavorlessMapping( recv ) );
}

// Function to create a nodeManager from our local upward mapping data
// By flavorless, we are indicating that we are changing data-structures to GEOS ones, etc
Copy link
Contributor

Choose a reason for hiding this comment

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

flavorless is there to emphasize that we're no more using the strongly typed integers and fallback to localIndex and globalIndex.

FaceInfo const & faceInfo = faces[i];
ind[i] = convert.fromFaceGlbIdx( faceInfo.index );

// Encode data with a single int like above, but now int tells us start_node, direction (flipped), and position of face in cell
// in this case v = 1 + (isFlipped*numFaces + start_index)*numFaces + index_in_cell (again add 1 so that zero indexing becomes 1 indexing)
Copy link
Contributor

Choose a reason for hiding this comment

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

We add one to be sure it's never 0 and is always "visible" and never "optimized out".

auto const ownedMap = make_rcp< TriMap const >( Tpetra::global_size_t( n ), ownedGlbIdcs.data(), TriLocIdx( numOwned ), TriGlbIdx{ 0 }, comm );

// The `upward` matrix offers a representation of the graph connections.
// The matrix is square. Each size being the number of geometrical entities.
// The matrix is just the assembed, global adjacency.
// Note that the matrix will end up being lower triangular, and banded because edge rows only have nonzeros in the node columns, faces only have nonzeros with edges, etc
Copy link
Contributor

Choose a reason for hiding this comment

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

In fact, it's lower triangular for "std" meshes. This may become different with fractures and cell to cell dependencies e.g..

auto const ownedMap = make_rcp< TriMap const >( Tpetra::global_size_t( n ), ownedGlbIdcs.data(), TriLocIdx( numOwned ), TriGlbIdx{ 0 }, comm );

// The `upward` matrix offers a representation of the graph connections.
// The matrix is square. Each size being the number of geometrical entities.
// The matrix is just the assembed, global adjacency.
// Note that the matrix will end up being lower triangular, and banded because edge rows only have nonzeros in the node columns, faces only have nonzeros with edges, etc
// Quick note on why we call it upward:
Copy link
Contributor

Choose a reason for hiding this comment

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

You can change the name. Like dependencies and dependents?

// - The number of rows is the total number of graph nodes that are missing on ranks.
// For me this was confusing, as its a little different from what we've done before
Copy link
Contributor

@TotoGaz TotoGaz Jul 1, 2024

Choose a reason for hiding this comment

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

We could have handled it with direct MPI communications instead of using linear algebra. Same for the node positions. Up to you.

@ryar9534 ryar9534 marked this pull request as ready for review July 3, 2024 17:47
@ryar9534 ryar9534 merged commit 7058cb3 into feature/TotoGaz/newGhosting Jul 3, 2024
8 of 11 checks passed
@ryar9534 ryar9534 deleted the feature/TotoGaz/newGhosting_ryan branch July 3, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rearchitecture of the ghosting setup
2 participants