Skip to content

Add lazy/just-in-time updating of internal data structures for MATMPIKAIJ matrices

This MR fixes an issue encountered by @caidao22 in his implicit Runge Kutta code (!2901 (merged)) with MPIKAIJ matrices, when updates to the AIJ matrix did not result in expected updates to the internal data structures (the AIJ and OAIJ sequential KAIJ matrices). We now track the object state of the AIJ matrix and update AIJ and OAIJ in a lazy/just-in-time fashion before they are used if the object state has changed. This MR also introduces an internal routine, MatKAIJ_build_AIJ_OAIJ(), that is used for this update and also inside MatSetUp_KAIJ().

I was unsure if this MR should be a fix that goes into release or something that goes into main. I decided on the latter because the current behavior of MPIKAIJ has been in PETSc since the 3.12 release (and I have noted the changed behavior in the changes/dev.rst file), but I could be convinced that this should go into release.

Merge request reports