One way to boost performance [of MatVec etc] in sparse matrices with blocks is by avoiding loading (from memory to cpu registers) of row/col indices for the blocks - when possible. [the performance boost here come by the fact that the memory bandwidth requirements get reduced]
So we have BAIJ matrix - where only one row,col value is used for a block of values. And as you've noted - this format requires a fixed block size for the entire matrix. Alternative support in PETSc is within AIJ matrix (enabled by default) - where it scans consecutive rows - to see if they share the same column values (i.e inodes) - and reuses them for these rows. A matrix with varying blocks might benefit from this. To check - for ex: [balay@pj01 tutorials]$ ./ex10 -f0 ~/datafiles/matrices/cfd.2.10 -f1 ~/datafiles/matrices/cfd.2.10 -info |grep -i inode [0] <mat> MatSeqAIJCheckInode(): Found 24576 nodes of 122880. Limit used: 5. Using Inode routines [0] <mat> MatSeqAIJCheckInode(): Found 24576 nodes of 122880. Limit used: 5. Using Inode routines Satish On Mon, 24 Jul 2023, Daniel Stone wrote: > Hello PETSc Users/Developers, > > A collegue of mine is looking into implementing an adaptive implicit method > (AIM) over > PETSc in our simulator. This has led to some interesting questions about > what can > be done with blocked matrices, which I'm not able to answer myself - does > anyone have > any insight? > > Apparently it would be ideal if we could find a matrix (and vector) type > that supports a kind > of mixed block size: > > "For AIM [...] we will have matrix elements of various shapes: 1x1, 1xN, > Nx1 and NxN. [...]. The solution and residual will be a mix of 1 and N > variable/cell block" > > There are ideas for how to implement what we want using the > fixed-block-size objects we > understand well, but if anything like the above exists it would be very > exciting. > > > Thanks, > > Daniel >