[petsc-users] combine single and double precision

Jed Brown jed at jedbrown.org
Tue Feb 9 09:30:58 CST 2016


albert gutiérrez <albert.gutierrez at bsc.es> writes:

> Hello everyone,
>
> At times it can be useful to combine different data types in the same
> problem. For example, there are parts of an algorithm which may be memory
> bounded (requiring float) and operations where more precision is needed
> (requiring double or float_128).
>
> Can single and double precision be combined in PETSc?

Unfortunately not in a supported way.  (It's possible to link different
versions of the library into the same application, but it's a mess and
not supported.)

> I know the data type is set in the configuration process using the
> parameter "--with-precision=TYPE". It looks like having single and double
> precision at the same time will require the modification of the source code
> of the library. Is there an easy way to implement this feature?

Current languages are really bad at this and the semantics of composing
objects of different types are ambiguous unless types are always
promoted to the largest, which erases much of the memory benefit in many
algorithms.  But if we knew a clean way to do it, we would.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160209/972d0ddd/attachment.pgp>


More information about the petsc-users mailing list