tem_Sparta_module Module

The implementation is based on the SPartA Algorithm.

Some elements which require further treatment expose higher computational effort. This includes among others the enforcing of boundary conditions, source terms, or the interpolation between levels. Depending on the selected behavior of elements, this result in considerable higher effort on certain elements. When running in parallel, it is important to balance the load between the participating processing units equally in order to achieve a minimal time to solution. It is always desired to minimize the waiting time of processing units. The initial disitribution of the elements among the processes assigns the roughly the same amount of elements to each partition, regardless of their cost. This simple partitioning yields very good results for uniform grid simulations, as the elements with additional behavior is of the order of while the total number of elements are of order .

Especially when using locally refined grids, the computational cost of elements varies considerably. Besides the increased update interval of the smaller elements, the interpolation routines are very expensive compared to the pure computation of an element.

To account for this variation of the computational cost, a load balancing algorithm (see: [2] at Treelm bibliography) is employed to homogenize the total cost among the partitions. It is based on a space-filling curve, which fits nicely into the TreElm framework. Additionally, each element of the tree is assigned a weight representing the computational cost. The total cost is then possibly equally distributed among the partitions which results in a re-partitioning of the mesh along the space-filling curve.


Uses

  • module~~tem_sparta_module~~UsesGraph module~tem_sparta_module tem_Sparta_module module~tem_float_module tem_float_module module~tem_sparta_module->module~tem_float_module module~tem_aux_module tem_aux_module module~tem_sparta_module->module~tem_aux_module module~env_module env_module module~tem_sparta_module->module~env_module module~tem_logging_module tem_logging_module module~tem_sparta_module->module~tem_logging_module mpi mpi module~tem_sparta_module->mpi module~tem_float_module->module~env_module module~tem_aux_module->module~env_module module~tem_aux_module->module~tem_logging_module module~tem_aux_module->mpi module~aotus_module aotus_module module~tem_aux_module->module~aotus_module module~tem_revision_module tem_revision_module module~tem_aux_module->module~tem_revision_module module~tem_comm_env_module tem_comm_env_module module~tem_aux_module->module~tem_comm_env_module module~flu_binding flu_binding module~tem_aux_module->module~flu_binding module~aot_table_module aot_table_module module~tem_aux_module->module~aot_table_module module~tem_tools_module tem_tools_module module~tem_aux_module->module~tem_tools_module module~tem_lua_requires_module tem_lua_requires_module module~tem_aux_module->module~tem_lua_requires_module module~env_module->mpi module~env_module->module~aotus_module module~env_module->module~flu_binding iso_fortran_env iso_fortran_env module~env_module->iso_fortran_env module~tem_logging_module->module~env_module module~tem_logging_module->module~aotus_module module~tem_logging_module->module~aot_table_module module~tem_comm_env_module->mpi module~tem_tools_module->module~env_module module~tem_lua_requires_module->module~env_module module~tem_lua_requires_module->module~aotus_module module~tem_lua_requires_module->module~flu_binding module~tem_lua_requires_module->module~aot_table_module iso_c_binding iso_c_binding module~tem_lua_requires_module->iso_c_binding

Used by

  • module~~tem_sparta_module~~UsedByGraph module~tem_sparta_module tem_Sparta_module program~tem_sparta_test tem_sparta_test program~tem_sparta_test->module~tem_sparta_module module~treelmesh_module treelmesh_module module~treelmesh_module->module~tem_sparta_module

Contents


Interfaces

public interface tem_exchange_sparta

  • private subroutine tem_exchange_long(me, val, nComponents, comm)

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_sparta_type), intent(in) :: me
    integer(kind=long_k), intent(inout), allocatable:: val(:)
    integer, intent(in) :: nComponents
    integer, intent(in) :: comm
  • private subroutine tem_exchange_double(me, val, nComponents, comm)

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_sparta_type), intent(in) :: me
    real(kind=double_k), intent(inout), allocatable:: val(:)
    integer, intent(in) :: nComponents
    integer, intent(in) :: comm
  • private subroutine tem_exchange_long2(me, val, nComponents, comm)

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_sparta_type), intent(in) :: me
    integer(kind=long_k), intent(inout), allocatable:: val(:,:)
    integer, intent(in) :: nComponents
    integer, intent(in) :: comm
  • private subroutine tem_exchange_double2(me, val, nComponents, comm)

    Arguments

    TypeIntentOptionalAttributesName
    type(tem_sparta_type), intent(in) :: me
    real(kind=double_k), intent(inout), allocatable:: val(:,:)
    integer, intent(in) :: nComponents
    integer, intent(in) :: comm

Derived Types

type, public :: tem_sparta_type

Components

TypeVisibilityAttributesNameInitial
integer, private, allocatable:: send_index(:)
integer, private, allocatable:: recv_index(:)
integer, private, allocatable:: send_count(:)
integer, private, allocatable:: recv_count(:)
integer, private :: old_size =0
integer, private :: new_size =0

Subroutines

public subroutine tem_balance_sparta(weight, myPart, nParts, comm, myElems, offset, sparta)

Return splitting positions based on the weights provided by each rank.

Read more…

Arguments

TypeIntentOptionalAttributesName
real(kind=rk), intent(in) :: weight(:)

Sorted list of weights corresponding to treeID order

integer, intent(in) :: myPart
integer, intent(in) :: nParts

Number of procs the distribution should span

integer, intent(in) :: comm

MPI Communicator

integer, intent(inout) :: myElems

number of elements

integer(kind=long_k), intent(out) :: offset

Array of offsets with the size nParts. Offset index starts at 0. This Array needs to be allocate and deallocated outside

type(tem_sparta_type), intent(inout) :: sparta

public subroutine tem_init_sparta(me, nParts)

Arguments

TypeIntentOptionalAttributesName
type(tem_sparta_type), intent(inout) :: me
integer, intent(in) :: nParts

public subroutine tem_destroy_sparta(me)

Arguments

TypeIntentOptionalAttributesName
type(tem_sparta_type), intent(inout) :: me

public subroutine tem_output_sparta(me, outUnit)

Arguments

TypeIntentOptionalAttributesName
type(tem_sparta_type), intent(in) :: me
integer, intent(in) :: outUnit

public subroutine tem_derive_sparta(origin, derived, nElems, elemPropertyBits, prpBit, comm, nParts)

Arguments

TypeIntentOptionalAttributesName
type(tem_sparta_type), intent(in) :: origin
type(tem_sparta_type), intent(inout) :: derived
integer, intent(in) :: nElems
integer(kind=long_k), intent(in) :: elemPropertyBits(nElems)
integer, intent(in) :: prpBit
integer, intent(in) :: comm
integer, intent(in) :: nParts

private subroutine tem_exchange_long(me, val, nComponents, comm)

Arguments

TypeIntentOptionalAttributesName
type(tem_sparta_type), intent(in) :: me
integer(kind=long_k), intent(inout), allocatable:: val(:)
integer, intent(in) :: nComponents
integer, intent(in) :: comm

private subroutine tem_exchange_double(me, val, nComponents, comm)

Arguments

TypeIntentOptionalAttributesName
type(tem_sparta_type), intent(in) :: me
real(kind=double_k), intent(inout), allocatable:: val(:)
integer, intent(in) :: nComponents
integer, intent(in) :: comm

private subroutine tem_exchange_long2(me, val, nComponents, comm)

Arguments

TypeIntentOptionalAttributesName
type(tem_sparta_type), intent(in) :: me
integer(kind=long_k), intent(inout), allocatable:: val(:,:)
integer, intent(in) :: nComponents
integer, intent(in) :: comm

private subroutine tem_exchange_double2(me, val, nComponents, comm)

Arguments

TypeIntentOptionalAttributesName
type(tem_sparta_type), intent(in) :: me
real(kind=double_k), intent(inout), allocatable:: val(:,:)
integer, intent(in) :: nComponents
integer, intent(in) :: comm

private subroutine tem_set_sparta(me, comm, nParts, send_count)

Arguments

TypeIntentOptionalAttributesName
type(tem_sparta_type), intent(inout) :: me
integer, intent(in) :: comm
integer, intent(in) :: nParts
integer, intent(in) :: send_count(0:nParts-1)