[petsc-users] petscprintf and __float128
Barry Smith
bsmith at mcs.anl.gov
Thu Sep 24 21:36:11 CDT 2015
> On Sep 24, 2015, at 9:24 PM, Gideon Simpson <gideon.simpson at gmail.com> wrote:
>
> I saw that Barry posted something about this in the dev listserv last December, but there wasn’t any follow up. Right now, on an OS X based machine with gcc compilers, if I do a PetscPrintf with a __float128, with %g, it outputs 0. Is there a way to get around this, other than using quadmath_snprintf?
There are only two ways: caste with a (double) or use the quadmath_snprintf. When printing the residual norms it is fine to just cast to doubles to look at convergence you don't need to do anything beyond the usual -snes_monitor -ksp_monitor etc (warning only PETSc LU solvers support __float128 so you can't use Superlu or MUMPs for the direct solvers).
I found quadmath_snprintf cumbersome to use in PETSc and not supported on all systems so didn't try to use it in PETSc.
Barry
>
>
> -gideon
>
More information about the petsc-users
mailing list