<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="ltr">
<div>In an Arm training class, I requested a DDT feature from John Linford from Arm Inc, which now owns Allinea DDT.  Basically, I want DDT to correctly display petsc variable-lengthed arrays and void* pointers.  From John's feedback, it looks DDT could support
 it. </div>
<div>Does anyone already have custom pretty-printers in gdb for petsc?  Otherwise, I think we should make one and perhaps let Arm ship with its product.</div>
<div><br>
</div>
<div>
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">--Junchao Zhang</div>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>
From: <strong class="gmail_sendername" dir="auto">John Linford</strong> <span dir="ltr">
<<a href="mailto:John.Linford@arm.com">John.Linford@arm.com</a>></span><br>
Date: Tue, Mar 5, 2019 at 1:16 PM<br>
Subject: Re: Arm DDT feature questions<br>
To: Zhang, Junchao <<a href="mailto:jczhang@mcs.anl.gov">jczhang@mcs.anl.gov</a>><br>
</div>
<br>
<br>
<div dir="ltr">
<div id="m_-6852634584907103811divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi Junchao,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">The Forge developers came back with some answers.  Please see below.  Thanks,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<p style="color:rgb(33,33,33);font-size:11pt;font-family:Calibri,sans-serif,serif,EmojiFont;margin-right:0px;margin-left:0px">
Sorry for the delay. Please find answer to your questions:</p>
<p style="color:rgb(33,33,33);font-size:11pt;font-family:Calibri,sans-serif,serif,EmojiFont;margin-right:0px;margin-left:0px">
 </p>
<div style="color:rgb(33,33,33);font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont;font-size:15px;margin-right:0px;margin-left:36pt;padding:0px 0px 0px 4pt;border-style:none none none solid;border-left-width:1pt;border-left-color:windowtext">
<p style="font-size:11pt;font-family:Calibri,sans-serif,serif,EmojiFont;margin-right:0px;margin-left:0px;padding:0px;border-style:none">
<i>Does Arm DDT support user-defined array length and user-defined pointer casting from a custom file, which sets the rules and is provided by users? </i><i></i></p>
</div>
<p style="color:rgb(33,33,33);font-size:11pt;font-family:Calibri,sans-serif,serif,EmojiFont;margin-right:0px;margin-left:0px">
 </p>
<p style="color:rgb(33,33,33);font-size:11pt;font-family:Calibri,sans-serif,serif,EmojiFont;margin-right:0px;margin-left:0px">
Yes, DDT does support this through the user of GDB pretty printers. The best example is the support of STL vectors in DDT. There is also a simple example in /path/to/forge/example/fruit* and explanations in the UG.</p>
<p style="color:rgb(33,33,33);font-size:11pt;font-family:Calibri,sans-serif,serif,EmojiFont;margin-right:0px;margin-left:0px">
I have been trying to fiddle with pretty printers and PETSC (this could make a nice blog article) but I only managed to make it work in GDB, not in DDT for some reason. I’ll let you know if I manage to get anything interesting.</p>
<p style="color:rgb(33,33,33);font-size:11pt;font-family:Calibri,sans-serif,serif,EmojiFont;margin-right:0px;margin-left:0px">
We could possibly make a feature request to support PETSC datatypes. If PETSC developers maintain GDB pretty printers between versions, I think this is something we could look at.</p>
<p style="color:rgb(33,33,33);font-size:11pt;font-family:Calibri,sans-serif,serif,EmojiFont;margin-right:0px;margin-left:0px">
<br>
</p>
<p style="color:rgb(33,33,33);font-size:11pt;font-family:Calibri,sans-serif,serif,EmojiFont;margin-right:0px;margin-left:0px">
<br>
</p>
<p style="color:rgb(33,33,33);font-size:11pt;font-family:Calibri,sans-serif,serif,EmojiFont;margin-right:0px;margin-left:0px">
</p>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="m_-6852634584907103811Signature">
<div id="m_-6852634584907103811divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p style="margin-top:0;margin-bottom:0"></p>
<p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<b><span style="font-size:12.0pt;color:black"> </span></b></p>
<p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<b><span style="font-size:9.0pt;color:black">John C. Linford</span></b><span><span style="font-size:9.0pt;color:black"> </span></span><span style="font-size:9.0pt;color:black">| Principal Applications Engineer | Development Solutions<br>
</span><span style="color:black"><a href="mailto:john.linford@arm.com" style="color:rgb(5,99,193);text-decoration:underline" id="m_-6852634584907103811LPNoLP" target="_blank"><span style="font-size:9.0pt">john.linford@arm.com</span></a></span><span style="font-size:9.0pt;color:black"> |
<a href="https://www.linkedin.com/in/jlinford/" class="m_-6852634584907103811OWAAutoLink" id="m_-6852634584907103811LPNoLP" target="_blank">
LinkedIn</a></span></p>
<p style="text-align:start;word-spacing:0px;margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<span style="font-size:9.0pt;color:black">Direct/Mobile: +1-737-218-3529<br>
</span><b><span style="color:black"><a href="https://developer.arm.com/HPC" title="https://developer.arm.com/HPC Cmd+Click or tap to follow the link" style="color:rgb(5,99,193);text-decoration:underline" id="m_-6852634584907103811LPNoLP" target="_blank"><span style="font-size:7.5pt">Arm
 HPC Ecosystem</span></a></span></b><span><span style="color:#009eb5"> </span></span><span style="font-size:9.0pt;color:black">|</span><span><span style="color:#009eb5"> </span></span><span style="color:black"><a href="https://www.arm.com/" style="color:rgb(5,99,193);text-decoration:underline" id="m_-6852634584907103811LPNoLP" target="_blank"><span style="font-size:7.5pt">www.arm.com</span></a></span></p>
<p style="text-align:start;word-spacing:0px;margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<b><span style="font-size:12.0pt;color:black"> </span></b></p>
<p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<span style="color:black"> </span></p>
<br>
<p></p>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_-6852634584907103811divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> John Linford<br>
<b>Sent:</b> Tuesday, February 19, 2019 12:31:56 PM<br>
<b>To:</b> Zhang, Junchao<br>
<b>Subject:</b> Re: Arm DDT feature questions</font>
<div> </div>
</div>
<div dir="ltr">
<div id="m_-6852634584907103811x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif">
<p style="margin-top:0;margin-bottom:0">Hi Junchao,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Thanks for the follow-up and glad you could attend the workshop.  I've sent this over to the tools group and should have an answer for you soon.  Thanks,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="m_-6852634584907103811x_Signature">
<div id="m_-6852634584907103811x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Helvetica,sans-serif,Helvetica,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p style="margin-top:0;margin-bottom:0"></p>
<p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<b><span style="font-size:12.0pt;color:black"> </span></b></p>
<p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<b><span style="font-size:9.0pt;color:black">John C. Linford</span></b><span><span style="font-size:9.0pt;color:black"> </span></span><span style="font-size:9.0pt;color:black">| Principal Applications Engineer | Development Solutions<br>
</span><span style="color:black"><a href="mailto:john.linford@arm.com" id="m_-6852634584907103811LPNoLP" style="color:rgb(5,99,193);text-decoration:underline" target="_blank"><span style="font-size:9.0pt">john.linford@arm.com</span></a></span><span style="font-size:9.0pt;color:black"> |
<a href="https://www.linkedin.com/in/jlinford/" class="m_-6852634584907103811x_OWAAutoLink" id="m_-6852634584907103811LPNoLP" target="_blank">
LinkedIn</a></span></p>
<p style="text-align:start;word-spacing:0px;margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<span style="font-size:9.0pt;color:black">Direct/Mobile: +1-737-218-3529<br>
</span><b><span style="color:black"><a href="https://developer.arm.com/HPC" title="https://developer.arm.com/HPC Cmd+Click or tap to follow the link" id="m_-6852634584907103811LPNoLP" style="color:rgb(5,99,193);text-decoration:underline" target="_blank"><span style="font-size:7.5pt">Arm
 HPC Ecosystem</span></a></span></b><span><span style="color:#009eb5"> </span></span><span style="font-size:9.0pt;color:black">|</span><span><span style="color:#009eb5"> </span></span><span style="color:black"><a href="https://www.arm.com/" id="m_-6852634584907103811LPNoLP" style="color:rgb(5,99,193);text-decoration:underline" target="_blank"><span style="font-size:7.5pt">www.arm.com</span></a></span></p>
<p style="text-align:start;word-spacing:0px;margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<b><span style="font-size:12.0pt;color:black"> </span></b></p>
<p style="margin:0in 0in 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<span style="color:black"> </span></p>
<br>
<p></p>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%">
<div id="m_-6852634584907103811x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Zhang, Junchao <<a href="mailto:jczhang@mcs.anl.gov" target="_blank">jczhang@mcs.anl.gov</a>><br>
<b>Sent:</b> Friday, February 15, 2019 5:28:59 PM<br>
<b>To:</b> John Linford<br>
<b>Subject:</b> Arm DDT feature questions</font>
<div> </div>
</div>
<div>
<div dir="ltr">Hi, John,
<div>  Does Arm DDT support user-defined array length and user-defined pointer casting from a custom file, which sets the rules and is provided by users?  Suppose I have a struct</div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div>
<div>typedef struct {</div>
</div>
<div>
<div>  int type;</div>
</div>
<div>
<div>  int len;</div>
</div>
<div>
<div>  double *p;</div>
</div>
<div>
<div>  void *data; </div>
</div>
<div>
<div>} Vec;</div>
</div>
</blockquote>
<div>
<div><br>
</div>
<div>Currently, to display a Vec variable, I have to manually tell DDT length of array p[] is given by len, and type of void *data is Vec_MPI* if type==1, is Vec_Seq* if type==2, so on so forth. I have to do the manual work every time when I display variables
 of type Vec. It is not convenient. </div>
<div>Structures with void pointers is heavily used by PETSc, which is a numerical library widely used in HPC. It would be nice if DDT supports PETSc objects display natively.<br>
</div>
<div>Thank you <br>
</div>
<div>
<div>
<div dir="ltr" class="m_-6852634584907103811x_x_gmail_signature">
<div dir="ltr">--Junchao Zhang</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose,
 or store or copy the information in any medium. Thank you. </div>
</div>
</div>
</body>
</html>