comparison libgomp/testsuite/libgomp.fortran/lastprivate2.f90 @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents a06113de4d67
children 1830386684a0
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
2 integer :: i, k 2 integer :: i, k
3 common /c/ i, k 3 common /c/ i, k
4 !$omp parallel num_threads (4) 4 !$omp parallel num_threads (4)
5 call test1 5 call test1
6 !$omp end parallel 6 !$omp end parallel
7 if (i .ne. 21 .or. k .ne. 20) call abort 7 if (i .ne. 21 .or. k .ne. 20) STOP 1
8 !$omp parallel num_threads (4) 8 !$omp parallel num_threads (4)
9 call test2 9 call test2
10 !$omp end parallel 10 !$omp end parallel
11 if (i .ne. 64 .or. k .ne. 61) call abort 11 if (i .ne. 64 .or. k .ne. 61) STOP 2
12 !$omp parallel num_threads (4) 12 !$omp parallel num_threads (4)
13 call test3 13 call test3
14 !$omp end parallel 14 !$omp end parallel
15 if (i .ne. 14 .or. k .ne. 11) call abort 15 if (i .ne. 14 .or. k .ne. 11) STOP 3
16 call test4 16 call test4
17 call test5 17 call test5
18 call test6 18 call test6
19 call test7 19 call test7
20 call test8 20 call test8
55 integer :: j, l 55 integer :: j, l
56 !$omp parallel do lastprivate (j, l) num_threads (4) 56 !$omp parallel do lastprivate (j, l) num_threads (4)
57 do j = 1, 20 57 do j = 1, 20
58 l = j 58 l = j
59 end do 59 end do
60 if (j .ne. 21 .or. l .ne. 20) call abort 60 if (j .ne. 21 .or. l .ne. 20) STOP 4
61 end subroutine test4 61 end subroutine test4
62 subroutine test5 62 subroutine test5
63 integer :: j, l 63 integer :: j, l
64 l = 77 64 l = 77
65 !$omp parallel do lastprivate (j, l) num_threads (4) firstprivate (l) 65 !$omp parallel do lastprivate (j, l) num_threads (4) firstprivate (l)
66 do j = 7, 61, 3 66 do j = 7, 61, 3
67 l = j 67 l = j
68 end do 68 end do
69 if (j .ne. 64 .or. l .ne. 61) call abort 69 if (j .ne. 64 .or. l .ne. 61) STOP 5
70 end subroutine test5 70 end subroutine test5
71 subroutine test6 71 subroutine test6
72 integer :: j, l 72 integer :: j, l
73 !$omp parallel do lastprivate (j, l) num_threads (4) 73 !$omp parallel do lastprivate (j, l) num_threads (4)
74 do j = -10, 11, ret3 () 74 do j = -10, 11, ret3 ()
75 l = j 75 l = j
76 end do 76 end do
77 if (j .ne. 14 .or. l .ne. 11) call abort 77 if (j .ne. 14 .or. l .ne. 11) STOP 6
78 end subroutine test6 78 end subroutine test6
79 subroutine test7 79 subroutine test7
80 integer :: i, k 80 integer :: i, k
81 common /c/ i, k 81 common /c/ i, k
82 !$omp parallel do lastprivate (i, k) num_threads (4) 82 !$omp parallel do lastprivate (i, k) num_threads (4)
83 do i = 1, 20 83 do i = 1, 20
84 k = i 84 k = i
85 end do 85 end do
86 if (i .ne. 21 .or. k .ne. 20) call abort 86 if (i .ne. 21 .or. k .ne. 20) STOP 7
87 end subroutine test7 87 end subroutine test7
88 subroutine test8 88 subroutine test8
89 integer :: i, k 89 integer :: i, k
90 common /c/ i, k 90 common /c/ i, k
91 !$omp parallel do lastprivate (i, k) num_threads (4) 91 !$omp parallel do lastprivate (i, k) num_threads (4)
92 do i = 7, 61, 3 92 do i = 7, 61, 3
93 k = i 93 k = i
94 end do 94 end do
95 if (i .ne. 64 .or. k .ne. 61) call abort 95 if (i .ne. 64 .or. k .ne. 61) STOP 8
96 end subroutine test8 96 end subroutine test8
97 subroutine test9 97 subroutine test9
98 integer :: i, k 98 integer :: i, k
99 common /c/ i, k 99 common /c/ i, k
100 k = 77 100 k = 77
101 !$omp parallel do lastprivate (i, k) num_threads (4) firstprivate (k) 101 !$omp parallel do lastprivate (i, k) num_threads (4) firstprivate (k)
102 do i = -10, 11, ret3 () 102 do i = -10, 11, ret3 ()
103 k = i 103 k = i
104 end do 104 end do
105 if (i .ne. 14 .or. k .ne. 11) call abort 105 if (i .ne. 14 .or. k .ne. 11) STOP 9
106 end subroutine test9 106 end subroutine test9
107 subroutine test10 107 subroutine test10
108 integer :: i, k 108 integer :: i, k
109 common /c/ i, k 109 common /c/ i, k
110 !$omp parallel num_threads (4) 110 !$omp parallel num_threads (4)
111 !$omp do lastprivate (i, k) 111 !$omp do lastprivate (i, k)
112 do i = 1, 20 112 do i = 1, 20
113 k = i 113 k = i
114 end do 114 end do
115 !$omp end parallel 115 !$omp end parallel
116 if (i .ne. 21 .or. k .ne. 20) call abort 116 if (i .ne. 21 .or. k .ne. 20) STOP 10
117 end subroutine test10 117 end subroutine test10
118 subroutine test11 118 subroutine test11
119 integer :: i, k 119 integer :: i, k
120 common /c/ i, k 120 common /c/ i, k
121 !$omp parallel num_threads (4) 121 !$omp parallel num_threads (4)
122 !$omp do lastprivate (i, k) 122 !$omp do lastprivate (i, k)
123 do i = 7, 61, 3 123 do i = 7, 61, 3
124 k = i 124 k = i
125 end do 125 end do
126 !$omp end parallel 126 !$omp end parallel
127 if (i .ne. 64 .or. k .ne. 61) call abort 127 if (i .ne. 64 .or. k .ne. 61) STOP 11
128 end subroutine test11 128 end subroutine test11
129 subroutine test12 129 subroutine test12
130 integer :: i, k 130 integer :: i, k
131 common /c/ i, k 131 common /c/ i, k
132 k = 77 132 k = 77
134 !$omp do lastprivate (i, k) firstprivate (k) 134 !$omp do lastprivate (i, k) firstprivate (k)
135 do i = -10, 11, ret3 () 135 do i = -10, 11, ret3 ()
136 k = i 136 k = i
137 end do 137 end do
138 !$omp end parallel 138 !$omp end parallel
139 if (i .ne. 14 .or. k .ne. 11) call abort 139 if (i .ne. 14 .or. k .ne. 11) STOP 12
140 end subroutine test12 140 end subroutine test12
141 end program lastprivate 141 end program lastprivate