Presumably there is a library or simple asm blob that can get me the number of the current CPU that I am executing on.
sysconf(_SC_NPROCESSORS_ONLN);