[petsc-users] Wrapping PetscFPrintf

Jed Brown jedbrown at mcs.anl.gov
Sun Nov 11 08:35:55 CST 2012

On Sun, Nov 11, 2012 at 7:34 AM, Dominik Szczerba <dominik at itis.ethz.ch>wrote:

> Unfortunately, I do not see any related error messages in valgrind and
> the whole va_list machinery is a bit obfuscated. What I experimentally
> discovered, however, is that the problem goes away if the two
> functions are directly provided in the same source file in C-style. As
> soon as they go out to a class the problem occurs.

They'll be okay as _static_ class functions. I wasn't aware that va_list
doesn't work properly from a member function, but it does modify the
calling sequence. It could be compiler-dependent. C++ is not my favorite

> But I found a very promising solution: PetscVFPrintf. It solves my
> problem for my own Print function. But I do not seem to find a
> corresponding function for synchronized printing (PetscFPrintf). Any
> clues how to use PetscVFPrintf for synchronized printing please?

PetscSynchronizedVFPrintf is missing, but should be added.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121111/7b2c122c/attachment.html>

More information about the petsc-users mailing list