ginkgo-project / ginkgo

Numerical linear algebra software package
https://ginkgo-project.github.io/
BSD 3-Clause "New" or "Revised" License
384 stars 86 forks source link

Add a uniform coarse generation algorithm #1526

Open pratikvn opened 5 months ago

pratikvn commented 5 months ago

This PR is an updated version of #979 . The idea is to have a very cheap coarse grid generation algorithm that works well for matrices that are uniform, for example, matrices that arise from stencils on structured grids.

For example, for a 7 point stencil on a 3D grid, it is very competitive to PGM (with_deterministic=false) with much faster generation and faster apply for larger problems (on OMP executor with 8 cores):

unif_pgm

sonarcloud[bot] commented 5 months ago

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

44 New issues
1 Security Hotspot
66.4% Coverage on New Code
2.0% Duplication on New Code

See analysis details on SonarCloud

codecov[bot] commented 5 months ago

Codecov Report

Attention: Patch coverage is 97.64310% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 89.78%. Comparing base (fb70ec0) to head (0537b1e). Report is 232 commits behind head on develop.

:exclamation: Current head 0537b1e differs from pull request most recent head 915e227. Consider uploading reports for the commit 915e227 to get more accurate results

Files Patch % Lines
...ence/test/multigrid/uniform_coarsening_kernels.cpp 96.32% 5 Missing :warning:
core/device_hooks/common_kernels.inc.cpp 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1526 +/- ## =========================================== - Coverage 91.04% 89.78% -1.27% =========================================== Files 700 707 +7 Lines 56996 57487 +491 =========================================== - Hits 51894 51612 -282 - Misses 5102 5875 +773 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

upsj commented 5 months ago

Especially focusing on distributed, I think if we include this, we should try to support at least 2D and maybe 3D coarsening (i + n * j and i + n * j + k * n * m).

MarcelKoch commented 5 months ago

Maybe it makes sense to split the UniformCoarsening class up. The generated object essentially stores an array with coarse row indices, so it seems natural to allow users to pass in these indices. But I don't think we can add a parameter to the existing class, since then there would be two mutually exclusive parameters. I think Tobias' approach for the direct solvers, i.e. having multiple factories that generate the same class makes sense here.

sonarcloud[bot] commented 2 months ago

Quality Gate Passed Quality Gate passed

Issues
44 New issues
0 Accepted issues

Measures
1 Security Hotspot
66.4% Coverage on New Code
2.0% Duplication on New Code

See analysis details on SonarCloud