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
}
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_balance_type), | intent(inout) | :: | me |
The load balancing type |
||
type(flu_State) | :: | conf |
lua configuration handle |
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