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

Fix mean computation for zero sized ranks #1632

Open greole opened 4 days ago

greole commented 4 days ago

This PR makes sure to not divide by zero when calculating the mean of a distributed vector. This otherwise might occur if some ranks hold a local vector of length zero after repartitioning a matrix or vector.