[petsc-users] [PETSc-Users] The MatSetValues takes too much time

Matthew Knepley knepley at gmail.com
Thu May 2 06:59:32 CDT 2019


There is also a manual section on doing this.

  Thanks,

     Matt

On Thu, May 2, 2019 at 7:57 AM Mark Adams via petsc-users <
petsc-users at mcs.anl.gov> wrote:

> You need to set the preallocation for the matrix.
>
>
> https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMPIAIJSetPreallocation.html
>
> On Thu, May 2, 2019 at 7:46 AM Dongyu Liu via petsc-users <
> petsc-users at mcs.anl.gov> wrote:
>
>> Hi,
>>
>> I am using PETSc sparse matrix ('aij') for a FEM program, when the
>> matrix is really big, let's say 1million by 1million, we use setValues
>> based on the index vector I and J, but the whole process takes around 2
>> hours.
>>
>> I don't know why it is like that, or is there any option that I should
>> set to make this faster?
>>
>>
>> Best,
>>
>> Dongyu
>>
>>

-- 
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/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190502/e66df73e/attachment.html>


More information about the petsc-users mailing list