<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=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:Consolas;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Consolas;color:#1F497D">Dave,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Consolas;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Consolas;color:#1F497D">Thanks for your answer.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Consolas;color:#1F497D">For consistency with otehr PETSc routines it would perhaps make sense to create a DMDARestoreAO function?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Consolas;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Consolas;color:#1F497D">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Consolas;color:#1F497D">Federico<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:Consolas;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#0093D0;mso-fareast-language:IT">______</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#6A737B;mso-fareast-language:IT">
</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#8CC63F;mso-fareast-language:IT">______</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#6A737B;mso-fareast-language:IT">
</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#FCB034;mso-fareast-language:IT">______</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#6A737B;mso-fareast-language:IT"><o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="IT" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#404040;mso-fareast-language:IT">Federico Miorelli</span><span lang="IT" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:IT"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:IT"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:IT">Senior R&D Geophysicist<o:p></o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-GB">Subsurface Imaging - General Geophysics
</span></b><b><span style="font-size:9.0pt;font-family:"Calibri","sans-serif";color:#1F497D;mso-fareast-language:EN-GB">Italy</span></b><span style="font-size:8.0pt;font-family:"Calibri","sans-serif";color:#404040;mso-fareast-language:EN-GB"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Calibri","sans-serif";color:#404040;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:8.0pt;font-family:"Calibri","sans-serif";color:#404040;mso-fareast-language:EN-GB">CGG Electromagnetics (Italy) Srl<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="IT" style="font-size:8.0pt;font-family:"Calibri","sans-serif";color:#404040;mso-fareast-language:EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Dave May [mailto:dave.mayhem23@gmail.com]
<br>
<b>Sent:</b> giovedì 12 maggio 2016 13:03<br>
<b>To:</b> Miorelli, Federico<br>
<b>Cc:</b> petsc-users@mcs.anl.gov<br>
<b>Subject:</b> Re: [petsc-users] DMDAGetAO and AODestroy<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 12 May 2016 at 11:36, Miorelli, Federico <<a href="mailto:Federico.Miorelli@cgg.com" target="_blank">Federico.Miorelli@cgg.com</a>> wrote:<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas">In one of my subroutines I'm calling DMDAGetAO to get the application ordering from a DM structure.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas">After using it I was calling AODestroy.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas">Everything worked fine until I called the subroutine for the second time, when the program crashed.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas">Removing the call to AODestroy solved the crash.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas">Am I supposed to AODestroy the output of DMDAGetAO or not? I was worried that DMDAGetAO would allocate memory that I need to release.</span><o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">You are not supposed to call AODestroy() on the AO returned.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">The pointer being returned is used internally by the DMDA.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> Dave<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas">Federico</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-family:Consolas"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#0093D0">______</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#6A737B">
</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#8CC63F">______</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#6A737B">
</span></b><b><span lang="IT" style="font-size:18.5pt;font-family:"Arial","sans-serif";color:#FCB034">______</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="IT" style="color:#404040">Federico Miorelli</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="IT" style="color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span lang="IT" style="color:#1F497D">Senior R&D Geophysicist</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span style="font-size:10.0pt;color:#1F497D">Subsurface Imaging - General Geophysics
</span></b><b><span style="font-size:9.0pt;color:#1F497D">Italy</span></b><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.0pt;color:#404040"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:8.0pt;color:#404040">CGG Electromagnetics (Italy) Srl</span><o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><i><span lang="EN-GB" style="font-size:7.0pt;font-family:"Arial","sans-serif";color:#6A737B">This email and any accompanying attachments are confidential. If you received this email
by mistake, please delete<br>
it from your system. Any review, disclosure, copying, distribution, or use of the email by others is strictly prohibited.</span></i><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><i><span lang="EN-GB" style="font-size:7.0pt;font-family:"Arial","sans-serif";
color:#6A737B;mso-ansi-language:EN-GB">This email and any accompanying attachments are confidential. If you received this email by mistake, please delete<br>
it from your system. Any review, disclosure, copying, distribution, or use of the email by others is strictly prohibited.<o:p></o:p></span></i></p>
</body>
</html>