This module provides the facility to control the execution of the solver.
It is configured by the sim_control
table in the configuration.
From this table three settings will be read:
time_control
defines the control of time stepping see
tem_timeControl_module.abort_criteria
defines additional abort criteria to be heeded see
tem_abortCriteria_module.delay_check
defines whether checks should be delayed (default is false).If there is no sim_control
found in the configuration, an attempt will be
made to read the time_control
table instead, while an empty
abort_criteria
table is assumed.
Thus, the general structure of the sim_control
configuration has the
following form:
sim_control = {
time_control = {},
abort_criteria = {},
delay_check = false
}
Alternatively, if there are no abort criteria to be specified, and
delay_check
should not be activated in general, just the
time_control
table may be specified:
time_control = {}
See the tem_timeControl_module for details on the time_control
table.
See the tem_abortCriteria_module for details on the time_control
table.
The delay_check
flag indicates whether to use a nonblocking allreduce
for the synchronization of status flags, to decide on triggered events during
the computation. It relaxes the synchronization requirements but introduces
a delay by one check interval until all processes get set status bits.
A simple complete example without checks for steady state would be:
sim_control = {
time_control = {
min = 0,
max = 10.0,
interval = {iter = 5}
},
abort_criteria = {
stop_file = 'stop',
},
delay_check = false
}
Data structure to describe the overall control of a simulation.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(tem_time_type), | public | :: | now |
Representation of the current time. |
|||
type(tem_timeControl_type), | public | :: | timeControl |
Time control, when the simulation should end, and definition of special interval, at which regular actions should take place. |
|||
type(tem_abortCriteria_type), | public | :: | abortCriteria |
Further abort criteria. |
|||
type(tem_status_type), | public | :: | status |
Flag collection to describe the status of the simulation. |
|||
logical, | public | :: | delay_check | = | .false. |
Use nonblocking operations for gobal checks and delay evaluation by one check interval (see timeControl%check_iter) |
|
integer, | public | :: | syncUpdate_timer |
Handle for the syncUpdate timer to measure the time spent on syncUpdate calls. |
Start a sim control by resetting its time object.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_simControl_type), | intent(inout) | :: | me |
The simulation control structure to start. |
Load sim control settings from a configuration script.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_simControl_type), | intent(inout) | :: | me |
Simulation control parameters to set. |
||
type(flu_State) | :: | conf |
Handle to the configuration script to load the settings from. |
|||
integer, | intent(in), | optional | :: | parent |
Potential parent table, in which the simulation control table is to be found. |
|
character(len=*), | optional | :: | key |
Name for the simulation control table. Default is 'sim_control'. |
||
class(tem_solverAborts_type), | intent(inout), | optional | :: | solverAborts |
Solver specific abort criteria to load. |
Write sim control settings to a configuration script.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_simControl_type), | intent(inout) | :: | me |
The simulation control settings to write to a Lua table. |
||
type(aot_out_type) | :: | conf |
Handle for the Lua script to write to. |
|||
character(len=*), | optional | :: | key |
Name for the simulation control table. Default is sim_control. |
Dump the current time (now) of the simControl to outUnit.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_simControl_type), | intent(inout) | :: | me |
Simulation control settings to write to outUnit. |
||
integer, | intent(in) | :: | outUnit |
File unit to write to. |
Dump simcontrol information to the specified outUnit.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_simControl_type), | intent(inout) | :: | me |
Simulation control settings to write to outUnit. |
||
integer, | intent(in) | :: | outUnit |
File unit to write to. |
Synchronize the status bits across all processes and update the time.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_simControl_type), | intent(inout) | :: | me |
Simulation control information. |
||
type(tem_comm_env_type), | intent(in) | :: | proc |
Communicator to use for the communication of status flags. |
||
real(kind=rk), | intent(in), | optional | :: | dt |
Time step to use for updating the simulation time. |
|
integer, | intent(in), | optional | :: | d_iter |
Number of iterations to add to the current number of iterations. (Default: 1) |
|
integer, | intent(in), | optional | :: | outUnit |
Unit to write messages to. |
Clear the status flags in the simcontrol.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_simControl_type), | intent(inout) | :: | me |
Simulation control information. |
Reset trigger, status bit and current time for steady state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(tem_simControl_type), | intent(inout) | :: | me |