[petsc-users] AIJ asembly from AIJs

Alp Kalpalp alpkalpalp at gmail.com
Sat Nov 22 16:30:26 CST 2014


Hi,

I am a newby in PetSc but I could not find a solution to my problem. Let me
describbe it to you.I have an SeqAIJ matrix on each processor. These
substructures stiffness matrices should be assembled on a MPIAIJ and they
have overlapping dofs (on boundaries). A is Eigen::SparseMatrix<double> and
my code was as follows;

ierr =
MatCreateSeqAIJWithArrays(PETSC_COMM_SELF,m,n,A.outerIndexPtr(),A.innerIndexPtr(),A.valuePtr(),&subK);CHKERRQ(ierr);
ierr =
MatCreateMPIAIJSumSeqAIJ(PETSC_COMM_WORLD,subK,PETSC_DECIDE,PETSC_DECIDE,MAT_INITIAL_MATRIX,&K);CHKERRQ(ierr);

Suppose I have 2 procs. first have 18x18 sparse mat, second hase 12x12
sparse matrix. Assembled system should be 24x24 for this specific problem.
Above code is wenting to infinite loops. debugger reports that there is a
deadlock on the progman.

So, I searched for a workaroud and I found:

MatCreateMPIAIJWithArrays and this function seems fails when the matrices
has overlapping parts. So that it asembles 30x30 matrix'!!

I check MatCreateMPIAIJ and it seems so costly to form d_nnz etc.

Finally, I tried the MatCreate, MatSetValues procedure, however in here
MatSetValues requires a coordinate list of values not CSR format arrays!!!

So my question is how may I set and MPIAIJ from my (distributed)
overlapping SeqAIJ matrices or preferebly using my CSR arrays directly?

Thanks in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20141123/68e5a64e/attachment.html>


More information about the petsc-users mailing list