Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonas Plewinski
pystencils
Commits
0d6422fb
Commit
0d6422fb
authored
Apr 30, 2018
by
Martin Bauer
Browse files
Changed notebook testrunner: use modules instead of exec
- works also with ps.kernel decorator
parent
1a37be50
Changes
1
Hide whitespace changes
Inline
Side-by-side
datahandling/__init__.py
View file @
0d6422fb
...
...
@@ -17,19 +17,19 @@ except ImportError:
def
create_data_handling
(
domain_size
:
Tuple
[
int
,
...],
periodicity
:
Union
[
bool
,
Tuple
[
bool
,
...]]
=
False
,
default_layout
:
str
=
'SoA'
,
default_target
:
str
=
'cpu'
,
parallel
:
bool
=
False
,
default_ghost_layers
:
int
=
1
)
->
DataHandling
:
"""Creates a data handling instance.
Args:
parallel:
domain_size:
periodicity:
default_layout:
default_ghost_layers:
Returns:
domain_size: size of the rectangular domain
periodicity: either True, False for full or no periodicity or a tuple of booleans indicating periodicity
for each coordinate
default_layout: default array layout, that is used if not explicitly specified in 'add_array'
default_target: either 'cpu' or 'gpu'
parallel: if True a parallel domain is created using walberla - each MPI process gets a part of the domain
default_ghost_layers: default number of ghost layers if not overwritten in 'add_array'
"""
if
parallel
:
if
wlb
is
None
:
...
...
@@ -52,10 +52,10 @@ def create_data_handling(domain_size: Tuple[int, ...],
# noinspection PyArgumentList
block_storage
=
wlb
.
createUniformBlockGrid
(
cells
=
domain_size
,
periodic
=
periodicity
)
return
ParallelDataHandling
(
blocks
=
block_storage
,
dim
=
dim
,
return
ParallelDataHandling
(
blocks
=
block_storage
,
dim
=
dim
,
default_target
=
default_target
,
default_layout
=
default_layout
,
default_ghost_layers
=
default_ghost_layers
)
else
:
return
SerialDataHandling
(
domain_size
,
periodicity
=
periodicity
,
return
SerialDataHandling
(
domain_size
,
periodicity
=
periodicity
,
default_target
=
default_target
,
default_layout
=
default_layout
,
default_ghost_layers
=
default_ghost_layers
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment