[petsc-users] PetscBinaryRead and quad precision
Barry Smith
bsmith at mcs.anl.gov
Fri Jun 26 11:24:10 CDT 2015
We have an undocumented option -binary_read_double that will read in double precision from the file and place it into a quad precision array. This is exactly what you need
Barry
Yes, we should fix up our binary viewers to allow reading and writing generally for any precision but need a volunteer to do it.
> On Jun 26, 2015, at 1:45 AM, Justin Chang <jychang48 at gmail.com> wrote:
>
> Hi all,
>
> I need to run simulations that rely on several of my custom binary datafiles (written in 32 bit int and 64 bit doubles). These date files were generated from MATLAB. In my PETSc code I invoke PetscBinaryRead(...) into these binary files, which gives me mesh data, auxiliaries, etc.
>
> However, when I now configure with quad precision (--with-precision=__float128 and --download-f2cblaslapack) my PetscBinaryRead() functions give me segmentation violation errors. I am guessing this is because I have binary files written in double precision but have PETSc which reads in quad precision, meaning I will be reading past the end of these files due to the larger strides.
>
> So my question is, is there a way to circumvent this issue? That is, to read double-precision binary data into a PETSc program configured with quad-precision? Otherwise I would have to rewrite or redo all of my datafiles, which I would prefer not to do if possible.
>
> Thanks,
> Justin
>
More information about the petsc-users
mailing list