optimisation_config Module

A module for handling the configuration of the optimisation module via the namelist optimisation_config.



Contents


Variables

Type Visibility Attributes Name Initial
logical, private :: initialized = .false.
type(optimisation_config_type), private :: optimisation_config_config

Derived Types

type, public ::  optimisation_results_type

Components

Type Visibility Attributes Name Initial
real, public :: time
real, public :: optimal_time
real, public :: cost
real, public :: optimal_cost
real, public :: efficiency
integer, public :: nproc
logical, public :: optimal = .true.

type, public ::  optimisation_type

A type for storing the optimisation configuration, the results

Components

Type Visibility Attributes Name Initial
integer, public :: nproc_max
type(optimisation_results_type), public :: results
type(optimisations_overrides_type), public, dimension(:), pointer :: sorted_optimisations
type(optimisation_results_type), public, dimension(:), pointer :: sorted_results
real, public :: timing_rel_error
real, public :: timing_max_rel_error
integer, public :: outunit
logical, public :: on
logical, public :: auto
logical, public :: measure_all
logical, public :: warm_up
logical, public :: estimate_timing_error
integer, public :: nstep_measure
real, public :: max_imbalance
integer, public :: max_unused_procs
real, public :: min_efficiency

type, public, extends(abstract_config_type) ::  optimisation_config_type

Used to represent the input configuration for GS2's optimisation procedure. When turned on, GS2 performs a scan for the given input file, varying different optimisation flags. Results of this scan are reported in .optim. The optimal parameters are stored, allowing a user to run the same input file with optimised parameters in the same execution. A user can also choose to continue with a less-than-optimal set of parameters which satisfy other constraints.

Components

Type Visibility Attributes Name Initial
logical, public :: exist = .false.

Does the related namelist exist in the target input file?

integer, public :: index = 0

Used to hold the specific index of numbered namelists

logical, public :: skip_read = .false.

Do we want to skip the read step in init?

logical, public :: skip_broadcast = .false.

Do we want to skip the broadcast step in init?

logical, public :: auto = .true.

When true, automatically continues GS2 to run the input file with the optimised parameters.

logical, public :: estimate_timing_error = .true.

Estimate the absolute and relative errors in timing data FIXME: Why would we want this to be false? On small core counts it doesn't seem like a big overhead.

real, public :: max_imbalance = -1.0

The maximum fraction of unused procs to allow in the optimisation scan.

integer, public :: max_unused_procs = 0

The maximum number of unused procs to allow in the optimisation scan.

logical, public :: measure_all = .false.

When true, use the "advance" timer. When false, use the "timestep" timer.

real, public :: min_efficiency = -1.0

The minimum efficiency (relative to the optimal parameters) considered when looking for a constrained set of parameters. A negative value implies only the optimal parameters are considered.

integer, public :: nstep_measure = 5

The number of timestep to use in the timing experiments. Must be greater than 1

logical, public :: on = .false.

Set true to turn on optimisation procedure

logical, public :: warm_up = .false.

When true, perform a few runs before beginning the timing experiment

Type-Bound Procedures

procedure , public , :: is_initialised => is_initialised_generic Function
procedure , public , :: init => init_generic Subroutine
procedure , public , :: setup => setup_generic Subroutine
procedure , public , :: write_namelist_header Subroutine
procedure , public , :: get_name => get_name_generic Function
procedure , public , :: get_requires_index => get_requires_index_generic Function
procedure , public , nopass :: write_namelist_footer Subroutine
generic, public , :: write_key_val => write_key_val_string, write_key_val_real, write_key_val_complex, write_key_val_integer, write_key_val_logical, write_key_val_real_array, write_key_val_complex_array, write_key_val_integer_array
procedure , public :: read => read_optimisation_config Subroutine
procedure , public :: write => write_optimisation_config Subroutine
procedure , public :: reset => reset_optimisation_config Subroutine
procedure , public :: broadcast => broadcast_optimisation_config Subroutine
procedure , public , nopass :: get_default_name => get_default_name_optimisation_config Function
procedure , public , nopass :: get_default_requires_index => get_default_requires_index_optimisation_config Function

Functions

Get the module level config instance

Arguments

None

Return Value type(optimisation_config_type)

Gets the default name for this namelist

Arguments

None

Return Value character(len=CONFIG_MAX_NAME_LEN)

Gets the default requires index for this namelist

Arguments

None

Return Value logical


Subroutines

public subroutine init_optimisation_config(optim, optimisation_config_config_in)

Arguments

Type IntentOptional Attributes Name
type(optimisation_type), intent(inout) :: optim
type(optimisation_config_type), intent(in), optional :: optimisation_config_config_in

public subroutine finish_optimisation_config(optim)

Arguments

Type IntentOptional Attributes Name
type(optimisation_type), intent(inout) :: optim

private subroutine read_parameters(optim, optimisation_config_config_in)

Arguments

Type IntentOptional Attributes Name
type(optimisation_type), intent(inout) :: optim
type(optimisation_config_type), intent(in), optional :: optimisation_config_config_in

public subroutine set_optimisation_config_config(optimisation_config_config_in)

Set the module level config type Will abort if the module has already been initialised to avoid inconsistencies.

Arguments

Type IntentOptional Attributes Name
type(optimisation_config_type), intent(in), optional :: optimisation_config_config_in

private subroutine read_optimisation_config(self)

Reads in the optimisation_config namelist and populates the member variables

Arguments

Type IntentOptional Attributes Name
class(optimisation_config_type), intent(inout) :: self

private subroutine write_optimisation_config(self, unit)

Writes out a namelist representing the current state of the config object

Arguments

Type IntentOptional Attributes Name
class(optimisation_config_type), intent(in) :: self
integer, intent(in), optional :: unit

private subroutine reset_optimisation_config(self)

Resets the config object to the initial empty state

Arguments

Type IntentOptional Attributes Name
class(optimisation_config_type), intent(inout) :: self

private subroutine broadcast_optimisation_config(self)

Broadcasts all config parameters so object is populated identically on all processors

Arguments

Type IntentOptional Attributes Name
class(optimisation_config_type), intent(inout) :: self