mirror of
https://github.com/OpenMP/Examples.git
synced 2025-04-22 05:41:23 +01:00
28 lines
605 B
Fortran
28 lines
605 B
Fortran
! @@name: task_priority.1
|
|
! @@type: F-free
|
|
! @@operation: compile
|
|
! @@expect: success
|
|
! @@version: omp_4.5
|
|
subroutine compute_matrix(matrix, M, N)
|
|
implicit none
|
|
integer :: M, N
|
|
real :: matrix(M, N)
|
|
integer :: i
|
|
interface
|
|
subroutine compute_array(node, M)
|
|
implicit none
|
|
integer :: M
|
|
real :: node(M)
|
|
end subroutine
|
|
end interface
|
|
!$omp parallel private(i)
|
|
!$omp single
|
|
do i=1,N
|
|
!$omp task priority(i)
|
|
call compute_array(matrix(:, i), M)
|
|
!$omp end task
|
|
enddo
|
|
!$omp end single
|
|
!$omp end parallel
|
|
end subroutine compute_matrix
|