calc_cores to automate core generation