Re: [petsc-users] set petsc matrix using input array

2020-01-09 Thread Jed Brown
Note that PETSc's formats are more space-efficient and faster than the COO (triplet) format. If you can produce triplet chunks instead of the full matrix, you can add them incrementally to reduce the peak memory usage. Note that many preconditioners use storage similar to (or greater than) a

Re: [petsc-users] set petsc matrix using input array

2020-01-09 Thread Smith, Barry F. via petsc-users
Since PETSc does not use that format there, of course, has to be a time when you have duplicate memory. Barry > On Jan 9, 2020, at 12:47 PM, Sam Guo wrote: > > Dear PETSc dev team, >Suppose I have the matrix already in triplet format int int[] I, int[] J, > double[] A, Is

[petsc-users] set petsc matrix using input array

2020-01-09 Thread Sam Guo
Dear PETSc dev team, Suppose I have the matrix already in triplet format int int[] I, int[] J, double[] A, Is possible to create petsc matrix using A without copying? I like to avoid the duplicate memory if possible. Thanks, Sam