[petsc-users] Assembling MatSeqAICUSPARSE from kernel

Barry Smith bsmith at petsc.dev
Wed Sep 30 10:55:22 CDT 2020


  Hector,

   You asked at just the right time. Mark Adams has started to implement some code to do this https://gitlab.com/petsc/petsc/-/merge_requests/3137 <https://gitlab.com/petsc/petsc/-/merge_requests/3137> it is now in the PETSc master branch. It is preliminary and not yet well documented but hopefully if you read through the MR (above) it will give you the main ideas. 

   Please feel free to ask questions on this topic at GitLab or on petsc-dev at mcs.anl.gov <mailto:petsc-dev at mcs.anl.gov> we are eager to have users for this material and improve it to make it practical and straightforward.


  Barry


> On Sep 30, 2020, at 9:49 AM, Héctor Barreiro Cabrera <hecbarcab at gmail.com> wrote:
> 
> Greetings fellow PETSc users!
> 
> I have recently started working on a project that requires assembling and solving a large sparse linear system directly on the GPU using CUDA. I have just discovered that PETSc has support for building and solving such a system through cuSparse (MatSeqAICUSPARSE), which is quite cool because this opens up the possibility of using PETSc's awesome functionalities.
> 
> However, I have not been able to find information about how (or even if it is possible) to assemble the matrix from data stored in device memory. From the documentation, it seems that vectors (VecSeqCUDA) expose the raw device pointer through VecCUDAGetArrayRead and VecCUDAGetArrayWrite functions which I could use to update the systems' RHS vector, but I couldn't find anything alike for matrices. Is there anything equivalent?
> 
> Ideally I would like to generate all the assembly information from a kernel, avoiding any data synchronization with the host (except maybe updating the pointers). Is this even possible?
> 
> Thank you very much for your help!
> 
> Greetings,
> Hector Barreiro

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200930/c4a60efe/attachment.html>


More information about the petsc-users mailing list