In some environments you may find that it is more beneficial to allow the operating system to control the number of threads actually used in a parallel loop. You can allow for dynamic scheduling by calling the OpenMP routine omp_set_dynamic() with an argument evaluating to .true.. The number of scheduled threads will not exceed the value of omp_get_max_threads(). If this has not been set in your program the value of OMP_NUM_THREADS is used. And if this variable is not set the system supplies a value. This value is different on different systems. On the IBM the value supplied is equal to the number of available processors.
Dynamic scheduling could be of use for example on a shared memory machine with many CPUs and many concurrent users. Try the exercise with some different values for OMP_NUM_THREADS. Does the number of threads that run vary? (It didn't when I tried, so either the system doesn't do dynamic allocation of the number of threads - or the system was not loaded enough when I tried)
Examine the code and make sure you understand what it is that makes the scheduling dynamic, and how the code works. Also, note that the omp_set_dynamic() is not the same kind of control as the environment variable OMP_SCHEDULE='dynamic' (but it is connected to the environment variable OMP_DYNAMIC='TRUE')