Adding new engine

The litesoph code base is structured in a modular format, see Code Architecture, so that it is simple and staright-forward to add a new engine or task.

To integrate an engine into litesoph, a class interface must be implemented, which inherits the base class EngineManager. This interface will handle all the queries regarding the engine coming from the workflow manager.

The step by step procedure to add a new engine to the litesoph code base is described below.

1. Add engine to the litesoph.engines.engine_classname dictionary. The key should be the name of the engine and the value should be the class name used to define the engine manager. For Example, if the engine name is: newengine.

{'newengine': 'NewEngine'}

Where NewEngine will be the class name used to define the engine manager

2. Create a new directory in litesoph.engines name it as newengine and add a new python file in this directory and name it as newengine_manager.py.

3. In the new file newengine_manager.py create a new subclass of EngineManager and name it as NewEngineManager

4. In the class NewEngineManager implement all the abstract methods of the super class EngineManager

See also

  • The code for our NWChem interface: \(litesoph.engines.newchem.nwchem_manager.py\)

Description of base-classes

The Engine base-classes

litesoph.engines.engine_classname

alias of {‘gpaw’: ‘GPAW’, ‘nwchem’: ‘NWChem’, ‘octopus’: ‘OCTOPUS’}

class litesoph.common.engine_manager.EngineManager[source]

Base class for all litesoph engines.

Parameters:
  • Name – name of the engine.

  • implemented_tasks (List[str]) – list of task identifiers of the tasks that are implemented.

  • implemented_workflows (List[str]) – list of workflow identifiers of the workflows that are implemented.

abstract get_task(config, workflow_type, task_info, dependent_task)[source]

This class checks if a task is implemented and if it is implemented it returns the task object else raises a TaskNotImplementedError.

abstract get_default_task_param(name, dependent_task)[source]

This mentods return the default parameters for a given particular task.

get_task_list()[source]

This method returns the list of implemented tasks in this engine

get_workflow_list()[source]

This method returns the list of implemented tasks in this engine

check_task(name)[source]

This method checks if a given task is implemented in this engine if not it raises a TaskNotImplementedError