Autodetect number of cpu cores at startup