[petsc-users] Flexiable AIJ matrix for nonzeros -- hash table version

Gong Ding gdiso at ustc.edu
Mon May 9 04:04:24 CDT 2011


Hi
I created a flexible AIJ matrix type –named as FAIJ. It has an extra hash table for nonzero which do not have pre-allocated position. And the buffered values in hash table will be flushed to AIJ array at MatAssemblyEnd. Both sequential and parallel version have been implemented and tested.

The test results show that for middle size problem – matrix size around 1M, FAIJ without any pre-allocation still pretty fast. The shortcoming is memory overkill exists. Fortunately, modern computers have larger and larger memory.  User with FAIJ matrix only needs to provide approximate nonzero pattern or even skip this step. 

However, direct solvers such as mumps and superlu_dist will crash. This is caused by type compare functions, i.e.:
ierr = PetscTypeCompare((PetscObject)A,MATMPIAIJ,&isAIJ);CHKERRQ(ierr);
FAIJ matrix is derived from AIJ, but it has its own type name, i.e. MATMPIFAIJ. The above function will assign isAIJ false.

Is there any function like “PetscBaseType” exist?  FAIJ matrix can hold its type name as well as its base type name. 

I hope FAIJ can be accepted by petsc 3.2. 
Thanks.

Gong Ding







More information about the petsc-users mailing list