Does anyone know if there is, in c++, any way to determine at runtime the cpu characteristics of the machine that compiled the code? For example, in gcc (which I'm using) the preprocessor variable _OPTIMIZE_ indicates compile-time optimization, but I can't find anything on cpu type.
I'm doing some cloud computing on a heterogeneous cluster. Some of the nodes are non-interoperable (code compiled on one will not run on another), while others are partly interoperable (code compiled on one will run on another, but at sub-optimal speed). The first case is easy to check for and deal with, but second case is trickier to detect in an automated way.