[petsc-dev] Adding support memkind allocators in PETSc

Barry Smith bsmith at mcs.anl.gov
Wed Apr 29 15:08:11 CDT 2015


> On Apr 28, 2015, at 10:44 PM, Jed Brown <jed at jedbrown.org> wrote:
> 
> Barry Smith <bsmith at mcs.anl.gov> writes:
>>  The special malloc would need to save the locations at which it set
>>  the addresses and then switch the address to NULL. Then the code
>>  that used those locations would have to know that they that they may
>>  be set to NULL and hence check them before use.
> 
> And then PetscMalloc(...,&tmp); foo->data = tmp; creates SEGV at some
> unpredictable time.  Awesome!

   Obviously it is a controlled malloc that has to be used properly. If you know that you are getting some unreliable location you cannot do this type of code, nor would you. And since we are using the malloc in our code and users rarely need to use.

> 
>>  I am not saying this particular thing would be practical or not,
>>  just that if we had a concept of a malloc context for each malloc
>>  there are many games we could try that we couldn't try otherwise and
>>  this is just one of them.
> 
> I'm not convinced, except in the case of mixing in madvise hints.




More information about the petsc-dev mailing list