How to use communicator for parallel synchronization

From KratosWiki
Jump to: navigation, search

The MPICommunicator is the object which stores all domain interface information and is also in charge of handling the different scenarios of synchronizing data in interface of domains distributed in different machines. This class is derived from the Communicator object which provides the common interface and meanwhile the empty methods for the case of shared memory machines.


Local, Ghost and Interface Entities

In our approach each entity is belonged only to one domain but can have copies in other domains which called ghost. There is no restriction in number of ghosts for each entity and for example a node in domain 3 can have ghosts in domain 1 and domain 2. Having this approach in mind the entities in each domain are classified in three categories:

  • Local entities which are the ones that belong to the domain (Not Ghost).
  • Ghost entities which are a duplicated of the entities in other domain
  • Interface entities That can be ghost or local but they are in interface between this domain and other domains

Accessing Local Mesh

The following method can be used to access all local entities:

MeshType& LocalMesh()

and also the following methods returning the pointer to the LocalMesh containing all local entities:

const MeshType::Pointer pLocalMesh() const
MeshType::Pointer pLocalMesh()

It is important to mention that the LocalMesh also contains all the entities inside the domain (NOT only the interface).

These methods are also overloaded to give access to the local entities in the interface with each neighbour of the domain by passing the index of the neighbour domain.

MeshType& LocalMesh(IndexType ThisIndex)
const MeshType::Pointer pLocalMesh(IndexType ThisIndex) const
MeshType::Pointer pLocalMesh(IndexType ThisIndex)

Here the given mesh does NOT contain the entities inside the domain while they are not shared with the especified domain.


Accessing Ghost Mesh

The following method can be used to access all ghost entities:

MeshType& GhostMesh()

and also the following methods returning the pointer to the GhostMesh containing all ghost entities:

const MeshType::Pointer pGhostMesh() const
MeshType::Pointer pGhostMesh()

These methods are also overloaded to give access to the ghost entities by the domain that they belong to by passing the index of the neighbour domain.

MeshType& GhostMesh(IndexType ThisIndex)
const MeshType::Pointer pGhostMesh(IndexType ThisIndex) const
MeshType::Pointer pGhostMesh(IndexType ThisIndex)
Personal tools
Categories