PETSc in double-double and quad-double...

2009-11-04 Thread Jed Brown
Todd Munson wrote:
> 
> If we can do qd_real, we could also try using the arprec package and get
> arbitrary precision math.  I might be interested in that as well...

That will not work and really can't be made to work because each term
takes a different amount of space.  The implementation holds a double*
so memcpy only gives a shallow copy and the pointer is worthless after
it's sent to a different process.  It would be a lot of work to pack and
unpack every value (and change the size of the buffers dynamically).

Jed

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20091104/daa035e4/attachment.pgp>


PETSc in double-double and quad-double...

2009-11-04 Thread Jed Brown
Matthew Knepley wrote:
> On Wed, Nov 4, 2009 at 2:06 PM, Barry Smith  <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.

>   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.

Jed

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20091104/ffa96917/attachment.pgp>


PETSc in double-double and quad-double...

2009-11-04 Thread Matthew Knepley
On Wed, Nov 4, 2009 at 2:21 PM, Jed Brown  wrote:

> Matthew Knepley wrote:
> > On Wed, Nov 4, 2009 at 2:06 PM, Barry Smith  > <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/<http://crd.lbl.gov/%7Edhbailey/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
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20091104/74a5998e/attachment.html>


PETSc in double-double and quad-double...

2009-11-04 Thread Todd Munson

If we can do qd_real, we could also try using the arprec package and get 
arbitrary precision math.  I might be interested in that as well...

All are written as C++ types with operator overloading...

Cheers, Todd.

On Wed, 4 Nov 2009, Jed Brown wrote:

> Matthew Knepley wrote:
>> On Wed, Nov 4, 2009 at 2:06 PM, Barry Smith > > 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.
>
>>   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.
>
> Jed
>
>



PETSc in double-double and quad-double...

2009-11-04 Thread Matthew Knepley
On Wed, Nov 4, 2009 at 2:06 PM, Barry Smith  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.


>   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?

  Matt


>   Barry
>
>
>
> On Nov 4, 2009, at 1:33 PM, Matthew Knepley wrote:
>
>  If you are alright with EVERYTHING running with that, it already works.
>> Just set PetscScalar
>> to that type. I would help you setup a configure switch for it if needed.
>>
>> If you only want it for some operations, we would have to hear more
>> specifics.
>>
>>  Thanks,
>>
>>Matt
>>
>> On Wed, Nov 4, 2009 at 10:45 AM, Todd Munson  wrote:
>>
>> Barry and Matt,
>>
>> I was wondering how hard it would be to modify PETSc to support
>> double-double and quad-double arithmetic using the QD package
>> from LBL?
>>
>> Its looking more and more likely that I may need this functionality for
>> some upcoming projects that have bad scaling issues and I don't want to have
>> to reimplement KSP and PC methods...
>>
>> Cheers, Todd.
>>
>>
>>
>>
>> --
>> 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
>>
>
>


-- 
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
-- next part --
An HTML attachment was scrubbed...
URL: 
<http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20091104/eb82322e/attachment.html>


PETSc in double-double and quad-double...

2009-11-04 Thread Barry Smith

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 am investigating qd now. Is there any MPI implementation that  
uses qd? Do you need MPI?

Barry


On Nov 4, 2009, at 1:33 PM, Matthew Knepley wrote:

> If you are alright with EVERYTHING running with that, it already  
> works. Just set PetscScalar
> to that type. I would help you setup a configure switch for it if  
> needed.
>
> If you only want it for some operations, we would have to hear more  
> specifics.
>
>   Thanks,
>
> Matt
>
> On Wed, Nov 4, 2009 at 10:45 AM, Todd Munson   
> wrote:
>
> Barry and Matt,
>
> I was wondering how hard it would be to modify PETSc to support  
> double-double and quad-double arithmetic using the QD package
> from LBL?
>
> Its looking more and more likely that I may need this functionality  
> for some upcoming projects that have bad scaling issues and I don't  
> want to have to reimplement KSP and PC methods...
>
> Cheers, Todd.
>
>
>
>
> -- 
> 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