[petsc-dev] MatSetFromOptions and help

Stefano Zampini stefano.zampini at gmail.com
Sun Sep 9 04:54:27 CDT 2018


I just noticed a strange behaviour in master. Take mat/examples/ex1.c

./ex1 -h -mat_type mpiaij

does not print the help for the specific MPIAIJ options, only the MPIAIJ
options header

....
Matrix (Mat) options -------------------------------------------------
  -mat_block_size <-1>: Set the blocksize used to store the matrix
(MatSetBlockSize)
  -mat_type <aij>: Matrix type (one of) mffd mpimaij seqmaij maij is shell
composite mpiaij seqaij mpiaijperm seqaijperm seqaijcrl mpiaijcrl mpibaij
seqbaij mpisbaij seqsbaij mpidense seqdense mpiadj scatter blockmat nest
mpisell seqsell preallocator dummy hypre (MatSetType)
  -mat_is_symmetric: Checks if mat is symmetric on MatAssemblyEnd()
(MatIsSymmetric)
  -mat_is_symmetric <0.>: Checks if mat is symmetric on MatAssemblyEnd()
(MatIsSymmetric)
  -mat_null_space_test: <FALSE> Checks if provided null space is correct in
MatAssemblyEnd() (MatSetNullSpaceTest)
  MPIAIJ options
  -mat_new_nonzero_location_err: <FALSE> Generate an error if new nonzeros
are created in the matrix structure (useful to test preallocation)
(MatSetOption)

Instead, if you run e.g. MFFD, it works

Matrix (Mat) options -------------------------------------------------
  -mat_block_size <-1>: Set the blocksize used to store the matrix
(MatSetBlockSize)
  -mat_type <aij>: Matrix type (one of) mffd mpimaij seqmaij maij is shell
composite mpiaij seqaij mpiaijperm seqaijperm seqaijcrl mpiaijcrl mpibaij
seqbaij mpisbaij seqsbaij mpidense seqdense mpiadj scatter blockmat nest
mpisell seqsell preallocator dummy hypre (MatSetType)
  -mat_is_symmetric: Checks if mat is symmetric on MatAssemblyEnd()
(MatIsSymmetric)
  -mat_is_symmetric <0.>: Checks if mat is symmetric on MatAssemblyEnd()
(MatIsSymmetric)
  -mat_null_space_test: <FALSE> Checks if provided null space is correct in
MatAssemblyEnd() (MatSetNullSpaceTest)
Matrix-free Finite Differencing (MatMFFD) options
-------------------------------------------------
  -mat_mffd_type <(null)>: Matrix free type (one of) ds wp (MatMFFDSetType)
  -mat_mffd_err <1.49012e-08>: set sqrt relative error in function
(MatMFFDSetFunctionError)
  -mat_mffd_period <1>: how often h is recomputed (MatMFFDSetPeriod)
  -mat_mffd_check_positivity: <FALSE> Insure that U + h*a is nonnegative
(MatMFFDSetCheckh)
  -mat_new_nonzero_location_err: <FALSE> Generate an error if new nonzeros
are created in the matrix structure (useful to test preallocation)
(MatSetOption)
  -mat_new_nonzero_allocation_err: <FALSE> Generate an error if new
nonzeros are allocated in the matrix structure (useful to test
preallocation) (MatSetOption)

What is the proper fix? remove the PetscOptionsBegin call and replace
PetscOptionsEnd() with PetscOptionsTail()?

-- 
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20180909/c24ba64d/attachment.html>


More information about the petsc-dev mailing list