[petsc-users] MatAYPX for dense and sparse matrices

Alexander Grayver agrayver at gfz-potsdam.de
Mon Mar 21 06:14:30 CDT 2011


Hello!

I have two matrices L and J. L is the sparse with 2 nonzeros per row 
maximum (quite often there are no values in a row at all) and J is the 
dense matrix. I need to add matrix L to matrix J so that:

J = J + L

I try to use:
call MatAYPX(J,one,L,SUBSET_NONZERO_PATTERN,ierr)

Because it seems most obvious and efficient way.

and program crashes with this callstack:
     unknown :: BLASaxpy_
     dense.c :: MatAXPY_SeqDense
      axpy.c :: MatAXPY
      axpy.c :: MatAYPX
      axpyf.c :: MATAYPX
      MODELING_MOD::MODELING

I figured out the only one working combination:
call MatAXPY(LT,one,JT,DIFFERENT_NONZERO_PATTERN,ierr)

But this is very slow and inefficient.

What actually could be done in such a situation?

Thanks in advance.

Regards,
Alexander




More information about the petsc-users mailing list