[petsc-users] Questions about setting values for GPU based matrices

Fredrik Heffer Valdmanis fredva at ifi.uio.no
Sun Oct 30 07:22:20 CDT 2011


2011/10/28 Matthew Knepley <knepley at gmail.com>

> On Fri, Oct 28, 2011 at 10:24 AM, Fredrik Heffer Valdmanis <
> fredva at ifi.uio.no> wrote:
>
>> Hi,
>>
>> I am working on integrating the new GPU based vectors and matrices into
>> FEniCS. Now, I'm looking at the possibility for getting some speedup during
>> finite element assembly, specifically when inserting the local element
>> matrix into the global element matrix. In that regard, I have a few
>> questions I hope you can help me out with:
>>
>> - When calling MatSetValues with a MATSEQAIJCUSP matrix as parameter,
>> what exactly is it that happens? As far as I can see, MatSetValues is not
>> implemented for GPU based matrices, neither is the mat->ops->setvalues set
>> to point at any function for this Mat type.
>>
>
> Yes, MatSetValues always operates on the CPU side. It would not make sense
> to do individual operations on the GPU.
>
> I have written batched of assembly for element matrices that are all the
> same size:
>
>
> http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MatSetValuesBatch.html
>

Thanks. I assume that the best way to use the batch function is to batch up
all element matrices and insert all with one function call? Or is it
recommended to split it up into several smaller batches?

-- 
Fredrik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111030/cc0343e4/attachment.htm>


More information about the petsc-users mailing list