-
Notifications
You must be signed in to change notification settings - Fork 471
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
Hypre matrix reader fixes #4310
Conversation
…ad with HypreParMatrix::Read_IJMatrix
…:Read_IJMatrix This ensures that the MemoryIJData is set up properly. Otherwise, many operations will crash because Read(), HostRead(), HypreRead() will not work properly.
If the owned rows and columns are the same, the block is diagonal, and the matrix is reordered so that the diagonal entry comes first. Previously this was done by checking pointer equality, which may have false negatives.
linalg/hypre.cpp
Outdated
@@ -1266,8 +1266,20 @@ HypreParMatrix::HypreParMatrix(MPI_Comm comm, int nrows, | |||
} | |||
|
|||
// Copy in the row and column partitionings | |||
const bool rows_eq_cols = [rows,cols,part_size]() |
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.
It is best to MPI_Allreduce
this value with logical AND, i.e. this Boolean means that the partitionings are globally equal -- this way all ranks will make the same decisions in the following code.
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.
OK, done in 8be0dee.
The logic for only comparing the |
This ensures the same decision is made across all ranks
Create new static functions GetPartitioningArraySize and RowAndColStartsAreEqual.
I did this in 8da512d. The logic for computing the size of the partitioning arrays was also repeated in a couple places, there is now a helper function |
This PR is now under review (see the table in the PR description). To help with the review process, please do not force push to the branch. |
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.
Thanks @pazner !
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.
Looks good to me. Thanks @pazner
Thanks, @liruipeng. BTW, is there any update on hypre-space/hypre#168? Is |
Merged in |
This PR has some small fixes and changes to HypreParMatrix. In particular, it fixes an issue with
HypreParMatrix::Read_IJMatrix
not setting up theMemoryIJData
properly.Specific changes:
WrapHypreParCSRMatrix
inHypreParMatrix::Read
andHypreParMatrix::Read_IJMatrix
(bug fix)HypreParMatrix::Print
should be read withHypreParMatrix::Read_IJMatrix
HypreParMatrix
constructorconst std::string&
instead ofconst char*
in some Hypre APIsPR Checklist
make style
.CHANGELOG
:CHANGELOG
to group with other related features?INSTALL
:make
orcmake
have a new target?.github
.appveyor.yml
.gitignore
:make distclean; git status
shows any files that were generated from the source by the project (not an IDE) but we don't want to track in the repository.examples/makefile
:SEQ_EXAMPLES
andPAR_EXAMPLES
variables.clean
target..gitignore
file.examples/CMakeLists.txt
:ALL_EXE_SRCS
variable.THIS_TEST_OPTIONS
is set correctly for the new example.doc/CodeDocumentation.dox
.examples/pumi
), list it indoc/CodeDocumentation.conf.in
src/examples.md
.src/examples.md
andsrc/img
.examples.md
, list the example under the appropriate categories, add new categories if necessary.features.md
.makefile
andmakefile
in corresponding miniapp directory..gitignore
file.CMakeLists.txt
file in theminiapps
directory, if the new miniapp is in a new directory.CMakeLists.txt
file in the new miniapp directory.doc/CodeDocumentation.dox
miniapps/nurbs
), add it toMINIAPP_SUBDIRS
in themakefile
.miniapps/nurbs
), list it indoc/CodeDocumentation.conf.in
src/meshing.md
andsrc/electromagnetics.md
files.src/examples.md
andsrc/img
.features.md
.mfem/web
repo.README
(rare).doc/CodeDocumentation.dox
(rare).make unittest
to make sure all unit tests pass.tests/scripts
.