I implemented scalable MatPtAP and did comparisons of three implementations using ex56.c on alcf cetus machine (this machine has small memory, 1GB/core):- nonscalable PtAP: use an array of length PN to do dense axpy
- scalable PtAP: do sparse axpy without use of PN array
- hypre PtAP.
The results are attached. Summary:
- nonscalable PtAP is 2x faster than scalable, 8x faster than hypre PtAP
- scalable PtAP is 4x faster than hypre PtAP
Based on above observation, I set the default PtAP algorithm as 'nonscalable'.
When PN > local estimated nonzero of C=PtAP, then switch default to 'scalable'.
User can overwrite default.
MatPtAP 3.6224e+01 (nonscalable for small mats, scalable for larger ones)
scalable MatPtAP 4.6129e+01
hypre 1.9389e+02
This work in on petsc-master. Give it a try. If you encounter any problem, let me know.