Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPC Benchmark Game
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dorian Stoll
HPC Benchmark Game
Commits
69bfdb64
Verified
Commit
69bfdb64
authored
7 months ago
by
Dorian Stoll
Browse files
Options
Downloads
Patches
Plain Diff
nas-ft: julia: Make grid size and iterations configurable
parent
c84cf77d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/benchmarks/nas-ft/julia/src/ft.jl
+32
-37
32 additions, 37 deletions
src/benchmarks/nas-ft/julia/src/ft.jl
with
32 additions
and
37 deletions
src/benchmarks/nas-ft/julia/src/ft.jl
+
32
−
37
View file @
69bfdb64
...
...
@@ -3,18 +3,6 @@
using
FLoops
using
Printf
# Class C
const
NX
::
Int
=
512
const
NY
::
Int
=
512
const
NZ
::
Int
=
512
const
MAXDIM
::
Int
=
512
const
NITER_DEFAULT
::
Int
=
20
# Total number of grid points with padding
const
NXP
::
Int
=
NX
+
1
const
NTOTALP
::
Int
=
NXP
*
NY
*
NZ
const
NTOTALF
::
Float64
=
Float64
(
NXP
)
*
NY
*
NZ
# If processor array is 1x1 -> 0D grid decomposition
# Cache blocking params. These values are good for most RISC processors.
...
...
@@ -49,6 +37,8 @@ mutable struct FT
d1
::
Int
d2
::
Int
d3
::
Int
maxdim
::
Int
end
function
ilog2
(
n
::
Int
)
::
Int
...
...
@@ -67,16 +57,15 @@ function ilog2(n::Int)::Int
return
lg
end
function
setup
()
::
FT
function
setup
(
nx
::
Int
,
ny
::
Int
,
nz
::
Int
,
iterations
::
Int
)
::
FT
debug
::
Bool
=
false
niter
::
Int
=
NITER_DEFAULT
@printf
"
\n
"
@printf
"
\n
"
@printf
" NAS Parallel Benchmarks (NPB3.4-OMP) - FT Benchmark
\n
"
@printf
"
\n
"
@printf
" Size : %dx%dx%d
\n
"
NX
NY
NZ
@printf
" Iterations : %d
\n
"
n
iter
@printf
" Size : %dx%dx%d
\n
"
nx
ny
nz
@printf
" Iterations : %d
\n
"
iter
ations
@printf
" Number of available threads : %d
\n
"
Threads
.
nthreads
()
@printf
"
\n
"
...
...
@@ -98,22 +87,21 @@ function setup()::FT
fftblock
::
Int
=
FFTBLOCK_DEFAULT
fftblockpad
::
Int
=
FFTBLOCKPAD_DEFAULT
if
fftblock
!=
FFTBLOCK_DEFAULT
fftblockpad
=
FFTBLOCK_DEFAULT
+
3
end
nxp
::
Int
=
nx
+
1
return
FT
(
debug
,
n
iter
,
iter
ations
,
fftblock
,
fftblockpad
,
zeros
(
ComplexF64
,
NXP
),
zeros
(
ComplexF64
,
(
NXP
,
NY
,
NZ
)),
zeros
(
ComplexF64
,
(
NXP
,
NY
,
NZ
)),
zeros
(
Float64
,
(
NXP
,
NY
,
NZ
)),
NX
,
NY
,
NZ
,
zeros
(
ComplexF64
,
nxp
),
zeros
(
ComplexF64
,
(
nxp
,
ny
,
nz
)),
zeros
(
ComplexF64
,
(
nxp
,
ny
,
nz
)),
zeros
(
Float64
,
(
nxp
,
ny
,
nz
)),
nx
,
ny
,
nz
,
max
(
nx
,
max
(
ny
,
nz
)),
)
end
...
...
@@ -216,8 +204,8 @@ function cffts1(ft::FT, is::Int, x::Array{ComplexF64,3}, xout::Array{ComplexF64,
logd1
::
Int
=
ilog2
(
ft
.
d1
)
@floop
for
k
=
1
:
ft
.
d3
,
jn
=
0
:
ft
.
d2
/
ft
.
fftblock
-
1
@init
y1
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
MAXDIM
))
@init
y2
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
MAXDIM
))
@init
y1
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
ft
.
maxdim
))
@init
y2
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
ft
.
maxdim
))
jj
::
Int
=
jn
*
ft
.
fftblock
...
...
@@ -237,8 +225,8 @@ function cffts2(ft::FT, is::Int, x::Array{ComplexF64,3}, xout::Array{ComplexF64,
logd2
::
Int
=
ilog2
(
ft
.
d2
)
@floop
for
k
=
1
:
ft
.
d3
,
in
=
0
:
ft
.
d1
/
ft
.
fftblock
-
1
@init
y1
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
MAXDIM
))
@init
y2
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
MAXDIM
))
@init
y1
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
ft
.
maxdim
))
@init
y2
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
ft
.
maxdim
))
ii
::
Int
=
in
*
ft
.
fftblock
...
...
@@ -258,8 +246,8 @@ function cffts3(ft::FT, is::Int, x::Array{ComplexF64,3}, xout::Array{ComplexF64,
logd3
::
Int
=
ilog2
(
ft
.
d3
)
@floop
for
j
=
1
:
ft
.
d2
,
in
=
0
:
ft
.
d1
/
ft
.
fftblock
-
1
@init
y1
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
MAXDIM
))
@init
y2
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
MAXDIM
))
@init
y1
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
ft
.
maxdim
))
@init
y2
=
zeros
(
ComplexF64
,
(
ft
.
fftblockpad
,
ft
.
maxdim
))
ii
::
Int
=
in
*
ft
.
fftblock
...
...
@@ -371,13 +359,20 @@ function checksum(ft::FT, i::Int)
@reduce
chk
+=
ft
.
u1
[
q
,
r
,
s
]
end
chk
/=
NTOTALF
chk
/=
Float64
(
ft
.
d1
*
ft
.
d2
*
ft
.
d3
)
@printf
" T = %d Checksum = %.10E %.10E
\n
"
i
real
(
chk
)
imag
(
chk
)
end
function
main
()
ft
::
FT
=
setup
()
function
main
(
args
::
Vector
{
String
})
@assert
len
(
args
)
==
4
nx
::
Int
=
parse
(
Int
,
args
[
1
])
ny
::
Int
=
parse
(
Int
,
args
[
2
])
nz
::
Int
=
parse
(
Int
,
args
[
3
])
it
::
Int
=
parse
(
Int
,
args
[
4
])
ft
::
FT
=
setup
(
nx
,
ny
,
nz
,
it
)
# ---------------------------------------------------------------------
# Run the entire problem once to make sure all data is touched.
...
...
@@ -405,4 +400,4 @@ function main()
end
end
main
()
main
(
ARGS
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment