[petsc-users] Flexiable AIJ matrix for nonzeros -- hash table version
Lisandro Dalcin
dalcinl at gmail.com
Mon May 9 18:07:35 CDT 2011
2011/5/9 Gong Ding <gdiso at ustc.edu>:
> 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.
>
Great!! Have you thought about extending regular AIJ matrices to use a
hash table on first assembly (perhaps activated with an option) and
switch back to regular assembly for the next assemblies? I'm assuming
here that calls to MatSetValues() fill the hash table even if values
are zero.
> 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.
>
How did you wrote your hash table? What are the keys and values? Are
you using a hash table per row? Or it is actuallyan (i,j)->a hash
table?
> 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.
>
That's the reason I think that adding this feature to regular AIJ
matrices could be better.
> 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.
>
I think Satish pushed something related to this a few days ago...
--
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
More information about the petsc-users
mailing list