tem_balance_load Subroutine

public subroutine tem_balance_load(me, conf)

Read all the configuration options for load balancing from the configuration.

To activate the load balancing, use

balance = {
  dynamic = true,          -- perform dynamic load balancing
  kind = 'IBM',            -- kind = 'levelwise','boundary','IBM'
  time_control = {         -- time control for slots when to perform load
       min      = 0.01,    --   balancing
       interval = 0.01,
       max      = 1.0,
  },
  folder = 'balance/', -- directory where to store tmp data
}

Arguments

Type IntentOptional Attributes Name
type(tem_balance_type), intent(inout) :: me

The load balancing type

type(flu_State) :: conf

lua configuration handle


Calls

proc~~tem_balance_load~~CallsGraph proc~tem_balance_load tem_balance_load aot_get_val aot_get_val proc~tem_balance_load->aot_get_val aot_table_close aot_table_close proc~tem_balance_load->aot_table_close aot_table_open aot_table_open proc~tem_balance_load->aot_table_open proc~tem_time_never tem_time_never proc~tem_balance_load->proc~tem_time_never proc~tem_timecontrol_load tem_timeControl_load proc~tem_balance_load->proc~tem_timecontrol_load proc~tem_timecontrol_load->aot_get_val proc~tem_timecontrol_load->aot_table_close proc~tem_timecontrol_load->aot_table_open proc~tem_timecontrol_load->proc~tem_time_never proc~tem_time_default_zero tem_time_default_zero proc~tem_timecontrol_load->proc~tem_time_default_zero proc~tem_time_load tem_time_load proc~tem_timecontrol_load->proc~tem_time_load proc~tem_time_needs_reduce tem_time_needs_reduce proc~tem_timecontrol_load->proc~tem_time_needs_reduce proc~tem_time_load->aot_get_val proc~tem_time_load->aot_table_close proc~tem_time_load->aot_table_open mpi_wtime mpi_wtime proc~tem_time_load->mpi_wtime

Called by

proc~~tem_balance_load~~CalledByGraph proc~tem_balance_load tem_balance_load proc~tem_load_general tem_load_general proc~tem_load_general->proc~tem_balance_load

Source Code

  subroutine tem_balance_load(me, conf)
    ! ---------------------------------------------------------------------------
    !> The load balancing type
    type(tem_balance_type), intent(inout) :: me
    !> lua configuration handle
    type(flu_state)                       :: conf
    ! ---------------------------------------------------------------------------
    integer :: iError, thandle
    character(len=labelLen) :: local_defaultString = 'simple'
    ! ---------------------------------------------------------------------------

    ! Open Balance table
    call aot_table_open(L       = conf,     &
      &                 thandle = thandle,  &
      &                 key     = "balance" )

    if( thandle /= 0 ) then
      ! table is open !
      call aot_get_val( L       = conf,       &
        &               thandle = thandle,    &
        &               key     = 'dynamic',  &
        &               val     = me%dynamic, &
        &               ErrCode = iError,     &
        &               default = .false. )

      call aot_get_val( L       = conf,               &
        &               thandle = thandle,            &
        &               key     = 'kind',             &
        &               val     = me%kind,            &
        &               ErrCode = iError,             &
        &               default = local_defaultString )

      call aot_get_val( L       = conf,       &
        &               thandle = thandle,    &
        &               key     = 'weight',   &
        &               val     = me%weight,  &
        &               ErrCode = iError,     &
        &               default = .false. )

      ! read the directory for dumping restart files of load balancing
      ! call aot_get_val( L       = conf,                                        &
      !   &               thandle = thandle,                                     &
      !   &               key     = 'folder',                                    &
      !   &               val     = me%restart%controller%writePrefix,           &
      !   &               ErrCode = iError )

      ! Load the time controls for dynamic load balancing
      call tem_timeControl_load( me     = me%timeControl,                      &
        &                        conf   = conf,                                &
        &                        parent = thandle )

    else ! NO balance table given

      me%kind = 'none'
      me%dynamic = .false.
      me%weight  = .false.
      me%timeControl%Interval = tem_time_never()
      me%timeControl%Min      = tem_time_never()
      me%timeControl%Max      = tem_time_never()

    end if

    call aot_table_close(L=conf, thandle=thandle)

  end subroutine tem_balance_load