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
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 | :: | skip_smart_defaults | = | .false. |
Do we want to skip the smaart defaults 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 |
Is this instance initialised?
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
Fully initialise the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self | |||
character(len=*), | intent(in), | optional | :: | name | ||
logical, | intent(in), | optional | :: | requires_index | ||
integer, | intent(in), | optional | :: | index | ||
logical, | intent(in), | optional | :: | skip_smart_defaults | ||
logical, | intent(in), | optional | :: | skip_read | ||
logical, | intent(in), | optional | :: | skip_broadcast |
Do some standard setup/checking
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self | |||
character(len=*), | intent(in), | optional | :: | name | ||
logical, | intent(in), | optional | :: | requires_index | ||
integer, | intent(in), | optional | :: | index |
Write the namelist header for this instance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
integer, | intent(in) | :: | unit |
Returns the namelist name. Not very useful at the moment but may want to do more interesting things in the future
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
Returns the requires_index value. Allows access whilst keeping the variable private
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
An no-op implementation of the set_smart_defaults method. Unless over-ridden the specific config instance will have no smart defaults applied.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self |
Has to be intent in out as over-riding procedures need to change self |
Write the namelist footer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type character
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
character(len=*), | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type real
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
real, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type complex
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
complex, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
integer, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type logical
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
logical, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type real array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
real, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type complex array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
complex, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type integer array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
integer, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Reads in the optimisation_config namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(optimisation_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(optimisation_config_type), | intent(in) | :: | self | |||
integer, | intent(in), | optional | :: | unit |
Resets the config object to the initial empty state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(optimisation_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(optimisation_config_type), | intent(inout) | :: | self |
Gets the default name for this namelist
Gets the default requires index for this namelist
type, extends(abstract_config_type) :: optimisation_config_type
! namelist : optimisation_config
! indexed : false
!> When true, automatically continues GS2 to run the input file with the
!> optimised parameters.
logical :: auto = .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.
logical :: estimate_timing_error = .true.
!> The maximum fraction of unused procs to allow in the optimisation
!> scan.
real :: max_imbalance = -1.0
!> The maximum number of unused procs to allow in the optimisation scan.
integer :: max_unused_procs = 0
!> When true, use the "advance" timer.
!> When false, use the "timestep" timer.
logical :: measure_all = .false.
!> 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.
real :: min_efficiency = -1.0
!> The number of timestep to use in the timing experiments. Must
!> be greater than 1
integer :: nstep_measure = 5
!> Set true to turn on optimisation procedure
logical :: on = .false.
!> When true, perform a few runs before beginning the timing experiment
logical :: warm_up = .false.
contains
procedure, public :: read => read_optimisation_config
procedure, public :: write => write_optimisation_config
procedure, public :: reset => reset_optimisation_config
procedure, public :: broadcast => broadcast_optimisation_config
procedure, public, nopass :: get_default_name => get_default_name_optimisation_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_optimisation_config
end type optimisation_config_type