Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
FerFlow.jl
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
FerFlow.jl
Commits
c0211558
Commit
c0211558
authored
3 months ago
by
Fernando Pérez Panadero
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Volume sum improvement atttempt.
parent
f217d551
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
7 deletions
+38
-7
src/meas.jl
src/meas.jl
+38
-7
No files found.
src/meas.jl
View file @
c0211558
...
@@ -87,15 +87,12 @@ function Frontflow_pt() # Will be Frontflow
...
@@ -87,15 +87,12 @@ function Frontflow_pt() # Will be Frontflow
Eoft
[
tstep
+
1
,
:
]
.=
sum
(
Eofpla
,
dims
=
2
)
Eoft
[
tstep
+
1
,
:
]
.=
sum
(
Eofpla
,
dims
=
2
)
end
end
pp_density
.=
Array
(
norm2
.
(
psi
))
ap_density
.=
Array
(
dot
.
(
psi
,
dmul
.
(
Gamma
{
4
},
psi
)))
pp_corr_t
[
:
,
noi
,
tstep
]
.=
zero
(
Float64
)
pp_corr_t
[
:
,
noi
,
tstep
]
.=
zero
(
Float64
)
ap_corr_t
[
:
,
noi
,
tstep
]
.=
zero
(
ComplexF64
)
ap_corr_t
[
:
,
noi
,
tstep
]
.=
zero
(
ComplexF64
)
@timeit
"Volume sum"
for
b
in
1
:
lp
.
bsz
for
r
in
1
:
lp
.
rsz
@timeit
"Volume sum performance test"
begin
t
=
point_time
((
b
,
r
),
lp
)
pp_corr_t
[
:
,
noi
,
tstep
]
.=
scalar_contraction
(
psi
)
pp_corr_t
[
t
,
noi
,
tstep
]
+=
pp_density
[
b
,
r
]
ap_corr_t
[
:
,
noi
,
tstep
]
.=
gammazero_contraction
(
psi
)
ap_corr_t
[
t
,
noi
,
tstep
]
+=
ap_density
[
b
,
r
]
end
end
end
flw
(
U
,
psi
,
int
,
1
,
params
[
"Frontflow"
][
"epsilon"
],
gp
,
dpar
,
lp
,
ymws
,
dws
)
flw
(
U
,
psi
,
int
,
1
,
params
[
"Frontflow"
][
"epsilon"
],
gp
,
dpar
,
lp
,
ymws
,
dws
)
end
end
...
@@ -349,3 +346,37 @@ function Two_pt_lagrange() # Will be 2pt lagrange mult
...
@@ -349,3 +346,37 @@ function Two_pt_lagrange() # Will be 2pt lagrange mult
return
nothing
return
nothing
end
end
function
krnl_scalar_contraction
!
(
rm
,
psi
,
lp
)
@inbounds
begin
b
=
Int64
(
CUDA
.
threadIdx
()
.
x
)
r
=
Int64
(
CUDA
.
blockIdx
()
.
x
)
I
=
point_coord
((
b
,
r
),
lp
)
rm
[
I
]
=
norm2
(
psi
[
b
,
r
])
end
return
nothing
end
function
scalar_contraction
(
psi
)
CUDA
.
@sync
begin
CUDA
.
@cuda
threads
=
lp
.
bsz
blocks
=
lp
.
rsz
krnl_scalar_contraction!
(
ymws
.
rm
,
psi
,
lp
)
end
return
reshape
(
Array
(
CUDA
.
reduce
(
+
,
ymws
.
rm
;
dims
=
(
1
,
2
,
3
))),
lp
.
iL
[
end
])
end
function
krnl_gammazero_contraction
!
(
cm
,
psi
,
lp
)
@inbounds
begin
b
=
Int64
(
CUDA
.
threadIdx
()
.
x
)
r
=
Int64
(
CUDA
.
blockIdx
()
.
x
)
I
=
point_coord
((
b
,
r
),
lp
)
cm
[
I
]
=
dot
(
psi
[
b
,
r
],
dmul
(
Gamma
{
4
},
psi
[
b
,
r
]))
end
return
nothing
end
function
gammazero_contraction
(
psi
)
CUDA
.
@sync
begin
CUDA
.
@cuda
threads
=
lp
.
bsz
blocks
=
lp
.
rsz
krnl_gammazero_contraction!
(
ymws
.
cm
,
psi
,
lp
)
end
return
reshape
(
Array
(
CUDA
.
reduce
(
+
,
ymws
.
cm
;
dims
=
(
1
,
2
,
3
))),
lp
.
iL
[
end
])
end
This diff is collapsed.
Click to expand it.
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