I really like "const" usage, but isn't this too much?

Lisandro Dalcin dalcinl at gmail.com
Wed Dec 3 19:55:21 CST 2008


Done, see below

[dalcinl at botafogo petsc-dev]$ hg log -r 13064
changeset:   13064:733a706c5f5b
user:        Lisandro Dalcin <dalcinl at gmail.com>
date:        Wed Dec 03 20:00:58 2008 -0300
summary:     smarter VecPlaceArray/VecResetArray

[dalcinl at botafogo petsc-dev]$ hg backout -r 13064
reverting src/vec/vec/impls/mpi/pbvec.c
reverting src/vec/vec/impls/seq/dvec2.c
created new head
changeset 13068:a00a16279084 backs out changeset 13064:733a706c5f5b
the backout changeset is a new head - do not forget to merge
(use "backout --merge" if you want to auto-merge)

[dalcinl at botafogo petsc-dev]$ hg merge
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)

[dalcinl at botafogo petsc-dev]$ hg commit -m 'merge'

On Wed, Dec 3, 2008 at 10:43 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>   Sorry, I don't know how to revert something that has been pushed.
> Can someone do it who has a brain?
>
>   Barry
>
> On Dec 3, 2008, at 7:41 PM, Lisandro Dalcin wrote:
>
>> Barry, please revert the commit, I'll try to re-review this tomorrow.
>> I'm goin to bed.
>>
>> On Wed, Dec 3, 2008 at 10:40 PM, Lisandro Dalcin <dalcinl at gmail.com>
>> wrote:
>>>
>>> Barry, are you talking about Vec's of local size zero? Damn me! I
>>> completelly forgot this case... But then, will not it be better to
>>> check and special case zero local sizes ??
>>>
>>> On Wed, Dec 3, 2008 at 10:37 PM, Lisandro Dalcin <dalcinl at gmail.com>
>>> wrote:
>>>>
>>>> On Wed, Dec 3, 2008 at 9:17 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>>>>>
>>>>>  That is wierd; it seems strange that it would even compile.
>>>>
>>>> OK, I'll try to review all this tomorrow, there are some other weird
>>>> Vec calls with such "const".
>>>>
>>>>>  BTW: I think your new change
>>>>> 7 - v->unplacedarray = v->array; /* save previous array so reset can
>>>>> bring
>>>>> it back */ 8
>>>>> - v->array = (PetscScalar *)a; 9 +
>>>>> if (a) { 10 + v->unplacedarray = v->array; /* save previous array so
>>>>> reset
>>>>> can bring it back */ 11
>>>>> + v->array = (PetscScalar *)a; 12 + }
>>>>> is TOTALLY wrong.
>>>>
>>>> You see, I should never push before commenting :-(
>>>>
>>>>> It is perfectly legitimate to place null arrays and one
>>>>> wants
>>>>> them to behave just like regular place arrays (saving the previous
>>>>> array).
>>>>
>>>> What's the use case? This is used internally in PETSc? I do not
>>>> remember...
>>>>
>>>>> Why did you make this change and what was wrong with the way it was?
>>>>
>>>> Do you mean that it is legitimate taht if a user makes the nasty bug
>>>> of calling VecPlaceArray(x,ptr) with ptr being NULL, then next he/she
>>>> will get a nasty segfault when calling Vec operations (let say,
>>>> VecMax()) ???
>>>>
>>>> Barry, feel free to revert the changeset. Anyway, please let me know
>>>> the rationale for this "feature", I still do not get it...
>>>>
>>>>
>>>>>
>>>>> Barry
>>>>>
>>>>>
>>>>> On Dec 3, 2008, at 4:45 PM, Lisandro Dalcin wrote:
>>>>>
>>>>>> VecPlaceArray(Vec vec,const PetscScalar array[])
>>>>>> VecReplaceArray(Vec vec,const PetscScalar array[])
>>>>>>
>>>>>> --
>>>>>> Lisandro Dalcín
>>>>>> ---------------
>>>>>> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
>>>>>> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
>>>>>> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
>>>>>> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
>>>>>> Tel/Fax: +54-(0)342-451.1594
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Lisandro Dalcín
>>>> ---------------
>>>> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
>>>> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
>>>> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
>>>> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
>>>> Tel/Fax: +54-(0)342-451.1594
>>>>
>>>
>>>
>>>
>>> --
>>> Lisandro Dalcín
>>> ---------------
>>> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
>>> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
>>> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
>>> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
>>> Tel/Fax: +54-(0)342-451.1594
>>>
>>
>>
>>
>> --
>> Lisandro Dalcín
>> ---------------
>> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
>> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
>> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
>> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
>> Tel/Fax: +54-(0)342-451.1594
>>
>
>



-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594




More information about the petsc-dev mailing list