[petsc-dev] VECCUSP needs to be zeroed?

Lisandro Dalcin dalcinl at gmail.com
Wed Nov 9 13:42:56 CST 2011


On 9 November 2011 16:28, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> On Wed, Nov 9, 2011 at 13:25, Matthew Knepley <knepley at gmail.com> wrote:
>>
>> The simpler answer is yes, I always initialize the Mat or Vec to zero when
>> I use it. Even if its initialized when created,
>> I almost always get something from DMGetGlobalVector() etc. which could
>> have been used before.
>
> Since we keep track of access that could mutate, it would be easy to make
> VecZeroEntries a no-op when the array is already zeroed. (In debug mode, it
> could actually check that the array is still zero.)
> I agree with Matt that you should call VecZeroEntries() when you want to
> rely on the Vec being zeroed.

But then, what's the point of memzeroing in VecCreate_Sec? Wouldn't it
be better to fill the array (in debug mode) with signaling NaNs ?


-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169



More information about the petsc-dev mailing list