[petsc-dev] why does this inanity exist?

Jed Brown jed at jedbrown.org
Sun Apr 30 15:19:57 CDT 2017


Proposal: add ts->default_adapt_type.  TSCreate_* sets this.  Remove
TSGetAdapt from TSCreate and move it to TSSetUp and TSSetFromOptions.
Make TSGetAdapt call TSAdaptSetType(adapt,ts->default_adapt_type).  Now
there is no "setbyuser", but TS implementations can select their
preferences and those will be ignored if the user calls TSGetAdapt and
changes it themselves.  And -ts_adapt_type none always works.

Barry Smith <bsmith at mcs.anl.gov> writes:

>> On Apr 30, 2017, at 12:53 PM, Lisandro Dalcin <dalcinl at gmail.com> wrote:
>> 
>> On 30 April 2017 at 19:09, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>> 
>>>> On Apr 30, 2017, at 8:39 AM, Lisandro Dalcin <dalcinl at gmail.com> wrote:
>>>> 
>>>> On 30 April 2017 at 05:53, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>>>> TS already had mechanisms to turn on or off adaptivity (presumably) so why would an individual type need to reproduce this functionality except to drive users insane?
>>>> 
>>>> We do not have a clear mechanism for a TS subtype to decide on whether
>>>> adaptivity should be turn on or off by default. The rationale to turn
>>>> it off by default are more or less described in other related email:
>>>> the error estimator is bad quality (or lower order than the one of the
>>>> LTE of the method).
>>> 
>>>   Why isn't the default just switched when the subtype (with a bad adapter) is selected by the user?
>>> 
>>>   The reason is that the user may have already manually turned on the adapter and you don't want PETSc switching it secretly later?
>>> 
>> 
>> Yes, indeed. We have the usual fight between explicit API calls in
>> code interacting with SetType() and SetFromOptions().
>> 
>> However, after my refactoring of TSAdapt, maybe we are closer to get
>> something that works better.
>> 
>> 
>>>   Do we need then to have a flag in TS - adaptsetbyuser? and only change the default if that flag is not on?
>>> 
>>>   I prefer not to have setbyuser flags in PETSc but sometimes it seems we cannot live without them.
>>> 
>> 
>> I don't like any setbyuser flags either.
>> 
>>>> 
>>>> Please note that THETA and ALPHA do use the standard TSAdapt
>>>> infrastructure, the only thing this "use adapt" flag does is to turn
>>>> it off by default. If you consider it appropriate, I can remove all
>>>> that code for the "use adapt" flag in THETA and ALPHA, users can then
>>>> turn off adaptivity with `-ts_adapt_type none`.
>>> 
>>>   Yes, I don't understand why users should not just use -ts_adapt_type none.
>>> 
>> 
>> These "use adapt" flags were just an attempt to not surprise users
>> with TSTHETA changing previous behavior. However, as the error
>> estimator is very conservative, I don't really see a problem with
>> having adaptivity on by default in THETA and ALPHA.
>> 
>> So Barry, if you are for it, and Jed has no objections, I can fire a
>> PR tomorrow removing these crappy "use adapt flags" in favor of  the
>> -ts_adapt_type approach.
>
>    Yes. 
>
>    
>
>> 
>> @Stefano, this should fix for good your previous complaints/questions
>> about "How do I turn on adaptivity on these methods?".
>> 
>> -- 
>> Lisandro Dalcin
>> ============
>> Research Scientist
>> Computer, Electrical and Mathematical Sciences & Engineering (CEMSE)
>> Extreme Computing Research Center (ECRC)
>> King Abdullah University of Science and Technology (KAUST)
>> http://ecrc.kaust.edu.sa/
>> 
>> 4700 King Abdullah University of Science and Technology
>> al-Khawarizmi Bldg (Bldg 1), Office # 0109
>> Thuwal 23955-6900, Kingdom of Saudi Arabia
>> http://www.kaust.edu.sa
>> 
>> Office Phone: +966 12 808-0459
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170430/c881de61/attachment.sig>


More information about the petsc-dev mailing list