[petsc-users] parallel vector of integers

Jed Brown jedbrown at mcs.anl.gov
Mon Oct 17 17:46:31 CDT 2011


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111017/500b6080/attachment.htm>


More information about the petsc-users mailing list