[petsc-dev] Cannot reuse matrix of type (null)

Barry Smith bsmith at mcs.anl.gov
Fri Dec 16 07:50:20 CST 2016


  Eric,

    Perhaps you should be using MAT_INPLACE_MATRIX?  

    The documentation is not as clear as it should be on MAT_INPLACE_MATRIX vs MAT_REUSE_MATRIX and it is possible that some implementations of MatConvert_xxx() are broken and do not use this flag properly.

MAT_INPLACE_MATRIX  means replace the input matrix with the matrix of the new type

MAT_REUSE_MATRIX means reuse the matrix that has been passed in as the final value (that matrix must have come from a previous call to MatConvert() with the flag MAT_INITIAL_MATRIX)

  Barry


> On Dec 16, 2016, at 7:43 AM, Stefano Zampini <stefano.zampini at gmail.com> wrote:
> 
> Actually, the matrix type has not yet been set (since you have "null" in your output)
> 
> 2016-12-16 16:43 GMT+03:00 Stefano Zampini <stefano.zampini at gmail.com>:
> Looking at lines 113-115 of master
> 
>  if (reuse == MAT_REUSE_MATRIX) {
>     ierr = PetscObjectTypeCompare((PetscObject)*newmat,MATSEQDENSE,&isseqdense);CHKERRQ(ierr);
>     if (!isseqdense) SETERRQ1(PetscObjectComm((PetscObject)*newmat),PETSC_ERR_USER,"Cannot reuse matrix of type %s",((PetscObject)(*newmat))->type);
>   }
> 
> you are trying to call MatConvert with the reuse flag on a matrix which is not of type SeqDense. Can you provide a MWE to reproduce the problem?
> 
> Thanks,
> Stefano
> 
> 2016-12-16 16:39 GMT+03:00 Eric Chamberland <Eric.Chamberland at giref.ulaval.ca>:
> Another precision: the problem may still be there since dec 15, not tonight...
> 
> Eric
> 
> 
> 
> On 16/12/16 08:30 AM, Eric Chamberland wrote:
> Hi,
> 
> something seems broken with master branch since last night.
> 
> With our nighlty tests, we now have many times this PETSC ERROR:
> 
> [0]PETSC ERROR: Cannot reuse matrix of type (null)
> [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html
> for trouble shooting.
> [0]PETSC ERROR: Petsc Development GIT revision: v3.7.4-2508-ga46e98f GIT
> Date: 2016-12-14 17:44:47 -0600
> [0]PETSC ERROR:
> /pmi/cmpbib/compilation_BIB_gcc_redhat_petsc-master_debug/COMPILE_AUTO/BIB/bin/Test.BIBProblemeGD.dev
> on a arch-linux2-c-debug named compile by Unknown Fri Dec 16 03:06:00 2016
> [0]PETSC ERROR: Configure options --prefix=/opt/petsc-master_debug
> --with-mpi-compilers=1 --with-make-np=12 --with-shared-libraries=1
> --with-mpi-dir=/opt/openmpi-1.10.2 --with-debugging=yes
> --with-mkl_pardiso=1 --with-mkl_pardiso-dir=/opt/intel/composerxe/mkl
> --download-ml=yes --download-mumps=yes --download-superlu=yes
> --download-superlu_dist=yes --download-parmetis=yes
> --download-ptscotch=yes --download-metis=yes --download-suitesparse=yes
> --download-hypre=yes --with-scalapack=1
> --with-scalapack-include=/opt/intel/composerxe/mkl/include
> --with-scalapack-lib="-L/opt/intel/composerxe/mkl/lib/intel64
> -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64"
> --with-blas-lapack-dir=/opt/intel/composerxe/mkl/lib/intel64
> [0]PETSC ERROR: #1 MatConvert_SeqAIJ_SeqDense() line 115 in
> /pmi/cmpbib/compilation_BIB_gcc_redhat_petsc-master_debug/COMPILE_AUTO/petsc-master-debug/src/mat/impls/dense/seq/dense.c
> 
> [0]PETSC ERROR: #2 MatConvert() line 4136 in
> /pmi/cmpbib/compilation_BIB_gcc_redhat_petsc-master_debug/COMPILE_AUTO/petsc-master-debug/src/mat/interface/matrix.c
> 
> 
> 
> With all other PETSc versions we use, with the same tests, we do not
> have this problem.
> 
> Here are the configure/build logs:
> 
> http://www.giref.ulaval.ca/~cmpgiref/petsc-master-debug/2016.12.16.02h00m01s_configure.log
> 
> http://www.giref.ulaval.ca/~cmpgiref/petsc-master-debug/2016.12.16.02h00m01s_make.log
> 
> http://www.giref.ulaval.ca/~cmpgiref/petsc-master-debug/2016.12.16.02h00m01s_RDict.log
> 
> http://www.giref.ulaval.ca/~cmpgiref/petsc-master-debug/2016.12.16.02h00m01s_CMakeLists.txt
> 
> 
> Is it a normal change or is it a bug?
> 
> I can provide more context to help dig into this.
> 
> Thanks,
> 
> Eric
> 
> 
> 
> -- 
> Stefano
> 
> 
> 
> -- 
> Stefano




More information about the petsc-dev mailing list