37 real(kind=
kreal),
intent(in) :: x(:)
38 real(kind=
kreal),
intent(out) :: y(:)
39 real(kind=
kreal),
intent(inout) :: time_ax
40 real(kind=
kreal),
intent(inout),
optional :: commtime
42 real(kind=
kreal) :: start_time, end_time, tcomm
43 integer(kind=kint) :: i, j, js, je, in
44 real(kind=
kreal) :: yv1, yv2, yv3, x1, x2, x3
45 real(kind=
kreal) :: yv4, yv5, yv6, x4, x5, x6
47 integer(kind=kint) :: n, np
48 integer(kind=kint),
pointer :: indexl(:), iteml(:), indexu(:), itemu(:)
49 real(kind=
kreal),
pointer :: al(:), au(:), d(:)
52 integer,
parameter :: numofblockperthread = 100
53 logical,
save :: isfirst = .true.
54 integer,
save :: numofthread = 1
55 integer,
save,
allocatable :: startpos(:), endpos(:)
56 integer(kind=kint),
save :: sectorcachesize0, sectorcachesize1
57 integer(kind=kint) :: threadnum, blocknum, numofblock
58 integer(kind=kint) :: numofelement, elementcount, blockindex
59 real(kind=
kreal) :: numofelementperblock
67 time_ax = time_ax + end_time - start_time - tcomm
68 if (
present(commtime)) commtime = commtime + tcomm
73 indexl => hecmat%indexL
74 indexu => hecmat%indexU
82 if (isfirst .eqv. .true.)
then
84 numofblock = numofthread * numofblockperthread
85 allocate (startpos(0 : numofblock - 1), endpos(0 : numofblock - 1))
86 numofelement = n + indexl(n) + indexu(n)
87 numofelementperblock = dble(numofelement) / numofblock
90 startpos(blocknum) = 1
92 elementcount = elementcount + 1
93 elementcount = elementcount + (indexl(i) - indexl(i-1))
94 elementcount = elementcount + (indexu(i) - indexu(i-1))
95 if (elementcount > (blocknum + 1) * numofelementperblock)
then
99 blocknum = blocknum + 1
100 startpos(blocknum) = i + 1
101 if (blocknum == (numofblock - 1))
exit
108 do i= blocknum+1, numofblock-1
116 sectorcachesize0, sectorcachesize1)
125 if (
present(commtime)) commtime = commtime + end_time - start_time
140 do blocknum = 0 , numofblockperthread - 1
141 blockindex = blocknum * numofthread + threadnum
142 do i = startpos(blockindex), endpos(blockindex)
149 yv1= d(36*i-35)*x1 + d(36*i-34)*x2 + d(36*i-33)*x3 + d(36*i-32)*x4 + d(36*i-31)*x5 + d(36*i-30)*x6
150 yv2= d(36*i-29)*x1 + d(36*i-28)*x2 + d(36*i-27)*x3 + d(36*i-26)*x4 + d(36*i-25)*x5 + d(36*i-24)*x6
151 yv3= d(36*i-23)*x1 + d(36*i-22)*x2 + d(36*i-21)*x3 + d(36*i-20)*x4 + d(36*i-19)*x5 + d(36*i-18)*x6
152 yv4= d(36*i-17)*x1 + d(36*i-16)*x2 + d(36*i-15)*x3 + d(36*i-14)*x4 + d(36*i-13)*x5 + d(36*i-12)*x6
153 yv5= d(36*i-11)*x1 + d(36*i-10)*x2 + d(36*i-9 )*x3 + d(36*i-8 )*x4 + d(36*i-7 )*x5 + d(36*i-6 )*x6
154 yv6= d(36*i-5 )*x1 + d(36*i-4 )*x2 + d(36*i-3 )*x3 + d(36*i-2 )*x4 + d(36*i-1 )*x5 + d(36*i )*x6
166 yv1= yv1 + al(36*j-35)*x1 + al(36*j-34)*x2 + al(36*j-33)*x3 + al(36*j-32)*x4 + al(36*j-31)*x5 + al(36*j-30)*x6
167 yv2= yv2 + al(36*j-29)*x1 + al(36*j-28)*x2 + al(36*j-27)*x3 + al(36*j-26)*x4 + al(36*j-25)*x5 + al(36*j-24)*x6
168 yv3= yv3 + al(36*j-23)*x1 + al(36*j-22)*x2 + al(36*j-21)*x3 + al(36*j-20)*x4 + al(36*j-19)*x5 + al(36*j-18)*x6
169 yv4= yv4 + al(36*j-17)*x1 + al(36*j-16)*x2 + al(36*j-15)*x3 + al(36*j-14)*x4 + al(36*j-13)*x5 + al(36*j-12)*x6
170 yv5= yv5 + al(36*j-11)*x1 + al(36*j-10)*x2 + al(36*j-9 )*x3 + al(36*j-8 )*x4 + al(36*j-7 )*x5 + al(36*j-6 )*x6
171 yv6= yv6 + al(36*j-5 )*x1 + al(36*j-4 )*x2 + al(36*j-3 )*x3 + al(36*j-2 )*x4 + al(36*j-1 )*x5 + al(36*j )*x6
183 yv1= yv1 + au(36*j-35)*x1 + au(36*j-34)*x2 + au(36*j-33)*x3 + au(36*j-32)*x4 + au(36*j-31)*x5 + au(36*j-30)*x6
184 yv2= yv2 + au(36*j-29)*x1 + au(36*j-28)*x2 + au(36*j-27)*x3 + au(36*j-26)*x4 + au(36*j-25)*x5 + au(36*j-24)*x6
185 yv3= yv3 + au(36*j-23)*x1 + au(36*j-22)*x2 + au(36*j-21)*x3 + au(36*j-20)*x4 + au(36*j-19)*x5 + au(36*j-18)*x6
186 yv4= yv4 + au(36*j-17)*x1 + au(36*j-16)*x2 + au(36*j-15)*x3 + au(36*j-14)*x4 + au(36*j-13)*x5 + au(36*j-12)*x6
187 yv5= yv5 + au(36*j-11)*x1 + au(36*j-10)*x2 + au(36*j-9 )*x3 + au(36*j-8 )*x4 + au(36*j-7 )*x5 + au(36*j-6 )*x6
188 yv6= yv6 + au(36*j-5 )*x1 + au(36*j-4 )*x2 + au(36*j-3 )*x3 + au(36*j-2 )*x4 + au(36*j-1 )*x5 + au(36*j )*x6
207 time_ax = time_ax + end_time - start_time
222 real(kind=
kreal),
intent(in) :: x(:), b(:)
223 real(kind=
kreal),
intent(out) :: r(:)
224 real(kind=
kreal),
intent(inout) :: time_ax
225 real(kind=
kreal),
intent(inout),
optional :: commtime
227 integer(kind=kint) :: i
228 real(kind=
kreal) :: tcomm
232 if (
present(commtime)) commtime = commtime + tcomm
233 do i = 1, hecmat%N * 6
251 real(kind=
kreal),
intent(inout) :: time_ax
252 real(kind=
kreal),
intent(inout),
optional :: commtime
254 real(kind=
kreal),
allocatable :: r(:)
255 real(kind=
kreal) :: bnorm2, rnorm2
256 real(kind=
kreal) :: tcomm
258 allocate(r(hecmat%NDOF*hecmat%NP))
262 hecmat%B, hecmat%B, bnorm2, tcomm)
263 if (bnorm2 == 0.d0)
then
270 if (
present(commtime)) commtime = commtime + tcomm
285 real(kind=
kreal),
intent(in) :: x(:)
286 real(kind=
kreal),
intent(out) :: y(:)
287 real(kind=
kreal),
intent(inout) :: commtime
289 real(kind=
kreal) :: start_time, end_time
290 integer(kind=kint) :: i
295 commtime = commtime + end_time - start_time
297 do i= 1, hecmesh%nn_internal * hecmesh%n_dof
323 real(kind=
kreal),
intent(in) :: x(:)
324 real(kind=
kreal),
intent(out) :: y(:)
325 real(kind=
kreal),
intent(inout) :: commtime
327 real(kind=
kreal) :: start_time, end_time
328 integer(kind=kint) :: i
333 commtime = commtime + end_time - start_time
335 do i= 1, hecmesh%nn_internal * hecmesh%n_dof
361 real(kind=
kreal),
intent(in) :: x(:)
362 real(kind=
kreal),
intent(out) :: y(:), w(:)
363 real(kind=
kreal),
intent(inout) :: time_ax
364 real(kind=
kreal),
intent(inout) :: commtime