<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-ligatures:none;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal">I was just investigating my KSP_Solve_BCGS Routine with algrandcallgrind,<o:p></o:p></p>
<p class="MsoNormal">I see there that petsc is using a vecduplicate (onvolvin malloc and copy) every time it is called.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I call it several thousand times (time evolution problem with rather small matrices)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am not quite sure which vector is copied there but I guess is the initial guess or the rhs,<o:p></o:p></p>
<p class="MsoNormal">Is there a tool in petsc to avoid any vecduplication by providing a fixed memory for this vector?<br>
<br>
Some corner facts of my routine:<o:p></o:p></p>
<p class="MsoNormal">I assemble the matrices(crs,serial) and vectors myself and then use<o:p></o:p></p>
<p class="MsoNormal">MatCreateSeqAIJWithArrays and VecCreateSeqWithArray<o:p></o:p></p>
<p class="MsoNormal">To wrap petsc around it,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I use a ILU preconditioner and the sparsity patterns between the calls to not change, the values do,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you for any hint how to avoid the vecduplicate,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Franz<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:black">Dr. Franz Pichler</span></b><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black">Lead Researcher Area E</span><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif;color:black"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;color:black"> </span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;color:black">Virtual Vehicle Research GmbH</span></b><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:3.0pt;text-autospace:none"><b><span style="font-size:10.0pt;color:black"> </span></b><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:2.0pt;line-height:115%;text-autospace:none">
<span lang="IT" style="font-size:10.0pt;line-height:115%;color:black">Inffeldgasse 21a, 8010 Graz, Austria</span><span style="font-size:12.0pt;line-height:115%;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:115%;text-autospace:none"><span lang="FR" style="font-size:10.0pt;line-height:115%;color:black">Phone: +43 316 873 9818
</span><span style="font-size:12.0pt;line-height:115%;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom:2.0pt"><span lang="FR" style="font-size:10.0pt;color:black"><a href="mailto:franz.pichler@v2c2.at"><span style="color:blue">franz.pichler@v2c2.at</span></a></span><span style="font-size:10.0pt;font-family:"Courier New";color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:115%;text-autospace:none"><span lang="DE-AT" style="font-size:12.0pt;line-height:115%;font-family:"Times New Roman",serif;color:black"><a href="http://www.v2c2.at"><span lang="FR" style="font-size:10.0pt;line-height:115%;font-family:"Calibri",sans-serif;color:blue">www.v2c2.at</span></a></span><span style="font-size:12.0pt;line-height:115%;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="FR" style="color:black"> </span><span style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="DE" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black">Firmenname: Virtual Vehicle Research GmbH </span><span lang="DE" style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="DE" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black">Rechtsform: Gesellschaft mit beschränkter Haftung </span><span lang="DE" style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="DE" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black">Firmensitz: Austria, 8010 Graz, Inffeldgasse 21/A </span><span lang="DE" style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="DE" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black">Firmenbuchnummer: 224755y </span><span lang="DE" style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="DE" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black">Firmenbuchgericht: Landesgericht für ZRS Graz </span><span lang="DE" style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="DE" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black">UID: ATU54713500 </span><span lang="DE" style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal" style="text-autospace:none"><span lang="DE" style="font-size:8.0pt;font-family:"Arial",sans-serif;color:black"> </span><span lang="DE" style="font-size:12.0pt;font-family:"Times New Roman",serif;color:black"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="DE"><o:p> </o:p></span></p>
</div>
</body>
</html>