[petsc-dev] MatSetFromOptions and help

Stefano Zampini stefano.zampini at gmail.com
Mon Sep 10 08:03:50 CDT 2018


Barry,

here you have
https://bitbucket.org/petsc/petsc/commits/7c3a40483278f70c2b57435a9cd2a737a2fb0f1a?at=master
The commit is in a larger PR that I hope it can make it for the release
https://bitbucket.org/petsc/petsc/pull-requests/1113/few-fixes-before-the-release/diff

Il giorno dom 9 set 2018 alle ore 21:03 Stefano Zampini <
stefano.zampini at gmail.com> ha scritto:

> mat/examples/tests/ex1.c
>
> Yes, it raises an error for the matrix types aij and mffd, but the -h
> output is still relevant. I'll open a PR tomorrow
>
>
>
> Il Dom 9 Set 2018, 21:00 Smith, Barry F. <bsmith at mcs.anl.gov> ha scritto:
>
>>
>>
>> > On Sep 9, 2018, at 4:54 AM, Stefano Zampini <stefano.zampini at gmail.com>
>> wrote:
>> >
>> > I just noticed a strange behaviour in master. Take mat/examples/ex1.c
>>
>>    There is no such example and the examples in the tutorials and tests
>> subdirectories don't work with the given arguments so where is this example?
>>
>>
>> >
>> > ./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
>>
>>

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


More information about the petsc-dev mailing list