ingen_mod Module

Reads in namelists, checks for consistency of inputs, writes a report to runname.report, checks for requested variations, generates new input files, and exits.

Consistency checks/reports:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!! Declarations !!!!!!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



Contents


Variables

Type Visibility Attributes Name Initial
character(len=100), public :: pythonin
integer, public :: interactive_record
integer, public :: interactive_input
integer, public :: in_file
integer, public :: i
integer, public :: unit
integer, public :: is
integer, public :: report_unit
integer, public :: ncut
integer, public :: npmax
logical, public :: exist
logical, public :: scan
logical, public :: stdin
logical, public :: coll_on = .false.
logical, public :: initialized = .false.
type(proc_layout_type), public, dimension(:), allocatable :: sweet_spots
integer, public :: n_sweet_spots
logical, public, parameter :: debug = .false.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!! Namelists !!!!!!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!! !!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! CMR

type(ingen_config_type), public :: ingen_config

Derived Types

type, public ::  proc_layout_type

FIXME : Add documentation

Components

Type Visibility Attributes Name Initial
integer, public :: nproc
character(len=1), public :: split_char
real, public :: percent_xxf_2_yxf
logical, public :: should_use_unbalanced_xxf
real, public :: percentage_xxf_unbalanced_amount
logical, public :: should_use_unbalanced_yxf
real, public :: percentage_yxf_unbalanced_amount

type, public, extends(abstract_config_type) ::  ingen_config_type

Used to represent the input configuration of ingen

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?

integer, public :: ncut = 100000

This sets the minimum number of local elements for which processor recommendations will be given. In other words, if the total number of elements is nmesh = (2*ntgrid+1)*2*nlambda*negrid*ntheta0*naky*nspec, then the largest processor count that ingen will recommend would be nmesh/ncut.

integer, public :: npmax = 100000

Sets the maximum processor count considered when calculating sweetspots.

logical, public :: scan = .false.

If true then alongside standard ingen report allows the creation of various types of scans. This will involve user interaction if stdin is true.

logical, public :: stdin = .true.

If true (default) then ask for input from stdin when using ingen to produce parameters for scans (scan = .true.). If false then will look in file named .<run_name>.pythonin instead.

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_ingen_config Subroutine
procedure , public :: write => write_ingen_config Subroutine
procedure , public :: reset => reset_ingen_config Subroutine
procedure , public :: broadcast => broadcast_ingen_config Subroutine
procedure , public , nopass :: get_default_name => get_default_name_ingen_config Function
procedure , public , nopass :: get_default_requires_index => get_default_requires_index_ingen_config Function

Functions

public function get_ingen_mod_config()

Get the module level config instance

Arguments

None

