find the number of cores on a machine

numCPU = sysconf( _SC_NPROCESSORS_ONLN );

via c++ – Programmatically find the number of cores on a machine – Stack Overflow.