[petsc-dev] ugliness due to missing lapack routines

Karl Rupp rupp at mcs.anl.gov
Thu Feb 7 13:54:08 CST 2013


Hey,

>> This is a noble goal with my full support, yet very hard to achieve. How do we want to tackle CHKERRQ for example?
>
>     This is actually an easy one. Once we have a pure C code that can be completely represented in a full AST, then it is trivial to have a "pretty printer" that automatically adds into the code the equivalent of __FUNC__, PetscFunctionBegin/End, CHKERRQ(), PetscStackCall() etc BEFORE passing the code into the compiler to be compiled down to object code.

Ok, I agree. The drawback is that it adds a dependency on the 
'pretty-printer', though...

>     Thus PETSc will actually ultimately become simpler C code without all the additional stuff we have added for error checking/handling etc.  Happy days :-)

Happy days indeed!

 From my experience with refactoring it is more important to get rid of 
repetitive code blocks. In many parts this would be nothing but 
replicating the C++ template mechanism in a controlled manner.

Best regards,
Karli




More information about the petsc-dev mailing list