Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
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
Model registry
Operate
Environments
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
lbmpy
Commits
26d174f0
Commit
26d174f0
authored
4 years ago
by
Markus Holzer
Browse files
Options
Downloads
Patches
Plain Diff
Removed OpenCL parallel Datahandling test case
parent
f9c36399
No related branches found
No related tags found
1 merge request
!36
Removed OpenCL parallel Datahandling test case
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lbmpy_tests/test_lbstep.py
+22
-17
22 additions, 17 deletions
lbmpy_tests/test_lbstep.py
with
22 additions
and
17 deletions
lbmpy_tests/test_lbstep.py
+
22
−
17
View file @
26d174f0
...
@@ -54,24 +54,29 @@ def test_data_handling_2d_opencl():
...
@@ -54,24 +54,29 @@ def test_data_handling_2d_opencl():
pystencils
.
opencl
.
opencljit
.
init_globally
()
pystencils
.
opencl
.
opencljit
.
init_globally
()
print
(
"
--- LDC 2D test ---
"
)
print
(
"
--- LDC 2D test ---
"
)
results
=
[]
results
=
[]
for
parallel
in
[
True
,
False
]
if
parallel_available
else
[
False
]:
for
gpu
in
[
True
,
False
]
if
gpu_available
else
[
False
]:
if
parallel
and
gpu
and
not
hasattr
(
wLB
,
'
cuda
'
):
continue
print
(
"
Testing parallel: %s
\t
gpu: %s
"
%
(
parallel
,
gpu
))
# Since waLBerla has no OpenCL Backend yet, it is not possible to use the
opt_params
=
{
'
target
'
:
'
opencl
'
if
gpu
else
'
cpu
'
,
# parallel Datahandling with OpenCL at the moment
'
gpu_indexing_params
'
:
{
'
block_size
'
:
(
8
,
4
,
2
)}}
if
parallel
:
# TODO: Activate parallel Datahandling if Backend is available
from
pystencils.datahandling
import
ParallelDataHandling
parallel
=
False
blocks
=
wLB
.
createUniformBlockGrid
(
blocks
=
(
2
,
3
,
1
),
cellsPerBlock
=
(
5
,
5
,
1
),
for
gpu
in
[
True
,
False
]
if
gpu_available
else
[
False
]:
oneBlockPerProcess
=
False
)
if
parallel
and
gpu
and
not
hasattr
(
wLB
,
'
cuda
'
):
dh
=
ParallelDataHandling
(
blocks
,
dim
=
2
)
continue
rho
=
ldc_setup
(
data_handling
=
dh
,
optimization
=
opt_params
)
results
.
append
(
rho
)
print
(
"
Testing parallel: %s
\t
gpu: %s
"
%
(
parallel
,
gpu
))
else
:
opt_params
=
{
'
target
'
:
'
opencl
'
if
gpu
else
'
cpu
'
,
rho
=
ldc_setup
(
domain_size
=
(
10
,
15
),
parallel
=
False
,
optimization
=
opt_params
)
'
gpu_indexing_params
'
:
{
'
block_size
'
:
(
8
,
4
,
2
)}}
results
.
append
(
rho
)
if
parallel
:
from
pystencils.datahandling
import
ParallelDataHandling
blocks
=
wLB
.
createUniformBlockGrid
(
blocks
=
(
2
,
3
,
1
),
cellsPerBlock
=
(
5
,
5
,
1
),
oneBlockPerProcess
=
False
)
dh
=
ParallelDataHandling
(
blocks
,
dim
=
2
)
rho
=
ldc_setup
(
data_handling
=
dh
,
optimization
=
opt_params
)
results
.
append
(
rho
)
else
:
rho
=
ldc_setup
(
domain_size
=
(
10
,
15
),
parallel
=
False
,
optimization
=
opt_params
)
results
.
append
(
rho
)
for
i
,
arr
in
enumerate
(
results
[
1
:]):
for
i
,
arr
in
enumerate
(
results
[
1
:]):
print
(
"
Testing equivalence version 0 with version %d
"
%
(
i
+
1
,))
print
(
"
Testing equivalence version 0 with version %d
"
%
(
i
+
1
,))
np
.
testing
.
assert_almost_equal
(
results
[
0
],
arr
)
np
.
testing
.
assert_almost_equal
(
results
[
0
],
arr
)
...
...
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