Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
LGPU FPP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Fernando Pérez Panadero
LGPU FPP
Commits
da417964
Commit
da417964
authored
Jul 07, 2023
by
Fernando Pérez Panadero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
not workking test timings
parent
339f9e1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
6 deletions
+49
-6
test/dirac/test_fp_fa.jl
test/dirac/test_fp_fa.jl
+18
-2
test/dirac/test_solver_plw.jl
test/dirac/test_solver_plw.jl
+23
-3
test/dirac/test_solver_rand.jl
test/dirac/test_solver_rand.jl
+8
-1
No files found.
test/dirac/test_fp_fa.jl
View file @
da417964
using
LatticeGPU
using
CUDA
using
TimerOutputs
@timeit
"fA_fP test"
let
function
bndpropagator
(
U
,
dpar
::
DiracParam
{
T
},
dws
::
DiracWorkspace
,
lp
::
SpaceParm
{
4
,
6
,
1
,
D
},
maxiter
::
Int64
,
tol
::
Float64
,
c
::
Int64
,
s
::
Int64
)
where
{
T
,
D
}
...
...
@@ -42,6 +45,8 @@ end
function
fP_test
(;
theta
=
(
0.5
,
0.7
,
1.0
,
0.0
),
m
=
1.3
,
size
=
(
8
,
8
,
8
,
16
),
prec
=
1.0e-16
)
@timeit
"fP inversion (x12)"
let
lp
=
SpaceParm
{
4
}(
size
,(
4
,
4
,
4
,
4
),
1
,(
0
,
0
,
0
,
0
,
0
,
0
));
exptheta
=
exp
.
(
im
.*
theta
./
lp
.
iL
);
...
...
@@ -67,6 +72,10 @@ for s in 1:4 for c in 1:3
end
end
end
@timeit
"fP analitical solution"
let
#THEORETICAL SOLUTION: hep-lat/9606016 eq (2.33)
res_th
=
zeros
(
lp
.
iL
[
4
])
...
...
@@ -81,7 +90,7 @@ end end
res_th
[
i
]
=
(
2
*
3
*
sinh
(
omega
)
/
(
Rpp
^
2
))
*
(
(
Mpp
+
sinh
(
omega
))
*
exp
(
-
2
*
omega
*
(
i
-
1
))
-
(
Mpp
-
sinh
(
omega
))
*
exp
(
-
2
*
omega
*
(
2
*
lp
.
iL
[
4
]
-
(
i
-
1
)))
)
end
end
return
sum
(
abs
.
(
res
-
res_th
))
end
...
...
@@ -90,6 +99,8 @@ end
function
fA_test
(;
theta
=
(
0.5
,
0.7
,
1.0
,
0.0
),
m
=
1.3
,
size
=
(
8
,
8
,
8
,
16
),
prec
=
1.0e-16
)
@timeit
"fA inversion (x12)"
let
lp
=
SpaceParm
{
4
}(
size
,(
4
,
4
,
4
,
4
),
1
,(
0
,
0
,
0
,
0
,
0
,
0
));
exptheta
=
exp
.
(
im
.*
theta
./
lp
.
iL
);
...
...
@@ -115,8 +126,10 @@ function fA_test(;theta = (0.5,0.7,1.0,0.0), m = 1.3, size = (8,8,8,16),prec = 1
end
end
end
#THEORETICAL SOLUTION: hep-lat/9606016 eq (2.32)
@timeit
"fA analitical solution"
let
res_th
=
zeros
(
lp
.
iL
[
4
])
pp3
=
ntuple
(
i
->
theta
[
i
]
/
lp
.
iL
[
i
],
3
)
...
...
@@ -130,6 +143,7 @@ function fA_test(;theta = (0.5,0.7,1.0,0.0), m = 1.3, size = (8,8,8,16),prec = 1
-
Mpp
*
((
Mpp
+
sinh
(
omega
))
*
exp
(
-
2
*
omega
*
(
i
-
1
))
+
(
Mpp
-
sinh
(
omega
))
*
exp
(
-
2
*
omega
*
(
2
*
lp
.
iL
[
4
]
-
(
i
-
1
)))))
end
end
return
sum
(
abs
.
(
res
-
res_th
))
...
...
@@ -146,3 +160,5 @@ elseif difP > 1.0e-15
else
print
(
"fA & fP tests passed with errors: "
,
difA
,
" and "
,
difP
,
"!
\n
"
)
end
end
test/dirac/test_solver_plw.jl
View file @
da417964
using
LatticeGPU
,
CUDA
using
LatticeGPU
,
CUDA
,
TimerOutputs
#Test for the relation Dw(n|m)^{-1} e^(ipm) = D(p)^{-1} e^{ipn} with a given momenta (if p=0 its randomized), spin and color
@timeit
"Plw test"
begin
function
Dwpw_test
(;
p
=
0
,
s
=
1
,
c
=
1
)
lp
=
SpaceParm
{
4
}((
16
,
16
,
16
,
16
),
(
4
,
4
,
4
,
4
),
0
,
(
0
,
0
,
0
,
0
,
0
,
0
))
gp
=
GaugeParm
{
Float64
}(
SU3
{
Float64
},
6.0
,
1.0
)
...
...
@@ -15,16 +17,23 @@ U = fill!(vector_field(SU3{Float64},lp),one(SU3{Float64}))
rm
=
2
*
pi
*
p
./
(
lp
.
iL
)
rmom
=
(
rm
[
1
],
rm
[
2
],
rm
[
3
],
rm
[
4
])
@timeit
"Generate plane wave"
begin
pwave
=
fill!
(
scalar_field
(
Spinor
{
4
,
SU3fund
{
Float64
}},
lp
),
zero
(
eltype
(
scalar_field
(
Spinor
{
4
,
SU3fund
{
Float64
}},
lp
))))
prop
=
scalar_field
(
Spinor
{
4
,
SU3fund
{
Float64
}},
lp
)
prop_th
=
fill!
(
scalar_field
(
Spinor
{
4
,
SU3fund
{
Float64
}},
lp
),
zero
(
eltype
(
scalar_field
(
Spinor
{
4
,
SU3fund
{
Float64
}},
lp
))))
#Generate plane wave
for
x
in
1
:
lp
.
iL
[
1
]
for
y
in
1
:
lp
.
iL
[
2
]
for
z
in
1
:
lp
.
iL
[
3
]
for
t
in
1
:
lp
.
iL
[
4
]
CUDA
.
@allowscalar
pwave
[
point_index
(
CartesianIndex
{
lp
.
ndim
}((
x
,
y
,
z
,
t
)),
lp
)
...
]
=
exp
(
im
*
(
x
*
rmom
[
1
]
+
y
*
rmom
[
2
]
+
z
*
rmom
[
3
]
+
t
*
rmom
[
4
]))
*
Spinor
{
4
,
SU3fund
{
Float64
}}(
ntuple
(
i
->
(
i
==
s
)
*
SU3fund
{
Float64
}(
ntuple
(
j
->
(
j
==
c
)
*
1.0
,
3
)
...
),
4
))
end
end
end
end
end
@timeit
"Generate analitical solution"
begin
#Th solution
if
s
==
1
...
...
@@ -53,8 +62,15 @@ else
end
end
end
end
end
end
end
#compute Sum{x} D^-1(x|y)P(y)
@timeit
"Solving propagator"
begin
function
krnlg5
!
(
src
)
b
=
Int64
(
CUDA
.
threadIdx
()
.
x
)
r
=
Int64
(
CUDA
.
blockIdx
()
.
x
)
...
...
@@ -67,7 +83,7 @@ CUDA.@sync begin
end
g5Dw!
(
prop
,
U
,
pwave
,
dpar
,
lp
)
CG!
(
prop
,
U
,
DwdagDw!
,
dpar
,
lp
,
dws
,
ymws
,
gp
,
10000
,
1.0e-14
)
end
dif
=
sum
(
norm2
.
(
prop
-
prop_th
))
...
...
@@ -75,10 +91,12 @@ if dif > 1.0e-15
error
(
"Dwpl test for s="
,
s
,
", c="
,
c
,
" failed with difference: "
,
dif
,
"
\n
"
)
end
end
return
dif
end
let
begin
dif
=
0.0
for
i
in
1
:
3
for
j
in
1
:
4
dif
+=
Dwpw_test
(
c
=
i
,
s
=
j
)
...
...
@@ -86,3 +104,5 @@ end end
print
(
"Dwpl test passed with average error "
,
dif
/
12
,
"!
\n
"
)
end
end
test/dirac/test_solver_rand.jl
View file @
da417964
using
CUDA
,
LatticeGPU
using
CUDA
,
LatticeGPU
,
TimerOutputs
#Check that Dw ( (DwdagDw)^{-1} g5 Dw g5 ) psi = psi for random fields
@timeit
"Rand solver test"
let
function
pfrandomize
!
(
f
,
lp
::
SpaceParm
,
dpar
::
DiracParam
)
if
dpar
.
rep
==
SU3fund
&&
lp
.
ndim
==
4
...
...
@@ -30,6 +32,8 @@ function krnl_assign_pf!(f::AbstractArray{T}, p ,lp::SpaceParm) where {T}
end
@timeit
"Generate random fields"
let
lp
=
SpaceParm
{
4
}((
16
,
16
,
16
,
16
),
(
4
,
4
,
4
,
4
),
0
,
(
0
,
0
,
0
,
0
,
0
,
0
))
gp
=
GaugeParm
{
Float64
}(
SU3
{
Float64
},
6.0
,
1.0
)
ymws
=
YMworkspace
(
SU3
,
Float64
,
lp
)
...
...
@@ -44,6 +48,8 @@ U = exp.(ymws.mom)
rpsi
=
scalar_field
(
Spinor
{
4
,
SU3fund
{
Float64
}},
lp
)
pfrandomize!
(
rpsi
,
lp
,
dpar
)
end
prop
=
scalar_field
(
Spinor
{
4
,
SU3fund
{
Float64
}},
lp
)
function
krnlg5
!
(
src
)
...
...
@@ -75,3 +81,4 @@ else
error
(
"Drand test failed with difference: "
,
res
,
"
\n
"
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment