[petsc-dev] Arm DDT feature questions

Smith, Barry F. bsmith at mcs.anl.gov
Tue Mar 5 16:38:14 CST 2019


   I don't know of such things. For TotalView there are routines such as 

#if defined(PETSC_USE_DEBUG)
#include <../src/sys/totalview/tv_data_display.h>
PETSC_UNUSED static int TV_display_type(const struct _p_Vec *v)
{
  const PetscScalar *values;
  char              type[32];
  PetscErrorCode    ierr;


  TV_add_row("Local rows", "int", &v->map->n);
  TV_add_row("Global rows", "int", &v->map->N);
  TV_add_row("Typename", TV_ascii_string_type, ((PetscObject)v)->type_name);
  ierr = VecGetArrayRead((Vec)v,&values);CHKERRQ(ierr);
  ierr = PetscSNPrintf(type,32,"double[%d]",v->map->n);CHKERRQ(ierr);
  TV_add_row("values",type, values);
  ierr = VecRestoreArrayRead((Vec)v,&values);CHKERRQ(ierr);
  return TV_format_OK;
}
#endif

but they may not have been used for many years and hence may no longer work.

   Barry


> On Mar 5, 2019, at 2:14 PM, Zhang, Junchao via petsc-dev <petsc-dev at mcs.anl.gov> wrote:
> 
> 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. 
> 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.
> 
> --Junchao Zhang
> 
> ---------- Forwarded message ---------
> From: John Linford <John.Linford at arm.com>
> Date: Tue, Mar 5, 2019 at 1:16 PM
> Subject: Re: Arm DDT feature questions
> To: Zhang, Junchao <jczhang at mcs.anl.gov>
> 
> 
> Hi Junchao,
> 
> The Forge developers came back with some answers.  Please see below.  Thanks,
> 
> Sorry for the delay. Please find answer to your questions:
> 
>  
> 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? 
> 
>  
> 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.
> 
> 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.
> 
> 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.
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
> John C. Linford | Principal Applications Engineer | Development Solutions
> john.linford at arm.com | LinkedIn
> Direct/Mobile: +1-737-218-3529
> Arm HPC Ecosystem | www.arm.com
>  
>  
> 
> 
> From: John Linford
> Sent: Tuesday, February 19, 2019 12:31:56 PM
> To: Zhang, Junchao
> Subject: Re: Arm DDT feature questions
>  
> Hi Junchao,
> 
> 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,
> 
>  
> John C. Linford | Principal Applications Engineer | Development Solutions
> john.linford at arm.com | LinkedIn
> Direct/Mobile: +1-737-218-3529
> Arm HPC Ecosystem | www.arm.com
>  
>  
> 
> 
> From: Zhang, Junchao <jczhang at mcs.anl.gov>
> Sent: Friday, February 15, 2019 5:28:59 PM
> To: John Linford
> Subject: Arm DDT feature questions
>  
> Hi, John,
>   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
> typedef struct {
>   int type;
>   int len;
>   double *p;
>   void *data; 
> } Vec;
> 
> 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. 
> 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.
> Thank you 
> --Junchao Zhang
> 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.



More information about the petsc-dev mailing list