Return Value type(ingen_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 run_ingen(ingen_config_in, input_file)

Entry point: initialise needed modules, run checks, and write namelists

Arguments

Type IntentOptional Attributes Name
type(ingen_config_type), intent(in), optional :: ingen_config_in

Input options. Defaults to reading the 'ingen_knobs' namelist from the input file

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

Filename of input file. Default is to read from the command line

public subroutine init_ingen(ingen_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(ingen_config_type), intent(in), optional :: ingen_config_in

public subroutine finish_ingen()

FIXME : Add documentation

Arguments

None

public subroutine interactive(header)

FIXME : Add documentation
!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!! 1.0 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!! 1.1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!! 1.1.1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!! 1.1.2 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Read more…

Arguments

Type IntentOptional Attributes Name
type(standard_header_type), intent(in), optional :: header

Header for files with build and run information

public subroutine get_namelists()

FIXME : Add documentation

Arguments

None

public subroutine write_namelists(jr, tag1, tag2, header)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in), optional :: jr
character(len=*), intent(in), optional :: tag1
character(len=*), intent(in), optional :: tag2
type(standard_header_type), intent(in), optional :: header

Header for files with build and run information

public subroutine pfactors(n, div)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
integer, intent(out), dimension (:) :: div

public subroutine report(header)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(standard_header_type), intent(in), optional :: header

Header for files with build and run information

public subroutine wsweetspots(sym, sdim, nfac, facs, npmax, LUN)

Writes out sweetspot core counts for a layout sym: character string label for each dimension sdim: size of each dimension nfac: #factors of each sdim facs(i,j): ith factor of jth dimension

Arguments

Type IntentOptional Attributes Name
character(len=3), intent(in), dimension(:) :: sym
integer, intent(in), dimension(:) :: sdim
integer, intent(in), dimension(:) :: nfac
integer, intent(in), dimension(:,:) :: facs
integer, intent(in) :: npmax
integer, optional :: LUN

public subroutine nprocs_xxf()

FIXME : Add documentation

Arguments

None

public subroutine nprocs_yxf()

FIXME : Add documentation

Arguments

None

public subroutine nprocs_e()

FIXME : Add documentation

Arguments

None

public subroutine nprocs_lz()

FIXME : Add documentation

Arguments

None

public subroutine nprocs_le()

FIXME : Add documentation

Arguments

None

public subroutine nprocs(nmesh)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nmesh

public subroutine get_unbalanced_suggestions(npe, percentage_xxf_unbalanced_amount, percentage_yxf_unbalanced_amount, use_unbalanced_xxf, use_unbalanced_yxf)

This subroutine is used to return the unbalanced suggestions for a given process count (npe). The calculation is performed using the calculate_unbalanced_x and calculate_unbalanced_y subroutines from gs2_layouts. These return the unbalanced decomposition size (difference between the suggested small and large block size for the decomposition) and from this a logical is set to recommend whether the unbalanced decomposition should be used or not.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: npe
integer, intent(out) :: percentage_xxf_unbalanced_amount
integer, intent(out) :: percentage_yxf_unbalanced_amount
logical, intent(out) :: use_unbalanced_xxf
logical, intent(out) :: use_unbalanced_yxf

public subroutine get_idle_processes(npe, idle_percentage, use_unbalanced)

This subroutine is used to return the idle processes from the xxf and yxf layouts. Idle processes sometimes occur, dependent on the process count used, because the data domain does not evenly divide by the total number of processes available. These can cause high communications overheads for the non-linear calculations for large numbers of processes so it is useful to print this data out in ingen to let users know which process counts this can happen at for a given input file We currently use an arbitrary cutoff of 10% difference in idle processes to suggest that the unbalanced decomposition functionality should be used to mitigate the impact of this difference.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: npe
real, intent(out) :: idle_percentage
logical, intent(out) :: use_unbalanced

public subroutine report_idle_procs(npe, distchar, onlyxoryfac)

This subroutine wraps up the output functionality for the code that creates the list of suggested process counts for the linear computation and checks whether those process counts work well for the non-linear calculations as well.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: npe
character(len=*), intent(in) :: distchar
logical, intent(in), optional :: onlyxoryfac

public subroutine tell(a, b, c)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: a
character(len=*), intent(in), optional :: b
character(len=*), intent(in), optional :: c

public subroutine text(a)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: a

public subroutine run_number(sel, nbeta)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: sel
integer, intent(in) :: nbeta

public subroutine try_again()

FIXME : Add documentation

Arguments

None

public subroutine get_choice(in, out)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: in
integer, intent(out) :: out

public subroutine beta_range_low(x, a, x0)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(out) :: x
character(len=*), intent(in) :: a
real, intent(in) :: x0

public subroutine beta_range_high(x, a, x0)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(out) :: x
character(len=*), intent(in) :: a
real, intent(in) :: x0

public subroutine beta_prime_range_low(x)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(out) :: x

public subroutine beta_prime_range_high(x, x0)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(out) :: x
real, intent(in) :: x0

public subroutine num_runs(n)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: n

public subroutine set_ingen_mod_config(ingen_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(ingen_config_type), intent(in), optional :: ingen_config_in

public subroutine read_ingen_config(self)

Reads in the ingen_knobs namelist and populates the member variables

Arguments

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

public subroutine write_ingen_config(self, unit)

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

Arguments

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

public subroutine reset_ingen_config(self)

Resets the config object to the initial empty state

Arguments

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

public subroutine broadcast_ingen_config(self)

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

Arguments

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