CPUs/Compilers for Numerical Simulations?
X43B asks: "I'm building a 'luggable' computer for numerical simulation work (very niche, I know). My goal is to have the best single precision floating point performance for under $1000. I have decided on a Shuttle XPC layout. I can build a AMD 3500+ for ~$80 less than a Prescott 3.4Ghz. I know the AMD is supposed to be a better 'general purpose' CPU however I found this comparison which says the Intels are better for floating point. Additionally, even though the AMD is somewhat cheaper, I have found the free Intel Linux FORTRAN compiler quicker than gfortran. So even if the AMD had similar performance for cross compiling, the Intel would be ~10% faster with the free compiler. Does anyone have any recommendations on AMD vs Intel for single precision floating point operations? If you recommend the AMD, what (cheap or free) compiler can be used that is comparable to the Intel?"
The P4 has amazing floating point performance, but you have to use packed SSE2/3 to get it. For general (non-packed SSE or x86) floating point performance, the Athlon lines are strong.
If you can get a low end Athlon 64 (like one of the single channel versions) that might be great for you. They are the "budget" versions but have great FPUs, more registers if your software can use it, and are true 64-bit.
As for the Athlon (non-64), I wouldn't personally. I would think you could get a low end Athlon 64 (like I said above) for a reasonable price that would smoke it.
Last of all, the Intel compiler is designed for Intel chips (duh), but the code can be run by Athlons and Opterons and even on the AMD chips it's code is often better performing than GCC code. That said, if you get a P4, using that compiler is probably a must because it is sooooo good at seting up floating point stuff and gets much better performance (but then again, what do you expect?). So give it a try no matter what you buy, it will probably help your performance.
So those are my theories/impressions. You can get SFF PC that will hold just about any processor. Too bad money is an object because that dual-cpu Iwill Opteron SFF that will come out later this year would kill anything else in a SFF (assuming you can take advantage of the 2nd CPU with whatever you're doing, which I assume you can).
Comment forecast: Bits of genius surrounded by a sea of mediocrity.
Try thinking this through in terms of return-on-investment. If $80 is all you're going to save on a product that's around $1000, it may not be worth it, especially given what else you know is going into each product. First, it's an 8% savings, hardly a significant bargain. Second, from what it sounds like you'll be doing with it, $80 extra for an Intel chip is very small sum for the increased performance (10% from your description above) you'll be getting in return. Third, assume you do find similar performance for an AMD, but might require payment for a compiler negating the $80 savings. Finally, ask yourself if searching for a free (as in beer) AMD compiler is worth $80 of your time if you already have everything in place for an Intel.
I think you're best bet is the little extra you spend for the Prescott model.
The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
Save your CPU money for the compiler (e.g. PGF90, or what have you), or for development tools, and for more RAM. A good compiler will give you a better handle on numerical accuracy than a 'better' CPU stuck with an off compiler. More RAM will keep you from being stingy in single/double precision allocations.
:)
Also, factor in your work time. A few percentage difference between CPUs won't count nearly as much as the 2 hours you saved because you had a good debugger, or the 4 hours saved because your editor makes it easier to write and jump around your code.
Your accuracy will be pretty much the same, you just have to understand how computers represent floats and plan accordingly. Use accurate representations even if they're slower to get the numerical accuracy you need, then optimize the slow parts.
Only optimize the stuff that runs slow. That means profile, don't just guess. You'll often be surprised by where the bottlenecks are.
Higher accuracy usually means more memory (going with doubles rather than floats) or work (converting to integers within your desired floating range to control floating point accuracy). CPU won't be a biggie, but having lots of RAM will help.
If you have a choice between spending 3 months writing and optimizing code, or spending 1 month writing code that isn't optimized, think of what 2 months of runtime will do. If it takes you a while to write the code, just buy your super-accurate machine _after_ coding, when it's time to do your real runs (since chip speeds already increase).
In fact, if it takes you 3 months to optimize, you'd be better off keeping the slow code, doing another project, and 3 months later just buying a faster PC to run the slow old code
All this off the top of my head, hope it helps.
A.
The last thing I have to say is that as another poster pointed out, are you stuck in the Wintel world? Because the G4 and G5s (the later especially) are supposed to be VERY good at this kind of thing. So you could use a XServe G5 (pretty small) or just a normal G5 (not as small). They aren't that cheap (probably couldn't get one in your budget, but maybe used) but they should preform great. They are also true 64-bit. Also, IBM sells G5 computers, so you're not stuck buying an Apple (you might be able to get a cheaper one that way too). Not sure about the sizes of those though.
Just more stuff to think about.
Comment forecast: Bits of genius surrounded by a sea of mediocrity.
You may want to look into the IWILL Dual Opteron SFF PC It's in a small form factor design like a Shuttle XPC, but with support for Dual AMD Opterons.
Even if you don't have the money for both CPU's right now...it's a good start and you could add the 2nd CPU later. This would be the most powerful small form factor number cruncher.
http://www.kubuntu.org/
AMD and Intel both subscribe to the IEEE 754 standard for FPU units, which defines the functions of single and double precision FPU operations and various other things, like how to handle the inevitable rounding errors.
No FPU meeting this standard will produce different results than any other FPU. They're just faster or slower at doing it.
You'll only start getting differences when you hack non-standard speed optimisations into your code. It's unfair to blame Intel and AMD for people writing incompetently coded software - they just provide the stick, it's the coder who's beating you with it.
--
Intel has a set of optimized mathematical libraries for all sorts of applications (linear algebra, image processing, random number generation, FFT's, etc). Not only are they optimized for Intel systems, but they save you the time of coding it yourself.
Intel also provides the VTune Performance Analyzer, which allows you to trace the path through your programs and determine where the bottlenecks are.
I've used the Intel Linux Fortran compiler and I am very happy with it. Code that runs fine on my Sun workstation (950 Mhz, 6 gig RAM) at school works 4-5x faster on my home PC (2.8 Ghz, 1 gig RAM). It's got all the fancy optimization options, but a simple -O3 -ipo will get you 90% there.
My two bits.
Favorite
No FPU meeting this standard [IEEE 754] will produce different results than any other FPU.
Correct as far as arithmetic operations go, but not for other functions. Trigonometric functions are quite a different story, and the results will vary between processors -- older Intel (co-)processors were accurate to 4.5 ulp, whereas recent ones are accurate to 1.5 or 1.0 ulp, for example.
For that matter, as far as I'm aware IEEE 754 doesn't make *any* requirements of the trigonometric functions; they might behave as random number generators for all the standard says.
Tarsnap: Online backups for the truly paranoid
i have not tried this with intel's fortran compiler, *but*, from what i've heard, the intel c/c++ compiler produces code that performs substantially better than gcc on an amd processor. does the code running on an amd perform comparably to code running on an "equivalent" (take that term to mean what you will) intel box? i have no idea, but *if* i remember correctly, i was seeing a good 15-20% increase over gcc on the stuff i was doing targeting a p4. since amd makes chips which are, in theory, binary compatible with p4s, it may be worth a shot. another thing to recommend the intel compilers: their native support of openmp. if you do go with a dual box, you can give the intel compiler hints about how to parallelize your code to take full advantage of all n processors (don't know if you'll have ht turned on or not). hope this helps at least a little bit.
I wouldn't start relying on special compilers; once you go down that road, you start putting processor-dependent features into your code, you start battling with compatibility issues, your code becomes less usable by others, and you have less choice in software from others that you can use; it all becomes a huge waste of time.
Instead, check for yourself which system (not processor, but system) gives you the most bang for the buck using the most standard compiler you can find. If you use gcc, I believe systems based on AMD's 64bit chips still win.
And, realistically, 10-20% differences are not worth investing a lot of time or energy in anyway; that corresponds to a few months of progress in processor and systems development.
Maybe you just want a better graphics card? Nowadays you can run numerical calculations on the graphics card's processor - and no, you don't get random noise all over your screen, its not simple memory-mapped graphics! Plus it gives you the excuse to buy a machine that can play Doom 3.
More info here: http://www.gpgpu.org/
Whatever you do, make sure you have a properly tuned ATLAS library:
http://math-atlas.sourceforge.net/
I don't know if anyone has got ATLAS or BLAS to work on GPUs yet.
Baz
AMD and Intel both subscribe to the IEEE 754 standard for FPU units,
This is true for "normal" floating-point operations and SSE, but 3DNow! is not IEEE-compliant. There are also some ways to introduce non-compliance in SSE, such as the LDMXCSR, RCP, and RSQRT instructions. (The former can change over/underflow behavior, and the other two are approximation functions.)
Kayvon Fatahalian et al. have a good comparison for matrix-matrix multiplication between CPU's and GPU's.
One major disadvantage of the GPU at the moment is that, as far as I know, no standard software (such as LINPACK, FFTW, etc) supports it.
I spent a summer benchmarking a couple of new computers for a the University of Otago Physics department. They were looking into buying a cluster for their Bose-Einstien condensate experiments, it was my job to see where things were going slow. I found the major bottleneck was in the network. But I also made comparisons between a P4 2.4GHz and AMD Athon-XP 2400+, the results are interesing.
GPUs don't do IEE floats. That might be bad for his purpose...
Try Corewar @ www.koth.org - rec.games.corewar
Compiler support is critical. Forget GCC. It's not a high-performance compiler. Look into the CodePlay C++ compiler under Windows, or the Portland Compiler Group products under Windows and Linux.
-- There is no truth. There is only Perception. To Percieve is to Exist.