-
Notifications
You must be signed in to change notification settings - Fork 576
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
Issue 4283: refactor muelu to not use dynamic profile when declaring crsgraph #4411
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -249,7 +249,7 @@ namespace MueLu { | |
myGraph = CrsGraphFactory::Build(rowMap, | ||
colMap, | ||
nnzOnRow, | ||
Xpetra::DynamicProfile); | ||
Xpetra::StaticProfile); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lucbv should really comment on this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My feeling is: this should be fine, the graph constructor actually allocates the exact amount of memory it needs since nnzOnRow is specified. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @lucbv :-) |
||
|
||
*out << "Fill CrsGraph" << std::endl; | ||
LO rowIdx = 0; | ||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -134,7 +134,7 @@ namespace MueLu { | |||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
// 3) create graph of amalgamated matrix | ||||||||||||||||||
RCP<CrsGraph> crsGraph = CrsGraphFactory::Build(nodeMap, 10, Xpetra::DynamicProfile); | ||||||||||||||||||
RCP<CrsGraph> crsGraph = CrsGraphFactory::Build(nodeMap, A->getNodeMaxNumRowEntries()*blockdim, Xpetra::StaticProfile); | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See note above. Can MueLu actually call Isorropia with a Tpetra matrix? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, MueLu will throw. See Trilinos/packages/muelu/src/Rebalancing/MueLu_IsorropiaInterface_def.hpp Lines 216 to 223 in 5c9a2ec
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jhux2 Thanks for the clarification! It's probably better for even the Epetra-based code to use StaticProfile, as long as it has good bounds for each row. |
||||||||||||||||||
|
||||||||||||||||||
// 4) do amalgamation. generate graph of amalgamated matrix | ||||||||||||||||||
for(LO row=0; row<Teuchos::as<LO>(A->getRowMap()->getNodeNumElements()); row++) { | ||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code might run fine, but it could blow out memory if one row happens to have many more entries than other rows. Once we make this change, we may also want to duplicate the loop below, once to get a number of entries in each row (it looks like the loop is amenable to that), and once again to fill the CrsGraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhoemmen That's a good suggestion, I'll push an update.