Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
Stephan Seitz
pystencils
Commits
b3deafd5
Commit
b3deafd5
authored
5 years ago
by
Michael Kuron
Browse files
Options
Downloads
Patches
Plain Diff
Correct number of ghost layers in create_staggered_kernel
parent
44a924db
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pystencils/cpu/kernelcreation.py
+1
-0
1 addition, 0 deletions
pystencils/cpu/kernelcreation.py
pystencils/kernelcreation.py
+6
-6
6 additions, 6 deletions
pystencils/kernelcreation.py
with
7 additions
and
6 deletions
pystencils/cpu/kernelcreation.py
+
1
−
0
View file @
b3deafd5
...
...
@@ -34,6 +34,7 @@ def create_kernel(assignments: AssignmentOrAstNodeList, function_name: str = "ke
transformation :func:`pystencils.transformation.split_inner_loop`
iteration_slice: if not None, iteration is done only over this slice of the field
ghost_layers: a sequence of pairs for each coordinate with lower and upper nr of ghost layers
that should be excluded from the iteration.
if None, the number of ghost layers is determined automatically and assumed to be equal for a
all dimensions
skip_independence_check: don
'
t check that loop iterations are independent. This is needed e.g. for
...
...
This diff is collapsed.
Click to expand it.
pystencils/kernelcreation.py
+
6
−
6
View file @
b3deafd5
...
...
@@ -36,9 +36,9 @@ def create_kernel(assignments,
to type
iteration_slice: rectangular subset to iterate over, if not specified the complete non-ghost layer
\
part of the field is iterated over
ghost_layers:
if left to default, the number of necessary ghost layers is determined automatically
a single integer specifies the ghost layer count at all borders, can also be a sequence of
pairs ``[(x_lower_gl, x_upper_gl), .... ]``
ghost_layers:
a single integer specifies the ghost layer count at all borders, can also be a sequence of
pairs ``[(x_lower_gl, x_upper_gl), .... ]``. These layers are excluded from the iteration.
If left to default, the number of ghost layers is determined automatically.
skip_independence_check: don
'
t check that loop iterations are independent. This is needed e.g. for
periodicity kernel, that access the field outside the iteration bounds. Use with care!
cpu_openmp: True or number of threads for OpenMP parallelization, False for no OpenMP
...
...
@@ -249,14 +249,14 @@ def create_staggered_kernel(assignments, gpu_exclusive_conditions=False, **kwarg
for
elementary_direction
in
direction
:
exclusions
.
remove
(
inverse_direction_string
(
elementary_direction
))
common_exclusions
.
intersection_update
(
exclusions
)
ghost_layers
=
[[
1
,
1
]
for
d
in
range
(
dim
)]
ghost_layers
=
[[
0
,
0
]
for
d
in
range
(
dim
)]
for
direction
in
common_exclusions
:
direction
=
direction_string_to_offset
(
direction
)
for
d
,
s
in
enumerate
(
direction
):
if
s
==
1
:
ghost_layers
[
d
][
0
]
=
0
ghost_layers
[
d
][
1
]
=
1
elif
s
==
-
1
:
ghost_layers
[
d
][
1
]
=
0
ghost_layers
[
d
][
0
]
=
1
def
condition
(
direction
):
"""
exclude those staggered points that correspond to fluxes between ghost cells
"""
...
...
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