setCores function

Set the number of cores to use for openMP.