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
Merge requests
!141
Regression comm
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Regression comm
holzer/lbmpy:RegressionComm
into
master
Overview
0
Commits
4
Pipelines
5
Changes
1
Merged
Markus Holzer
requested to merge
holzer/lbmpy:RegressionComm
into
master
2 years ago
Overview
0
Commits
4
Pipelines
5
Changes
1
Expand
Regression for
!139 (merged)
0
0
Merge request reports
Compare
master
version 3
cd7ead9a
2 years ago
version 2
99c3db9b
2 years ago
version 1
468aef7a
2 years ago
master (base)
and
version 2
latest version
12279576
4 commits,
2 years ago
version 3
cd7ead9a
3 commits,
2 years ago
version 2
99c3db9b
2 commits,
2 years ago
version 1
468aef7a
1 commit,
2 years ago
1 file
+
21
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
lbmpy/advanced_streaming/communication.py
+
21
−
1
Options
import
itertools
from
pystencils
import
CreateKernelConfig
,
Field
,
Assignment
,
AssignmentCollection
from
pystencils.slicing
import
shift_slice
,
get_slice_before_ghost_layer
,
normalize_slice
from
lbmpy.advanced_streaming.utility
import
is_inplace
,
get_accessor
,
numeric_index
,
Timestep
,
get_timesteps
from
lbmpy.advanced_streaming.utility
import
is_inplace
,
get_accessor
,
numeric_index
,
\
Timestep
,
get_timesteps
,
numeric_offsets
from
pystencils.datahandling
import
SerialDataHandling
from
pystencils.enums
import
Target
from
itertools
import
chain
@@ -132,6 +133,10 @@ def get_communication_slices(
origin_slice
=
get_slice_before_ghost_layer
(
comm_dir
,
ghost_layers
=
ghost_layers
,
thickness
=
1
)
src_slice
=
_fix_length_one_slices
(
origin_slice
)
write_offsets
=
numeric_offsets
(
write_accesses
[
d
])
tangential_dir
=
tuple
(
s
-
c
for
s
,
c
in
zip
(
streaming_dir
,
comm_dir
))
src_slice
=
shift_slice
(
_trim_slice_in_direction
(
src_slice
,
tangential_dir
),
write_offsets
)
neighbour_transform
=
_get_neighbour_transform
(
comm_dir
,
ghost_layers
)
dst_slice
=
shift_slice
(
src_slice
,
neighbour_transform
)
@@ -210,3 +215,18 @@ def _fix_length_one_slices(slices):
return
slices
else
:
return
tuple
(
_fix_length_one_slices
(
s
)
for
s
in
slices
)
def
_trim_slice_in_direction
(
slices
,
direction
):
assert
len
(
slices
)
==
len
(
direction
)
result
=
[]
for
s
,
d
in
zip
(
slices
,
direction
):
if
isinstance
(
s
,
int
):
result
.
append
(
s
)
continue
start
=
s
.
start
+
1
if
d
==
-
1
else
s
.
start
stop
=
s
.
stop
-
1
if
d
==
1
else
s
.
stop
result
.
append
(
slice
(
start
,
stop
,
s
.
step
))
return
tuple
(
result
)
Loading