Using OMP SINGLE in an OpenMP program

This exercise presents a simple program to demonstrate the use of OMP SINGLE. Compile and run the code provided below. Run several times. What happens if you remove the OMP SINGLE/OMP END SINGLE lines?

 

      PROGRAM SINGLE_USE
      INTEGER omp_get_thread_num
!$OMP PARALLEL
!$OMP SINGLE
      PRINT *, omp_get_thread_num(), "   YOU SHOULD ONLY SEE THIS ONCE"
!$OMP END SINGLE
!$OMP END PARALLEL
      END