KTH framework for Nek5000 toolboxes; testing version
0.0.1
|
An important issue for our framework is organised structure of runtime parameters that would allow for simple modiffication of parameter list without introducing conflicts between different code parts. As old ###.rea file does not provide sufficent flexibility, all tool developers are obligated to use new ###.par file instead, as it organises runtime parameters by sections and in addition to 20 user parameters in [GENERAl] section allows to introduce user defined sections. Every section starting with underscore is treated as user section and its consistency is not checked by Nek5000 core code. Following examples shows two native Nek5000 sections and three user sections:
We utilize user defined sections in ###.par to set values of runtime parametes defined in different modules. To simplify interaction between different tools the frame module provides dynamical database of all available runtime parameters in the framework. To provide requred information to the framework we introduce the module registration phase and split if from the module intialistation. All these steps are performed by frame_start, which initialises the framework itself and next calls a user interface frame_usr_register. This routine shoud be placed in ###.usr and contain calls to the module registration routines. The registration of the module consists of signing up the module in the database followed by the runtime parameters definitions (name, type, description and default value) and finalised with timers definitions. This information is used to check consistency of the ###.par file and to fill in runtime parameter database. Next user defined frame_usr_init is called by frame_start. It initilises all the modules by calling their initialisation routines. This operation consists of taking back updated values of runtime parameters from the database and performing requred by the module addtional operations.
Following example shows the way a statistics module is initialised:
Each tool has to provide routines for registration, intialisation and finalisation of the given module. chkpt_register and chkpt_init are good example of them.
Dependencies between different modules can be expressed as a tree structure, which we would like to follow in our database. That is why each module during registration has to specify its parent, which can be its real parent module (for submodules) or FRAME module (the first module registered by frame). In a similar way we specify parents for timers.
The list of all defined parameters, their dafault values and dependency between different modules are described in following pages: