Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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 and the name of directory where actor is installed
    • value: string
    • example: 'my_subroutine' 
  • 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"
  • 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 containing parameters and schema entry:
    • 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'

...

  • 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
      languagepy
      from physics_ii.python_common.job_settings import RunMode
      
      self.physics_ii.runtime_settings.run_mode = RunMode.STANDALONE


  • 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 DebugMode.STANDALONE - similarly to STANDALONE run mode - an actor runs native code as executable in a separate system process, but this time under debugger control. Debugged code can be run several times. To proceed with workflow execution is enough to close the debugger. This debugging mode is suitable for most of the actorspurposes.   
    • RunModeDebugMode.STANDALONEATTACH - 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 a debugger as parallel process, attaching it to a running workflow and setting breakpoint on wrapped native code of the debugged actor.  Because debugger attaches to a workflow (and not a particular actor) killing debugged process kills the whole workflow. This mode has to be chosen if the issue within code cannot be reproduced in STANDALONE mode and the issue results from actor interdependencies (e.g. one actor overwrites memory of the other one).
    • Example: 

      Code Block
      languagepy
      from physics_ii.python_common.job_settings import DebugMode
      
      self.physics_ii.runtime_settings.run_mode = DebugMode.STANDALONE

from core2dist.python_common.job_settings import RunMode, DebugMode

...


  • MPI settings
    • Currently only number of nodes to run a code in parallel are defined
    • Defined by setting: <actor name>.runtime_settings.

...

    • mpi.number_of_processes = value
    • Please note: 
      • MPI code is run always in standalone mode
      • If a native code is not marked as 'MPI' during actor generation, this setting is ignored
  • IDS storage settings:
    • This attribute defines settings of temporary storage being used while passing IDSes between an actor and native code.
    • Defined by setting: <actor name>.runtime_settings.ids_storage.<storage_parameter> = value
    • Storage parameters that can be set:
      • db_name: 
        • Meaning: name of data base to be used
        • Default value: 'tmp'
      • shot:
        • Meaning - shot number
        • Default value - 9999
      • run :
        • Meaning - run number
        • Default value - 9999
      • backend:
        • Meaning - backend to be used
        • Default value - imas.imasdef.MEMORY_BACKEND 
      • persistent_backend 
        • Meaning - backend to be used when temporary data cannot be stored in memory (e.g. while running actor in a standalone mode, when a native code is run as separate process, so it doesn't share memory with other actors.
        • Default value -  imas.imasdef.MDSPLUS_BACKEND
    • Please note: for most of the purposes it is fine to not set this property and leave default values unchanged.
  • Other settings - not yet implemented:
    • Sandbox settings
    • Batch job settings
    • OpenMP settings



Actor life cycle

 Workflow example

...