It is better to move this to the function description. It is generic recommendation to not call this function inside a parallel region because It is not guaranteed to work. For the case of OpenMP setNumThreads just do nothing.