Actor execution and debug modes


Kepler actor, could be run in two main execution modes: JNI and 'standalone' and related debugger modes.

 Execution modes 

 JNI mode

User codes are run directly from an actor, within a Kepler process, using Java JNI mechanism.

 Standalone mode

When 'standalone' mode is set, Kepler runs an actor, as an independent system process, waiting only for its finish and produced outcomes.

'Standalone' mode uses more system resources (it is a separate system process!), however running actor in this mode may solve memory issues related with: insufficient memory owned by JVM or memory overriding (user code is run in separate memory space). 

More in details - when actor with is fired in 'standalone' mode:


Please notice that 'standalone' mode  is different from JNI execution:

 Debugging a user code

Sequential codes

A user codes could be debugged using a chosen debugger in a way corresponding to execution modes described above. 

  1. JNI/Attach - Debugger attaches to a running Kepler process:
  2. Standalone - debugger 'owning' executable  (<actor_name>.exe)  is started with as a separate process

MPI codes

Debugging MPI codes is available only from commandline. User should go to an actor folder (~/public/KEPLEREXECUTION/<actor_dir>), and run  'mpiexec' providing appropriate debug options

An example:

mpiexec <debugger switch>  -np 2 ./<actor_name>_exe 


Unfortunately not only switches values differ regarding to MPI implementation, but also 'intel's' and 'gnu's' mpiexec behaves differently: under intel one it is impossible to restart an application that already finished...


MPI VendorTotalView GDB
Intel-tv-gdb
GNU

-tv (deprected}

-- debug --debugger totalview


-- debug --debugger gdb



Actor cache

To add  a little complexity to the FC2K generated wrappers would be to add an optional new port (triggered by a choice in the GUI) which would take as input 0 or 1.

  • In the case of a 1, the physics code would be called in the usual way, but the result would also be "remembered" internally by the wrapper.
  • In the case of a 0, the physics code would not be called, but the result remembered by the wrapper would be replayed.

This would allow for cleaner, less complicated workflows and a great deal more flexibility in changing the frequency with which codes are called.

An additional, Boolean, port useCachedResults has been added to actors generated by FC2K

Cache OFF

Port useCachedResults  is not connected or it is connected but set to false.

Actor execution:

Cache ON

Port useCachedResults  is connected and set to true.

Actor execution:

Sandbox

"Sandbox" - a directory, in which actor will be run. Before execution of user codes wrapped by FC2K generated actor, directory will be changed to "sandbox", and after actor finishes, current directory will be switched back to previous value. The name (path) of "sandbox" directory will be created automatically or specified by user in actor configuration dialog. 

Actor will use existing directory or will create it, if directory not exists. All directories created automatically or having user specified relative path will be created under <SANDBOX_ROOT> ( $ITMSCRATCH/KEPLER_SANDBOXon the Gateway).

FC2K settings


"Use sandbox" - enables / disables "sandbox"

"Sandbox" disabled

"Sandbox" enabled:


Actor configuration dialog

  1. Run in sandbox
  2. Sandbox lifetime
  3. Clean up sandbox
  4. Sandbox directory path
  5. Delete sandbox

'Dummy' actors

When porting a workflow to a new platform, or to a new data-version, it often happens that some subset of the actors are not immediately available in the new environment. Rather than build a new workflow with these actors removed, and then have to re-build the workflow as and when actors become available, user can temporarily replace the missing actors with a generic dummy actor which:

FC2K settings

Actor generation:

Runtime actions:

Replacing a "dummy" by "regular" actor:

This work has been carried out within the framework of the EUROfusion Consortium and has received funding from the Euratom research and training programme 2014-2018 under grant agreement No 633053.The scientific work is published for the realization of the international project co-financed by Polish Ministry of Science and Higher Education in 2019 and 2020 from financial resources of the program entitled "PMW"; Agreement No. 5040/H2020/Euratom/2019/2 and 5142/H2020-Euratom/2020/2”.