get number of threads from the OMP_NUM_THREADS variable, if specified