On Thu, Dec 14, 2023 at 2:06 PM Fackler, Philip via petsc-users < [email protected]> wrote:
> 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. > You are completely correct. DMDA is just ignoring this flag. We will fix it. Thanks for catching this. Matt > The following data from heaptrack shows that the allocation is still > happening in the call to DMCreateMatrix. > > > 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* > -- What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead. -- Norbert Wiener https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
