Skip to content
Snippets Groups Projects
Commit 4816bfae authored by Markus Holzer's avatar Markus Holzer Committed by Martin Bauer
Browse files

Implemented an improved version of the communication for periodic BC

The communication of the ghost layers used to communicate just all
values in between one time step to make sure that everything is correct.
Furthermore the communication was only valid for pull stream steps.
The improved communication distinguishes automatically between pull and
push and communicates only values which are needed. With this improvement
it was possible to implement the EsoTwist streaming scheme.
parent a8dd0c50
Branches improved_comm
No related merge requests found
...@@ -5,6 +5,7 @@ from pystencils import Field ...@@ -5,6 +5,7 @@ from pystencils import Field
__all__ = ['PdfFieldAccessor', 'CollideOnlyInplaceAccessor', 'StreamPullTwoFieldsAccessor', __all__ = ['PdfFieldAccessor', 'CollideOnlyInplaceAccessor', 'StreamPullTwoFieldsAccessor',
'StreamPushTwoFieldsAccessor',
'AAEvenTimeStepAccessor', 'AAOddTimeStepAccessor', 'AAEvenTimeStepAccessor', 'AAOddTimeStepAccessor',
'EsoTwistEvenTimeStepAccessor', 'EsoTwistOddTimeStepAccessor', 'EsoTwistEvenTimeStepAccessor', 'EsoTwistOddTimeStepAccessor',
'visualize_pdf_field_accessor', 'visualize_field_mapping'] 'visualize_pdf_field_accessor', 'visualize_field_mapping']
...@@ -58,6 +59,16 @@ class StreamPullTwoFieldsAccessor(PdfFieldAccessor): ...@@ -58,6 +59,16 @@ class StreamPullTwoFieldsAccessor(PdfFieldAccessor):
return [field(i) for i in range(len(stencil))] return [field(i) for i in range(len(stencil))]
class StreamPushTwoFieldsAccessor(PdfFieldAccessor):
@staticmethod
def read(field, stencil):
return [field(i) for i in range(len(stencil))]
@staticmethod
def write(field, stencil):
return [field[d](i) for i, d in enumerate(stencil)]
class PeriodicTwoFieldsAccessor(PdfFieldAccessor): class PeriodicTwoFieldsAccessor(PdfFieldAccessor):
"""Access scheme that builds periodicity into the kernel. """Access scheme that builds periodicity into the kernel.
......
...@@ -120,6 +120,7 @@ class LatticeBoltzmannStep: ...@@ -120,6 +120,7 @@ class LatticeBoltzmannStep:
# -- Boundary Handling & Synchronization --- # -- Boundary Handling & Synchronization ---
stencil_name = method_parameters['stencil'] stencil_name = method_parameters['stencil']
self._sync_src = data_handling.synchronization_function([self._pdf_arr_name], stencil_name, target, self._sync_src = data_handling.synchronization_function([self._pdf_arr_name], stencil_name, target,
stencil_restricted=True) stencil_restricted=True)
self._sync_tmp = data_handling.synchronization_function([self._tmp_arr_name], stencil_name, target, self._sync_tmp = data_handling.synchronization_function([self._tmp_arr_name], stencil_name, target,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment