tem_load_general Subroutine

public subroutine tem_load_general(me, conf, timingFile, solverAborts)

Load general treelm settings from the Lua script in conf.

Arguments

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

global general parameter

type(flu_State) :: conf

Handle to the Lua script containing the configuration.

character(len=*), intent(in), optional :: timingFile

Default timing filename provided by the caller, overwritten by config file.

class(tem_solverAborts_type), intent(inout), optional :: solverAborts

Solver specific abort criteria to load.

See tem_abortCriteria_module for details on this additional abortCriteria parameters, that the solver may define to be loaded from the configuration.


Calls

proc~~tem_load_general~~CallsGraph proc~tem_load_general tem_load_general aot_get_val aot_get_val proc~tem_load_general->aot_get_val proc~tem_balance_load tem_balance_load proc~tem_load_general->proc~tem_balance_load proc~tem_horizontalspacer tem_horizontalSpacer proc~tem_load_general->proc~tem_horizontalspacer proc~tem_load_commpattern tem_load_commPattern proc~tem_load_general->proc~tem_load_commpattern proc~tem_load_env_params tem_load_env_params proc~tem_load_general->proc~tem_load_env_params proc~tem_simcontrol_dump tem_simControl_dump proc~tem_load_general->proc~tem_simcontrol_dump proc~tem_simcontrol_load tem_simControl_load proc~tem_load_general->proc~tem_simcontrol_load proc~tem_timer_loadconfig_glob tem_timer_loadconfig_glob proc~tem_load_general->proc~tem_timer_loadconfig_glob tem_precice_load tem_precice_load proc~tem_load_general->tem_precice_load tem_sparse_comm_load tem_sparse_comm_load proc~tem_load_general->tem_sparse_comm_load 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_load_commpattern->aot_get_val proc~tem_abort tem_abort proc~tem_load_commpattern->proc~tem_abort proc~tem_load_env_params->aot_get_val proc~tem_abortcriteria_dump tem_abortCriteria_dump proc~tem_simcontrol_dump->proc~tem_abortcriteria_dump proc~tem_simcontrol_dump_now tem_simControl_dump_now proc~tem_simcontrol_dump->proc~tem_simcontrol_dump_now proc~tem_status_dump tem_status_dump proc~tem_simcontrol_dump->proc~tem_status_dump proc~tem_timecontrol_dump tem_timeControl_dump proc~tem_simcontrol_dump->proc~tem_timecontrol_dump proc~tem_simcontrol_load->aot_get_val proc~tem_simcontrol_load->aot_table_close proc~tem_simcontrol_load->aot_table_open proc~tem_abortcriteria_load tem_abortCriteria_load proc~tem_simcontrol_load->proc~tem_abortcriteria_load proc~tem_abortcriteria_new tem_abortCriteria_new proc~tem_simcontrol_load->proc~tem_abortcriteria_new proc~tem_addtimer tem_addTimer proc~tem_simcontrol_load->proc~tem_addtimer proc~tem_simcontrol_load->proc~tem_timecontrol_load proc~tem_timecontrol_start_at_sim tem_timeControl_start_at_sim proc~tem_simcontrol_load->proc~tem_timecontrol_start_at_sim proc~tem_timer_loadconfig tem_timer_loadconfig proc~tem_timer_loadconfig_glob->proc~tem_timer_loadconfig

Source Code

  subroutine tem_load_general( me, conf, timingFile, solverAborts )
    ! ----------------------------------------------------------------------
    !> global general parameter
    type( tem_general_type ), intent(inout) :: me
    !> Handle to the Lua script containing the configuration.
    type(flu_state) :: conf
    !> Default timing filename provided by the caller, overwritten by config
    !! file.
    character(len=*), optional, intent(in) :: timingFile

    !> Solver specific abort criteria to load.
    !!
    !! See [[tem_abortCriteria_module]] for details on this additional
    !! abortCriteria parameters, that the solver may define to be loaded
    !! from the configuration.
    class(tem_solverAborts_type), intent(inout), optional :: solverAborts
    ! ----------------------------------------------------------------------
    integer :: iError
    character(len=pathLen) :: def_timingFile
    ! ----------------------------------------------------------------------

    if ( me%proc%isRoot ) then
      call tem_horizontalSpacer(fUnit = logUnit(1))
      write(logUnit(1),"(A)") 'Loading general parameters:'
    end if

    ! load global enviromental parameters from config file
    call tem_load_env_params(conf)

    if ( me%proc%isRoot ) then
      write(logUnit(1),"(A)") 'Using '//trim(null_device)//' as null device.'

      if (printRuntimeInfo) then
        write(logUnit(1),"(A)") 'Will print run time info in the end'
        write(logUnit(1),"(A)") '(/proc/self/status).'
      else
        write(logUnit(1),"(A)") 'Will NOT print run time info.'
      end if

      write(logUnit(1),"(A,I0)") 'Size of the IO Buffer (MB): ', &
        &                          (io_buffer_size*8/1024/1024)
    end if

    ! load simulation name
    call aot_get_val( L       = conf,              &
      &               key     = 'simulation_name', &
      &               val     = me%solver%simName, &
      &               ErrCode = iError,            &
      &               default = 'simulation'       )

    if ( me%proc%isRoot ) then
      write(logUnit(1),"(A)") 'Simulation Name: ' // trim( me%solver%simName )
    end if

    ! load simulation time control
    call tem_simControl_load( me           = me%simControl, &
      &                       conf         = conf,          &
      &                       solverAborts = solverAborts   )

    if ( me%proc%isRoot ) then
      call tem_simControl_dump(me = me%simControl, outUnit = logUnit(1))
    end if

    ! Get the setting, whether to use sparse communication patterns or not.
    call tem_sparse_comm_load(conf)

    ! load communication pattern and initialize commuication
    ! infrastructure
    call tem_load_commpattern(conf = conf, me = me%commpattern)

    ! load timing filename
    if (present(timingFile)) then
      def_timingFile = timingFile
    else
      def_timingFile = 'timing.res'
    end if

    call aot_get_val( L       = conf,           &
      &               key     = 'timing_file',  &
      &               val     = me%timingFile,  &
      &               default = def_timingFile, &
      &               ErrCode = iError          )
    write(logUnit(1),"(A)") 'Write timings to: ' // trim( me%timingFile )

    ! Get load balancing config
    call tem_balance_load( conf = conf,      &
      &                    me   = me%balance )

    ! Load configuration of timer output from timer table.
    call tem_timer_loadconfig_glob( conf )

    ! load precice if available
    if (precice_available) then
      write(logUnit(1),"(A)") 'Loading precice data'
      call tem_precice_load(conf = conf)
    end if
    call tem_horizontalSpacer(fUnit = logUnit(1))

  end subroutine tem_load_general