Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[MPI] Add MPI support to periodic triangulation #946

Merged
merged 42 commits into from
Jun 30, 2023

Conversation

eve-le-guillou
Copy link
Contributor

Hi all,

This PR adds MPI support to the periodic triangulation.
This is in two fold:

  • Implementation of a periodic ghost generator, to handle the periodicity at the boundaries.
  • Implementation of all the MPI related methods of ImplicitTriangulation in PeriodicImplicitTriangulation.

The periodic ghost generator will add a layer of ghost vertices at the global boundaries, by copying data at the opposite side of the data set. The ghosts can then be treated like the ghosts generated by Paraview`s GhostCellsGenerator. The algorithm is implemented in the ttkPeriodicGhostsGeneration filter, however the filter will be called automatically when switching to a periodic grid using the ttkTriangulationManager. Therefore no additional step needs to be taken to execute this filter with MPI.

Both the meta grid and the local grid for the PeriodicImplicitTriangulation are PeriodicImplicitTriangulation objects. This is useful when the number of processes of the execution is low, and some opposite global boundaries are present on the same process. In this case, periodic ghosts are not created, and the local and meta grids are used to have the proper periodic behavior.

Some MPI methods in ImplicitTriangulation and PeriodicImplicitTriangulation were factorized in a new abstract class called RegularGridTriangulation.

Here is an example that creates a Wavelet dataset, makes it periodic and then smoothes the scalar field:

data = Wavelet(registrationName="wavelet1")

tTKTriangulationManager1 = TTKTriangulationManager(registrationName='TTKTriangulationManager1', Input=data)
tTKTriangulationManager1.PeriodicityinAllDimensions = 1
tTKTriangulationManager1.DataArrays = ['RTData', 'vtkGhostType']

tTKScalarFieldSmoother1 = TTKScalarFieldSmoother(registrationName='TTKScalarFieldSmoother1', Input=tTKTriangulationManager1)
tTKScalarFieldSmoother1.ScalarField = ['POINTS', 'RTData']
tTKScalarFieldSmoother1.IterationNumber = 5
tTKScalarFieldSmoother1.MaskField = ['POINTS', 'RTData']

Copy link
Collaborator

@julien-tierny julien-tierny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks a lot @eve-le-guillou
the code for the periodic ghost did not look so straighforward in the end but you managed to make this work. congratulations!
I have a few remarks below. Thanks for addressing them

core/base/triangulation/Triangulation.h Outdated Show resolved Hide resolved
core/vtk/ttkIdentifiers/ttkIdentifiers.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@julien-tierny julien-tierny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @eve-le-guillou , thanks a lot for the fixes.

while reading again ttkIdentifiers.cpp, I realized that it only generated vertex identifiers.
I believe we should also generate cell identifiers (to make sure we can re-construct unambiguously the global identifiers of simplices of intermediate dimensions in explicit mode). could you add that up real quick please?
thanks!

@julien-tierny
Copy link
Collaborator

awesome, thanks. let's go!

@julien-tierny julien-tierny merged commit 60ada42 into topology-tool-kit:dev Jun 30, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants