[petsc-users] parallel vector of integers

Barry Smith bsmith at mcs.anl.gov
Mon Oct 17 20:49:55 CDT 2011


On Oct 17, 2011, at 5:46 PM, Jed Brown wrote:

> On Mon, Oct 17, 2011 at 17:29, Barry Smith <bsmith at mcs.anl.gov> wrote:
> An IS is NOT a Vec for integers, it is a very different best.
> 
> Besides immutability, an IS is contravariant. Although ISGeneral is implemented with a similar data structure, it isn't meant to be used as "a Vec for integers".
>  
> 
> >
> > 2) How about arbitrary parallel vectors of integers?
> 
>   You can put the integers in a Vec. Unless your code is all integers (which is unlikely because why are you using PETSc for a code that just uses integers) the overhead of shipping around a few integers stored as doubles is not going to kill the overall performance of the code. In fact, I will faint away if you can even measure the difference.  This is likely a case of premature over optimization.
> 
> The downside of this is that single precision is useless because the mantissa isn't big enough to hold useful integer sizes. If you always have at least double precision, then you can still solve big problems this way (2^53 is a big number), but I still find it aesthetically displeasing.

   So let's increase the complexity of PETSc exponentially  JUST so one little thing won't be "aesthetically displeasing"? 



More information about the petsc-users mailing list