Computational Science Stack Exchange is a question and answer site for scientists using computers to solve scientific problems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I writing some robust geometric algorithms using quantization + integer arithmetic for evaluating exact predicates. However, since BlueGene's integer support is so terrible, it occurred to me that the use of integer math may (weirdly) kill the portability of the library in terms of performance.

How worried should I be about this? Are future HPC systems likely to have similar issues? I realize that a question about predicting the future may be difficult or impossible to answer, but this seems like an important design decision to get right. Any thoughts are appreciated.

In this case, there's an easy fallback: I can run an initial filtering step using floating point interval arithmetic (assuming the architecture has "round to $-\infty$" support). This has zero effect on the results since I'd fall back to integers if the filter fails. Other integer-based algorithms may not be so lucky, however.

share|improve this question
I often see people using a type called real which they define as float or double or whatever. GPU Hardware is often benchmarked in floating point operations. For scientific computing double seems to be more important. When you need integer operations, you have no choice anyway. – vanCompute Feb 20 '13 at 12:53
Would you mind being more specific about what you mean by its integer support being "terrible"? – Jack Poulson Feb 20 '13 at 15:55
If you max out the number of threads on a BGQ node, each thread gets to do 1 integer op every other cycle, since four threads share a dual issue integer ALU. – Geoffrey Irving Feb 20 '13 at 17:30
up vote 2 down vote accepted

Different vendors have different paths forward on this, and most of it is under NDA. If you really want to know, ask Intel, AMD, IBM, ARM, and maybe NVIDIA for briefings under NDA. Some of these vendors will have full support for vectorized integer instructions in the future so that integer will keep up with floating-point, and some of them may not. For those that don't, you will most likely see performance at the single add, multiply, or logical operation per clock level with divide and remainder operations taking many cycles.

share|improve this answer
Thanks. I'll make sure to keep the floating point filter available as a compile time choice. – Geoffrey Irving Feb 20 '13 at 17:31

To answer your first question: I wouldn't worry about floating-point being faster than integers. If floating point operations are faster than regular integer operations, I don't see why you shouldn't use them. If you stay within 23 bits, all single-precision floating-point operations on integer values should be identical to the integer operations on the same values.

share|improve this answer
I would worry. Some integer operations are used for subsequent indexing. Using floats for these operations requires type conversion and limits you to 23-bit indices. There are plenty of codes that need more than that. – Bill Barth Feb 20 '13 at 14:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.