[petsc-users] set petsc matrix using input array

Jed Brown jed at jedbrown.org
Thu Jan 9 14:02:08 CST 2020


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 single assembled matrix, so copying (which is done
before preconditioner setup) may not increase the peak memory usage
(which is all that matters for capability).

"Smith, Barry F. via petsc-users" <petsc-users at mcs.anl.gov> writes:

>   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 <sam.guo at cd-adapco.com> wrote:
>> 
>> 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


More information about the petsc-users mailing list