Writing portable code is almost always a matter of proper and powerful abstractions. But sometimes just getting your code to compile on a range of platforms is only half the battle. Sometimes you also need to get it to run fast on all those platforms. Jeff Keasler of Lawrence Livermore National Laboratory has written a tremendously useful article -- It's a pretty powerful technique for avoiding some coding nightmares.