...
programming_language
- meaning: language of physics code
- value: one of predefined values: 'Fortran', 'CPP'
- example: 'Fortran'
code_name
- meaning:
- name of user method / subroutine to be called,
- must be exactly the same as name of called method / subroutine
- it is used also as an actor name
- value: string
- example: 'my_subroutine'
- meaning:
data_type
- meaning: data type handled by the physics code
- value: 'legacy' (currently only 'Legacy IDS' type has been implemented)
- example: 'legacy'
arguments
- list of arguments- argument definition:
- name:
- meaning: user defined argument name
- value: string
- example: equilibrium00
- type:
- meaning: a type of an IDS argument
- value:
- predefined name of one of the IDSes
- example: 'equilibrium'
- intent
- meaning: determines if given argument is input or output one
- value: predefined - string "IN", "OUT"
- name:
- argument definition:
code_path:
- meaning: path to system library (C, CPP) , script (Python), etc containing the physics code, including method/subroutine to be run
- value: string, valid path to file
- example: 'any text'
code_parameters
- a structure containingparameters
and schemaentry
:parameters
:- meaning: path to XML file containing user defined parameters of the physics code
- value: string, valid path to file
- example: './code_parameters/parameters.xml'
schema
:- meaning: path to XSD file contains schema of XML parameters, to be able to validate them
- value: string, valid path to file
- example: './code_parameters/parameters.xsd'
...
from physics_ii.actor import physics_ii
Actor runtime settings
Among the actor properties one is especially important: runtime_settings.
This property tells the wrapper how native code should be run and defines:
- Run mode
- Defined by setting:
<actor name>.runtime_settings.run_mode = value
Import of enumerated values:
from <actor name>.python_common.job_settings import RunMode
RunMode.NORMAL
(default) - native code is called directly from Python, within the same process (and environment) that workflow script. Usually system resources, shared with other Python threads are limited, however this mode is suitable for most of the actors.RunMode.STANDALONE
- an actor runs native code as executable in a separate system process, having its own environment and (usually) bigger system resources available. This mode is suitable e.g. for memory demanding code.Example:
Code Block language py from physics_ii.python_common.job_settings import RunMode self.physics_ii.runtime_settings.run_mode = RunMode.STANDALONE
- Defined by setting:
- Debug mode:
- Defined by setting:
<actor name>.runtime_settings.debug_mode = value
- Import of enumerated values:
from <actor name>.python_common.job_settings import DebugMode
RunMode.NORMAL
(default) - native code is called directly from Python, within the same process (and environment) that workflow script. Usually system resources, shared with other Python threads are limited, however this mode is suitable for most of the actors.RunMode.STANDALONE
- an actor runs native code as executable in a separate system process, having its own environment and (usually) bigger system resources available. This mode is suitable e.g. for memory demanding code.Example:
Code Block language py from physics_ii.python_common.job_settings import DebugMode self.physics_ii.runtime_settings.run_mode = DebugMode.STANDALONE
- Defined by setting:
from core2dist.python_common.job_settings import RunMode, DebugMode
self.actor_cp2ds.runtime_settings.run_mode = RunMode.STANDALONE #self.actor_cp2ds.runtime_settings.debug_mode = DebugMode.ATTACH
Actor life cycle
Workflow example
...