Adding new task

To add a new task to the litesoph, choose an engine that is already interfaced with the code base, else see Adding new engine.

All the tasks in litesoph are classes that inherits from the base class litesoph.common.task.Task. The task class is responsible for generating input scripts, job scripts, running the job, and storing the output generated for that task.

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

  1. Add the new task identifier in the litesoph.common.task_data.TaskTypes.

  2. Create your task class by subclassing the litesoph.common.task.Task

  3. Implement the abstract methods of the litesoph.common.task.Task

  4. update the egine manger to account for the new added task. see Adding new engine

See also

  • The code for our GPAW tasks: \(litesoph.engines.gpaw.gpaw_task.py\)

Description of base-classes

The Task base-classes

class litesoph.common.Task(lsconfig, task_info, dependent_tasks=None)[source]

Base-class for all tasks. All the tasks in the litesoph inherets from this class. This class is interfaced with SubmitLocal and SubmitNetwork class.

Parameters:
  • lsconfig – The configuration dictionary the has information about path of engine binarys.

  • task_info (TaskInfo) – This is the empty TaskInfo object to store all the data generated by the task.

  • dependent_tasks (List[TaskInfo] | None) – This is a list of TaskInfo objects of other tasks that this task is dependent on.

abstract create_template()[source]

This method creates engine input and stores it in the task info. Store the engine input in taskinfo.input[‘engine_input’][data] filepath in taskinfo.input[‘engine_input’][‘path’]

abstract write_input()[source]

This method creates engine directory and task directory and writes the engine input to a file.

create_job_script()[source]

Create the bash script to run the job and “touch Done” command to it, to know when the command is completed.

add_proper_path(path)[source]

This replaces the local paths to remote paths in the engine input.

class litesoph.common.task_data.TaskTypes(value)[source]

An enumeration.