MONC
|
MONC component registry. More...
Data Types | |
type | group_descriptor_type |
Descriptor of a group. More... | |
type | pointer_wrapper_type |
Private helper type which wraps a procedure pointer. This is needed for storage in our collections_mod and allows us to associate additional information, such as number of times called, performance etc in future if we wanted to. More... | |
Functions/Subroutines | |
subroutine, public | init_registry (options_database) |
Initialises the registry with the provided configuration file. More... | |
subroutine, public | free_registry () |
Will deregister all components and free up the registry data structures. This can either be called at the end of execution to clean memory up or used to clear the registry. More... | |
subroutine, public | register_component (options_database, descriptor) |
Will register a component and install the nescesary callback hooks. More... | |
logical function, public | is_component_field_available (name) |
Determines whether a specific published field is available or not. More... | |
type(component_field_value_type) function, public | get_component_field_value (current_state, name) |
Retrieves the value wrapper of a components published field. More... | |
type(component_field_information_type) function, public | get_component_field_information (current_state, name) |
Retrieves information about a components published field which includes its type and size. More... | |
type(list_type) function, public | get_all_component_published_fields () |
Retrieves all of the published field information. More... | |
subroutine | load_published_fields (descriptor) |
Loads the published fields information for an entire component into the registry's definition list. More... | |
subroutine, public | deregister_component (name) |
Will deregister a component, remove all callback hooks and free registry specific memory allocated to the component. More... | |
type(component_descriptor_type) function, pointer, public | get_component_info (name) |
Retrieves detailed information about a specific component. More... | |
type(map_type) function, public | get_all_registered_components () |
Returns a brief summary of all registered components. More... | |
subroutine, public | execute_initialisation_callbacks (current_state) |
Calls all initialisation callbacks with the specified state. More... | |
subroutine, public | execute_timestep_callbacks (current_state, group_id) |
Calls all timestep callbacks with the specified state. More... | |
subroutine, public | execute_finalisation_callbacks (current_state) |
Calls all finalisation callbacks with the specified state. More... | |
subroutine, public | order_all_callbacks () |
Orders all callbacks in the prospective stages based upon the priorities of each descriptor. More... | |
type(map_type) function | order_grouped_timstep_callbacks (group_id) |
logical function, public | is_component_enabled (options_database, component_name) |
Determines whether or not a specific component is registered and enabled. More... | |
subroutine, public | display_callbacks_in_order_at_each_stage () |
Displays the registered callbacks of each stage in the order that they will be called. More... | |
subroutine, public | get_ordered_groups (ordered_groups) |
Orders all the groups (in the order that they will be called in) and returns an array with these in order. This is useful for prefetching the groups in order so that per timestep we can just iterate through the array which is O(n) More... | |
integer function | get_group_id (group_name) |
Given a group name this returns the id (i.e. order) of that group. More... | |
type(group_descriptor_type) function | get_group_descriptor_from_name (group_name) |
Given a group name this returns the group descriptor corresponding to that or an error if none is found. More... | |
type(group_descriptor_type) function | get_group_descriptor_from_id (group_id) |
Given the id of a group this will return the corresponding descriptor. More... | |
subroutine | display_callbacks_in_order (stage_callbacks, stagetitle) |
Displays the registered callbacks of a specific stage in the order that they will be called. More... | |
subroutine | read_initialisation_and_finalisation_orders (options_database) |
subroutine | read_specific_orders (options_database, key, data_structure) |
subroutine | read_group_configurations (options_database) |
subroutine | remove_descriptor (descriptor) |
Will remove a specific descriptor from the registry table and uninstall the corresponding callback hooks for each state. More... | |
subroutine | unload_callback_hooks (descriptor, group_name) |
Will unload the callback hooks that have been installed for each state. More... | |
subroutine | load_callback_hooks (descriptor, group_name) |
Will install the callback hooks for each state. More... | |
subroutine | rebalance_callbacks (callbacks, priorities, stage_name) |
integer function | get_highest_callback_priority (callbacks, priorities) |
subroutine | execute_callbacks (callback_map, current_state) |
Will execute the appropriate callbacks in a specific map_type given the current state. More... | |
subroutine | add_callback (callback_map, name, procedure_pointer) |
Will install a specific callback hook into the specified map_type of existing hooks. More... | |
Variables | |
integer, parameter, public | group_type_whole =0 |
Execute the callbacks in this group once per timestep. More... | |
integer, parameter, public | group_type_column =1 |
Execute the callbacks in this group for each column per timestep. More... | |
type(list_type), save | field_information |
integer, dimension(:), allocatable | group_types |
Group types. More... | |
character(len=string_length), dimension(:), allocatable | enabled_component_input_keys |
Temporary read array of component enable names. More... | |
character(len=string_length), dimension(:), allocatable | group_locations |
Provides an id to each group. More... | |
type(map_type), save | init_callbacks |
Callback hooks for the initialisation stage. More... | |
type(map_type), save | finalisation_callbacks |
Callback hooks for the finalisation stage. More... | |
type(map_type), save | component_descriptions |
Copies of component descriptors. More... | |
type(map_type), save | group_descriptors |
Group descriptors for each group, name->descriptor. More... | |
type(map_type), save | component_groups |
type(map_type), save | init_orderings |
type(map_type), save | finalisation_orderings |
type(hashmap_type), save | field_procedure_retrievals |
type(hashmap_type), save | field_procedure_sizings |
type(map_type), dimension(:), allocatable | timestep_callbacks |
Callback hooks for the timestep stage. More... | |
MONC component registry.
Supports management of components. Each stage is called via the registry which will execute the installed callback hooks for that stage in order.
|
private |
Will install a specific callback hook into the specified map_type of existing hooks.
callbackmap_type | The map_type of existing callbacks which we are going to install this one into |
name | The name of the callback that we are installing |
procedurePointer | Pointer to the procedure which implements the callback |
Definition at line 647 of file registry.F90.
subroutine, public registry_mod::deregister_component | ( | character(len=*), intent(in) | name | ) |
Will deregister a component, remove all callback hooks and free registry specific memory allocated to the component.
name | The name of the component to de-register |
Definition at line 226 of file registry.F90.
|
private |
Displays the registered callbacks of a specific stage in the order that they will be called.
stageCallbacks | The registered callbacks for a stage |
stagetitle | The title of the stage - used for printing out information |
Definition at line 436 of file registry.F90.
subroutine, public registry_mod::display_callbacks_in_order_at_each_stage | ( | ) |
Displays the registered callbacks of each stage in the order that they will be called.
Definition at line 348 of file registry.F90.
|
private |
Will execute the appropriate callbacks in a specific map_type given the current state.
callbackmap_type | The map_type of callback hooks to execute |
currentState | The model state which may be (and likely is) modified in callbacks |
Definition at line 626 of file registry.F90.
subroutine, public registry_mod::execute_finalisation_callbacks | ( | type(model_state_type), intent(inout) | current_state | ) |
Calls all finalisation callbacks with the specified state.
currentState | The current model state which may (and often is) modified |
Definition at line 294 of file registry.F90.
subroutine, public registry_mod::execute_initialisation_callbacks | ( | type(model_state_type), intent(inout) | current_state | ) |
Calls all initialisation callbacks with the specified state.
currentState | The current model state which may (and often is) modified |
Definition at line 275 of file registry.F90.
subroutine, public registry_mod::execute_timestep_callbacks | ( | type(model_state_type), intent(inout) | current_state, |
integer | group_id | ||
) |
Calls all timestep callbacks with the specified state.
currentState | The current model state which may (and often is) modified |
Definition at line 283 of file registry.F90.
subroutine, public registry_mod::free_registry | ( | ) |
Will deregister all components and free up the registry data structures. This can either be called at the end of execution to clean memory up or used to clear the registry.
Definition at line 77 of file registry.F90.
type(list_type) function, public registry_mod::get_all_component_published_fields | ( | ) |
Retrieves all of the published field information.
Definition at line 185 of file registry.F90.
type(map_type) function, public registry_mod::get_all_registered_components | ( | ) |
Returns a brief summary of all registered components.
Definition at line 258 of file registry.F90.
type(component_field_information_type) function, public registry_mod::get_component_field_information | ( | type(model_state_type), intent(inout), target | current_state, |
character(len=*), intent(in) | name | ||
) |
Retrieves information about a components published field which includes its type and size.
name | The name of the field to look up |
Definition at line 165 of file registry.F90.
type(component_field_value_type) function, public registry_mod::get_component_field_value | ( | type(model_state_type), intent(inout), target | current_state, |
character(len=*), intent(in) | name | ||
) |
Retrieves the value wrapper of a components published field.
name | The name of the field to look up |
Definition at line 144 of file registry.F90.
type(component_descriptor_type) function, pointer, public registry_mod::get_component_info | ( | character(len=*), intent(in) | name | ) |
Retrieves detailed information about a specific component.
name | The name of the component to retrieve information for |
Definition at line 241 of file registry.F90.
|
private |
Given the id of a group this will return the corresponding descriptor.
group_id | Id of the group to find |
Definition at line 412 of file registry.F90.
|
private |
Given a group name this returns the group descriptor corresponding to that or an error if none is found.
group_name | Name of the group to look up |
Definition at line 393 of file registry.F90.
|
private |
Given a group name this returns the id (i.e. order) of that group.
group_name | The group name to look up |
Definition at line 381 of file registry.F90.
|
private |
subroutine, public registry_mod::get_ordered_groups | ( | type(group_descriptor_type), dimension(:), allocatable | ordered_groups | ) |
Orders all the groups (in the order that they will be called in) and returns an array with these in order. This is useful for prefetching the groups in order so that per timestep we can just iterate through the array which is O(n)
Definition at line 363 of file registry.F90.
subroutine, public registry_mod::init_registry | ( | type(hashmap_type), intent(inout) | options_database | ) |
Initialises the registry with the provided configuration file.
configurationFileName | The filename of the configuration file to parse |
Definition at line 67 of file registry.F90.
logical function, public registry_mod::is_component_enabled | ( | type(hashmap_type), intent(inout) | options_database, |
character(len=*), intent(in) | component_name | ||
) |
Determines whether or not a specific component is registered and enabled.
component_name | The name of the component to check for |
Definition at line 334 of file registry.F90.
logical function, public registry_mod::is_component_field_available | ( | character(len=*), intent(in) | name | ) |
Determines whether a specific published field is available or not.
name | The name of the field to search for |
Definition at line 135 of file registry.F90.
|
private |
Will install the callback hooks for each state.
descriptor | The component descriptor which is to be installed |
Definition at line 556 of file registry.F90.
|
private |
Loads the published fields information for an entire component into the registry's definition list.
descriptor | The field descriptor to load in |
Definition at line 193 of file registry.F90.
subroutine, public registry_mod::order_all_callbacks | ( | ) |
Orders all callbacks in the prospective stages based upon the priorities of each descriptor.
Note that this is an expensive operation as it involves multiple searches of the component list_types so should be called sparingly. When two priorities are equal then the order depends upon which one was registered first.
Definition at line 305 of file registry.F90.
|
private |
Definition at line 318 of file registry.F90.
|
private |
Definition at line 470 of file registry.F90.
|
private |
Definition at line 448 of file registry.F90.
|
private |
|
private |
Definition at line 572 of file registry.F90.
subroutine, public registry_mod::register_component | ( | type(hashmap_type), intent(inout) | options_database, |
type(component_descriptor_type), intent(in) | descriptor | ||
) |
Will register a component and install the nescesary callback hooks.
descriptor | The component descriptor and a separate copy of this it stored as reference |
Definition at line 100 of file registry.F90.
|
private |
Will remove a specific descriptor from the registry table and uninstall the corresponding callback hooks for each state.
descriptor | The component descriptor which is to be removed |
Definition at line 528 of file registry.F90.
|
private |
Will unload the callback hooks that have been installed for each state.
descriptor | The component descriptor which is to be unloaded |
Definition at line 544 of file registry.F90.
|
private |
Copies of component descriptors.
Definition at line 47 of file registry.F90.
|
private |
Definition at line 47 of file registry.F90.
|
private |
Temporary read array of component enable names.
Definition at line 28 of file registry.F90.
|
private |
Definition at line 25 of file registry.F90.
|
private |
Definition at line 52 of file registry.F90.
|
private |
Definition at line 52 of file registry.F90.
|
private |
Callback hooks for the finalisation stage.
Definition at line 47 of file registry.F90.
|
private |
Definition at line 47 of file registry.F90.
|
private |
Group descriptors for each group, name->descriptor.
Definition at line 47 of file registry.F90.
|
private |
Provides an id to each group.
Definition at line 28 of file registry.F90.
integer, parameter, public registry_mod::group_type_column =1 |
Execute the callbacks in this group for each column per timestep.
Definition at line 22 of file registry.F90.
integer, parameter, public registry_mod::group_type_whole =0 |
Execute the callbacks in this group once per timestep.
Definition at line 22 of file registry.F90.
|
private |
Group types.
Definition at line 27 of file registry.F90.
|
private |
|
private |
Definition at line 47 of file registry.F90.
|
private |
Callback hooks for the timestep stage.
Definition at line 54 of file registry.F90.