[petsc-dev] PETSc in double-double and quad-double...

Barry Smith bsmith at mcs.anl.gov
Sat Jan 16 16:31:19 CST 2010


    Ok, after a lot of screaming and crying I could get qd and mpack  
built under Linux but I have a new show stopper.

     The dd_real class in qd doesn't really mimic double precision  
numbers. For example, !, ++ and casts to bool, int, double don't work.  
Plus one cannot pass it through ... which means that all the ASCII IO  
in PETSc would have to be reworked. I tried adding the missing stuff  
to the dd_real class but then all hack broke loose because the  
operator overloading started to fail since it it could not decide  
which definition to use because it could cast out of the dd_real and  
have multiple versions that were valid. I couldn't figure a way around  
it without a major rewrite of qd.  Damn, cool idea, but I have to give  
up again.

    Barry

On Jan 8, 2010, at 8:56 PM, Barry Smith wrote:

>
>  I'm giving up on this for now. Building BlasLapack from the f or  
> f2c source code of BlasLapack with qd is hopeless. So one could use  
> mpack, but mpack requires gmp to build, but I am unable to build gmp  
> on my Mac because it is not as portable as it is suppose to be.
>
>   There is a config/PETSc/packages/qd.py gmp.py and mpack.py if  
> anyone wants to see if they can get the pieces built. Note: you will  
> need to get the tarballs yourself, they are not on the website. If  
> you hack MPACK to get things running then please do it in an hg  
> repository. You might be able to hack mpack so it does not need gmp  
> to build but .....
>
>   Cool idea but I am so pissed at bullshit non-portable code that  
> pretends to be portable I'm giving up!
>
>
>   Barry
>
> On Nov 4, 2009, at 2:27 PM, Matthew Knepley wrote:
>
>> On Wed, Nov 4, 2009 at 2:21 PM, Jed Brown <jed at 59a2.org> wrote:
>> Matthew Knepley wrote:
>> > On Wed, Nov 4, 2009 at 2:06 PM, Barry Smith <bsmith at mcs.anl.gov
>> > <mailto:bsmith at mcs.anl.gov>> wrote:
>> >
>> >
>> >       This is tricky because some C/C++ compilers long double  
>> uses 128
>> >     bits of space but actually (on Intel) only uses 80 of the bits
>> >     (those are the bits that floating point unit handles). So you  
>> do not
>> >     really get 128 bits. Also MPI may not properly handle the 128  
>> bit
>> >     doubles.
>> >
>> >
>> > I figured that his types were just C++ types once he said they were
>> > provided by a package.
>>
>> QD is honest quad-double (32 bytes, all of them significant)
>>
>> http://crd.lbl.gov/~dhbailey/mpdist/
>>
>> They are C++ types with appropriate overloading, but the operations  
>> are
>> implemented in terms of conventional double-precision where as "long
>> double" is a different beast.
>>
>> Okay, then this should be no harder than complex.
>>
>> >       I am investigating qd now. Is there any MPI implementation  
>> that
>> >     uses qd? Do you need MPI?
>> >
>> >
>> > Can't we just make a type the correct number of bytes long?
>>
>> I think so (on homogeneous hardware), but you have to create your own
>> version of each MPI_Op that does the right thing with this longer  
>> type.
>>
>> Yep, we do that now for several things in PETSc.
>>
>>  Matt
>>
>> Jed
>>
>>
>>
>>
>> -- 
>> What most experimenters take for granted before they begin their  
>> experiments is infinitely more interesting than any results to  
>> which their experiments lead.
>> -- Norbert Wiener
>




More information about the petsc-dev mailing list