I'm using the following sequence of functions related to the Jacobian matrix:

DMDACreate1d(..., &da);
DMSetFromOptions(da);
DMSetUp(da);
DMSetMatType(da, MATAIJKOKKOS);
DMSetMatrixPreallocateSkip(da, PETSC_TRUE);
Mat J;
DMCreateMatrix(da, &J);
MatSetPreallocationCOO(J, ...);

I recently added the call to DMSetMatrixPreallocateSkip, hoping the allocation 
would be delayed to MatSetPreallocationCOO, and that it would require less 
memory. The 
documentation<https://petsc.org/release/manualpages/DM/DMSetMatrixPreallocateSkip/>
 says that the data structures will not be preallocated. The following data 
from heaptrack shows that the allocation is still happening in the call to 
DMCreateMatrix.

[cid:bda9ef12-a46f-47b2-9b9b-a4b2808b6b13]

Can someone help me understand this?

Thanks,

Philip Fackler
Research Software Engineer, Application Engineering Group
Advanced Computing Systems Research Section
Computer Science and Mathematics Division
Oak Ridge National Laboratory

Reply via email to