! ============================================================================ ! Print number of processors found and value of OMP_NUM_THREADS (max_threads) ! Say hello from tid, using i3.3 format for easy sorting ! ! ifort -xCORE-AVX512 -O3 -qopenmp omp_hello.f90 -o omp_hello ! ./omp_hello | sort ! ============================================================================ program omp_hello use omp_lib implicit none integer :: tid tid = omp_get_thread_num() write(*,'(" 0> Hello from Xeon SP")') write(*,'(" 0> Value of omp_get_num_procs(): ",i3)') omp_get_num_procs() write(*,'(" 0> Value of omp_get_max_threads(): ",i3)') omp_get_max_threads() !$omp parallel private(tid) tid = omp_get_thread_num(); write(*,'(" => hello from thread id ",i3.3)') tid !$omp end parallel write(*,'(" x> goodbye from thread id ",i3.3)') tid end program omp_hello