Added code to get the number of available cores, and use it to compute default number of cores.