Module ppm_module_map_part_ghost

This module provides the particle ghost mapping routines and holds the temporary work arrays.

Defined Types

name description

no types

Defined Module Interfaces

Defined Module Subroutines

name description

no subroutines

Interface ppm_map_part_ghost_get

Subroutines contained in this interface:

name description

ppm_map_part_ghost_get_d

This routine maps/adds the ghost particles on the current topology.

ppm_map_part_ghost_get_s

This routine maps/adds the ghost particles on the current topology.

Interface ppm_map_part_ghost_pop

Subroutines contained in this interface:

name description

ppm_map_part_ghost_pop_1dd

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_1ds

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_1di

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_1dl

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_1ddc

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_1dsc

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_2dd

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_2ds

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_2di

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_2dl

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_2ddc

This routine pops the contents of the receive buffer

ppm_map_part_ghost_pop_2dsc

This routine pops the contents of the receive buffer

Interface ppm_map_part_ghost_put

Subroutines contained in this interface:

name description

ppm_map_part_ghost_put

This routine puts back ghost particle values/properties to the

Subroutine ppm_map_part_ghost_get_d

This routine maps/adds the ghost particles on the current topology. This routine is similar to the partial mapping routine (ppm_map_part_partial) in the sense that the ghost particles are assumed to be located on neighbouring processors only, and thus only require a nearest neighbour communication.

[Warning]Warning

It is an error to specify a topology ID to which the particles are not currently mapped

[Note]Note

This routine SHOULD be efficient - since it will be called frequently. One way of improving (?) the performance is to use the cell lists to find the potential ghosts.

This routine should be split in several routines!

The ghosts are found in three steps:

  1. consider ghosts within the local processor
  2. consider ghosts on neighbouring processors
  3. consider ghosts on periodic images of neighbouring processors

Comments:

  1. Local ghost particles come in two types: ghost particles that exist because two sub domains touch, and ghosts across a periodic boundary. The first is automatically handled by the particles - and no copy or/and send is required. The second ghosts could be handled during the calculation of the interactions, but this would require a check for periodicity and no explicit ghosts from the processor itself. However, it seems more natural to have ghosts - irrespectively of their origin, so ghosts from periodicity (on the same processor) are copied here.
  2. is standard procedure
  3. is handled by copying particles that are adjacent to faces on a physical boundary to their image position.

Now, item 2. and 3. can be treated within the same logic whereas 1. require a bit of thought: to keep the source compact, we could loop over all processors including the local one and check for ghosts - the problem with this procedure is, that we check for ghosts by comparing the location of particles within the extended subs boundaries (and not their true ghost layer - which would result in more IFs than necessary). However, because of this, looping over the processor itself would find ghosts that are not really ghost - the only ghosts that should be found in this step are those due to periodicity. The solution is to store the ghosts as ighost() with nghost denoting the total number of ghosts (excluding those due to periodicity) and nghostplus the total number of ghosts. During the loop over the processor itself we therefore only need to loop from nghost+1,nghostplus.

Arguments

name type dimension intent optional description

topoid

integer

(IN)

ID of current topology

xp

real array

(:,:)

(IN)

The position of the particles

lda

integer

(IN)

Leading dimension of xp

npart

integer

(IN)

The number of particles (on the local processor)

isymm

integer

(IN)

Indicator for the use of symmetry

ghostsize

real

(IN)

The size of the ghost layer

info

integer

(OUT)

Return status, 0 on success

topoid

integer, , (IN)

ID of current topology

xp

real array, (:,:), (IN)

The position of the particles

lda

integer, , (IN)

Leading dimension of xp

npart

integer, , (IN)

The number of particles (on the local processor)

isymm

integer, , (IN)

Indicator for the use of symmetry

  • isymm > 0 use symmetry
  • isymm = 0 do not use symmetry
ghostsize

real, , (IN)

The size of the ghost layer

info

integer, , (OUT)

Return status, 0 on success

Used Modules

ppm_module_data, ppm_module_error, ppm_module_typedef, ppm_module_alloc, ppm_module_check_id, ppm_module_substop, ppm_module_util_commopt, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_get_s

This routine maps/adds the ghost particles on the current topology. This routine is similar to the partial mapping routine (ppm_map_part_partial) in the sense that the ghost particles are assumed to be located on neighbouring processors only, and thus only require a nearest neighbour communication.

[Warning]Warning

It is an error to specify a topology ID to which the particles are not currently mapped

[Note]Note

This routine SHOULD be efficient - since it will be called frequently. One way of improving (?) the performance is to use the cell lists to find the potential ghosts.

This routine should be split in several routines!

The ghosts are found in three steps:

  1. consider ghosts within the local processor
  2. consider ghosts on neighbouring processors
  3. consider ghosts on periodic images of neighbouring processors

Comments:

  1. Local ghost particles come in two types: ghost particles that exist because two sub domains touch, and ghosts across a periodic boundary. The first is automatically handled by the particles - and no copy or/and send is required. The second ghosts could be handled during the calculation of the interactions, but this would require a check for periodicity and no explicit ghosts from the processor itself. However, it seems more natural to have ghosts - irrespectively of their origin, so ghosts from periodicity (on the same processor) are copied here.
  2. is standard procedure
  3. is handled by copying particles that are adjacent to faces on a physical boundary to their image position.

Now, item 2. and 3. can be treated within the same logic whereas 1. require a bit of thought: to keep the source compact, we could loop over all processors including the local one and check for ghosts - the problem with this procedure is, that we check for ghosts by comparing the location of particles within the extended subs boundaries (and not their true ghost layer - which would result in more IFs than necessary). However, because of this, looping over the processor itself would find ghosts that are not really ghost - the only ghosts that should be found in this step are those due to periodicity. The solution is to store the ghosts as ighost() with nghost denoting the total number of ghosts (excluding those due to periodicity) and nghostplus the total number of ghosts. During the loop over the processor itself we therefore only need to loop from nghost+1,nghostplus.

Arguments

name type dimension intent optional description

topoid

integer

(IN)

ID of current topology

xp

real array

(:,:)

(IN)

The position of the particles

lda

integer

(IN)

Leading dimension of xp

npart

integer

(IN)

The number of particles (on the local processor)

isymm

integer

(IN)

Indicator for the use of symmetry

ghostsize

real

(IN)

The size of the ghost layer

info

integer

(OUT)

Return status, 0 on success

topoid

integer, , (IN)

ID of current topology

xp

real array, (:,:), (IN)

The position of the particles

lda

integer, , (IN)

Leading dimension of xp

npart

integer, , (IN)

The number of particles (on the local processor)

isymm

integer, , (IN)

Indicator for the use of symmetry

  • isymm > 0 use symmetry
  • isymm = 0 do not use symmetry
ghostsize

real, , (IN)

The size of the ghost layer

info

integer, , (OUT)

Return status, 0 on success

Used Modules

ppm_module_data, ppm_module_error, ppm_module_typedef, ppm_module_alloc, ppm_module_check_id, ppm_module_substop, ppm_module_util_commopt, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_1dd

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

real array

(:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

real array, (:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_1ddc

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

complex array

(:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

complex array, (:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_1di

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

integer array

(:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

integer array, (:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_1dl

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

logical array

(:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

logical array, (:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_1ds

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

real array

(:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

real array, (:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_1dsc

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

complex array

(:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

complex array, (:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_2dd

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

real array

(:,:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

real array, (:,:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_2ddc

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

complex array

(:,:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

complex array, (:,:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_2di

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

integer array

(:,:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

integer array, (:,:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_2dl

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

logical array

(:,:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

logical array, (:,:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_2ds

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

real array

(:,:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

real array, (:,:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_pop_2dsc

This routine pops the contents of the receive buffer when sending the ghosts back. Notice the value popped will be added to array passed to the routine.

[Warning]Warning

lda is the dimension of the pdata array and not the space dimension ppm_dim!

Arguments

name type dimension intent optional description

pdata

complex array

(:,:)

Particle data to be popped.

lda

integer

(IN)

The leading dimension of pdata.

npart

integer

(IN)

The number of real particles (on the processor)

mpart

integer

(IN)

The number of real + ghost particles (on the processor)

info

integer

(OUT)

Return status. 0 upon success.

pdata

complex array, (:,:), no intent declared

Particle data to be popped. Can be either 1D or 2D array.

lda

integer, , (IN)

The leading dimension of pdata. In the case of pdata being a 1D array use lda=1.

npart

integer, , (IN)

The number of real particles (on the processor)

mpart

integer, , (IN)

The number of real + ghost particles (on the processor)

info

integer, , (OUT)

Return status. 0 upon success.

Used Modules

ppm_module_data, ppm_module_error, ppm_module_alloc, ppm_module_substop, ppm_module_write, ppm_module_substart

Subroutine ppm_map_part_ghost_put

This routine puts back ghost particle values/properties to the corresponding real particles. This is very useful in the case of symmetric interactions as there the ghost particles are also updated.

[Important]Important

This routine can only be called after ghost particles have been created using the ppm_map_part_ghost_get (+push/send/pop sequence) routine.

[Warning]Warning

It is an error to call ppm_map_part_pop in the push-send-pop sequence of a map_part_ghost_put call. Instead, you must call ppm_map_part_ghost_pop for popping the properties pushed onto the put buffers.

[Tip]Tip

If you need to do alternating ghost-get and ghost-put sequences you may want to use ppm_map_part_store and ppm_map_part_load to store and load the internal buffers for ghost_get and spare yourself the (costly) call to ppm_map_part_ghost_get. Positions can be pushed using the ppm_map_part_ghost_push routine.

[Note]Implementation Notes

This routine swaps the send and receive lists of the mapping routine to allow sending back the value/data computed on the ghost particles. The routine must be called after ppm_map_part_send and should be followed by a ppm_map_part_push, ppm_map_part_send and ppm_map_part_pop to get.

This implementation only allows one ghost put at a time; To allow multiple ghosts we have to pass the ppm_user_hack to the ghost_pop OR to copy the userpassed array to the internally stored ppm_ghosthack used (and not passed) by the ghost_pop()

Arguments

name type dimension intent optional description

topoid

integer

(IN)

Topology ID

info

integer

(OUT)

Return status, 0 on success

topoid

integer, , (IN)

Topology ID

info

integer, , (OUT)

Return status, 0 on success

Used Modules

ppm_module_data, ppm_module_error, ppm_module_typedef, ppm_module_alloc, ppm_module_check_id, ppm_module_substop, ppm_module_util_commopt, ppm_module_write, ppm_module_substart

Defined Module Variables

name type dimension description

no variables

Used Modules

has no uses