[petsc-users] petsc4py and python's logging module

Barry Smith bsmith at mcs.anl.gov
Mon May 29 15:10:39 CDT 2017


   If you want to log all PETSc ASCII output you can use 

http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscVFPrintf.html  

Just don't use the FILE *fd initial argument, instead pass the output into a Python function that calls the logger as desired.

   Barry



> On May 29, 2017, at 11:17 AM, David Nolte <dnolte at dim.uchile.cl> wrote:
> 
> Dear all,
> 
> is it possible to use python's logging module
> (https://docs.python.org/2/howto/logging.html) to handle PETSc output in
> python, such as the residuals during a KSP/SNES solve?
> I log my solver's activity to a file using the logging module, it would
> be great to include the PETSc output aswell.
> 
> Regards,
> David
> 



More information about the petsc-users mailing list