hypre-space / hypre

Parallel solvers for sparse linear systems featuring multigrid methods.
https://www.llnl.gov/casc/hypre/
Other
674 stars 185 forks source link

Matrices with zero diagonal entries in `hypre_ParCSRTMatMatKTDevice` #1097

Open v-dobrev opened 4 months ago

v-dobrev commented 4 months ago

I ran into the following issue while running tests in MFEM with HYPRE built with CUDA and --enable-debug: the hypre_assert in hypre_ParCSRTMatMatKTDevice, here: https://github.com/hypre-space/hypre/blob/0dcae3ec7c069785ea25d25aa0bc0c7aa8b0be8d/src/parcsr_mv/par_csr_triplemat_device.c#L604

fails when the diagonal block of C has zero entries on the diagonal which are not present in the sparsity pattern and the row still contains other non-zero entries. If the row is empty, i.e. there are no entries in the sparsity pattern of the row, then the check does not fail. On the other hand, the call that aims to put the diagonal entries first: https://github.com/hypre-space/hypre/blob/0dcae3ec7c069785ea25d25aa0bc0c7aa8b0be8d/src/parcsr_mv/par_csr_triplemat_device.c#L581 works fine in this case -- it just ignores the rows that do not contain a diagonal entry.

This is a special case, however, I think it will be better to not generate an error for this in debug mode. What do you think?

liruipeng commented 4 months ago

I agree. We probably want to remove this assertion.