[petsc-users] Petsc using VecDuplicate in solution process
Stefano Zampini
stefano.zampini at gmail.com
Tue Jun 6 09:39:38 CDT 2023
Il giorno mar 6 giu 2023 alle ore 09:24 Pichler, Franz <
franz.pichler at v2c2.at> ha scritto:
> Hello,
>
> I was just investigating my KSP_Solve_BCGS Routine with algrandcallgrind,
>
> I see there that petsc is using a vecduplicate (onvolvin malloc and copy)
> every time it is called.
>
Do you mean KSPSolve_BCGS?
There's only one VecDuplicate in there and it is called only once. An
example code showing the problem would help
>
> I call it several thousand times (time evolution problem with rather small
> matrices)
>
>
>
> I am not quite sure which vector is copied there but I guess is the
> initial guess or the rhs,
>
> Is there a tool in petsc to avoid any vecduplication by providing a fixed
> memory for this vector?
>
> Some corner facts of my routine:
>
> I assemble the matrices(crs,serial) and vectors myself and then use
>
> MatCreateSeqAIJWithArrays and VecCreateSeqWithArray
>
> To wrap petsc around it,
>
>
>
> I use a ILU preconditioner and the sparsity patterns between the calls to
> not change, the values do,
>
>
>
> Thank you for any hint how to avoid the vecduplicate,
>
>
>
> Best regards
>
>
>
> Franz
>
>
>
>
>
> *Dr. Franz Pichler*
>
> Lead Researcher Area E
>
>
>
>
>
> *Virtual Vehicle Research GmbH*
>
>
>
> Inffeldgasse 21a, 8010 Graz, Austria
>
> Phone: +43 316 873 9818
>
> franz.pichler at v2c2.at
>
> www.v2c2.at
>
>
>
> Firmenname: Virtual Vehicle Research GmbH
>
> Rechtsform: Gesellschaft mit beschränkter Haftung
>
> Firmensitz: Austria, 8010 Graz, Inffeldgasse 21/A
>
> Firmenbuchnummer: 224755y
>
> Firmenbuchgericht: Landesgericht für ZRS Graz
>
> UID: ATU54713500
>
>
>
>
>
--
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230606/0f09edc5/attachment.html>
More information about the petsc-users
mailing list