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.
Add the new task identifier in the
litesoph.common.task_data.TaskTypes
.Create your task class by subclassing the
litesoph.common.task.Task
Implement the abstract methods of the
litesoph.common.task.Task
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.