[petsc-users] Various Questions Regarding PETSC

Mohammed Mostafa mo7ammedmostafa at gmail.com
Sun Jul 21 00:11:14 CDT 2019


Hello
> Is there any reason to use ADD_VALUES? Since you need to insert each value for an individual column/row exactly once?
> 
>   In the timings you sent did you zero the matrix before? Does it make a difference in the timing for setting values into there matrix?
I don’t need to use add values and In all previous emails it is only used once for the sake testing and as a result I use it with MatZeroEntries 
It costs more time but only very small but MatZeroEntries is what costs some time 
>> With InsertValues
>> FillMAT_with_MatSetValues     100 1.0 2.5512e+00 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 16  0  0  0  0  93  0  0  0  0     0
>> WithAddValues
>> FillPetscMat     100 1.0 2.6654e+00 1.0 7.44e+07 1.0 0.0e+00 0.0e+00 0.0e+00 17 53  0  0  0  90100  0  0  0   167
>> Additionally I have to zero the matrix which costs
>> MatZeroEntries       100 1.0 9.5259e-02 1.2 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00  1  0  0  0  0   3  0  0  0  0     0
>>  INSERT_VALUES is abit faster than ADD_VALUES the difference I saw can be attributed to the cost computation ( addition)
Regards,
Mohamed M. Kamra

> On Jul 21, 2019, at 12:05 PM, Smith, Barry F. <bsmith at mcs.anl.gov> wrote:
> 
> Is there any reason to use ADD_VALUES? Since you need to insert each value for an individual column/row exactly once?
> 
>   In the timings you sent did you zero the matrix before? Does it make a difference in the timing for setting values into there matrix?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190721/6e0914b7/attachment.html>


More information about the petsc-users mailing list