[petsc-users] Petsc using VecDuplicate in solution process

Pichler, Franz franz.pichler at v2c2.at
Tue Jun 6 09:24:38 CDT 2023


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.

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<mailto:franz.pichler at v2c2.at>
www.v2c2.at<http://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


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


More information about the petsc-users mailing list