8 ! There are a few functions in the OpenMP library,
9 ! and to use them easily, we need to define the
10 ! return types of these functions.
12 INTEGER , EXTERNAL :: omp_get_num_threads , &
13 omp_get_max_threads , &
14 omp_get_thread_num , &
17 LOGICAL , EXTERNAL :: omp_in_parallel
28 PRINT '(/A,/,A,/,A,I2/)','omp_get_num_threads:', &
29 'Number of threads currently in the team executing', &
30 'the parallel region = ',omp_get_num_threads()
32 PRINT '(A,/,A,/,A,I2/)', 'omp_get_max_threads:', &
33 'Maximum value that can be returned by the',&
34 'omp_get_num_threads function = ',omp_get_max_threads()
36 PRINT '(A,/,A,/,A,I2/)', 'omp_get_thread_num:', &
37 'Returns the thread number, within the team, between', &
38 '0 and omp_get_num_threads-1, inclusive = ',omp_get_thread_num()
40 PRINT '(A,/,A,/,A,I2/)', 'omp_get_num_procs:', &
41 'Returns the number of processors that are available', &
42 'to the program = ',omp_get_num_procs()
44 PRINT '(A,/,A,/,A,L7/)','omp_in_parallel:', &
45 'Returns .TRUE. if called with the dynamic extent of a region', &
46 'executing in parallel, and otherwise .FALSE. = ',omp_in_parallel()
50 END SUBROUTINE omp_info
52 SUBROUTINE init_module_sm
53 END SUBROUTINE init_module_sm