Problem with with convert for inplace conversion

Issue #117 closed
Benoit NENNIG created an issue

Hi, I observe that the Mat.convert method does not behave as I would expected for inplace conversion.

#Create the Nested Matrix
C=PETSc.Mat().createNest([[A, A], [None, 2*A]])
C.convert(mat_type=PETSc.Mat.Type.AIJ)  # fails

It seems not possible to rewrite the matrix inplace (except with mpirun -n 1). However the synthax

B=PETSc.Mat()
C.convert(PETSc.Mat.Type.AIJ,B) 

with an auxiliary B matrix works fine.

Sorry if it is due to a misconception, but inplace conversion work fine with transpose and both methods seem to share the same interface with 'reuse' and MAT_INPLACE_MATRIX

C.transpose() # Ok!

info : petsc4py, Version: 3.9.0, arch-linux2-c-optim, complex

Benoit

Comments (6)

  1. Lisandro Dalcin

    This is not a petsc4py issue. It seems that MatConvert() for MATNEST with reuse=MAT_INPLACE_MATRIX is not supported in core PETSc.

    @BarryFSmith @jedbrown @stefano_zampini What should we do about it?

  2. Jed Brown

    It needs to be implemented. I think it's pretty easy, but I don't have any free cycles for at least a week or two.

  3. Log in to comment