Creating Your Own Workflow

if the available workflows do not provided simulation that you want to perform, you can create your own worklow by glueing together the available functions at the xtp_workflow.

If non of the functions at the xtp_workflow modules satifies your needs, you can create your own function using the xtp_job_control.workflows.workflow_components.call_xtp_cmd() and xtp_job_control.workflows.workflow_components.call_xtp_cmd(). The following code snippet, ilustrates the creation of a call to the xtp_map command using a promised system argument provided by another job called job_system.

 results = Results({})

 # Other jobs executed here
 ...

args = create_promise_command(
    "xtp_map -t {} -c {} -s {} -f {}",
    topology, trajectory,
    results['job_system']['system'], path_state)

results['job_state'] = call_xtp_cmd(args, workdir, expected_output={'state': 'state.sql'})

the expected_output argument in the function, search for output files created by the command. In the current case, the xtp_map command generates a file called state.sql. The ouput files can be access by other jobs using the name provided in the dictionary. For example, the state.sql is available using the following notation:

state_file = results['job_state']['state']

Command line wrappers

The following functions create an schedule call to a Votca-XTP command.

xtp_job_control.workflows.workflow_components.call_xtp_cmd(cmd: str, workdir: str, expected_output: dict = None)

(scheduled) Run a bash cmd in the workdir folder and search for a list of expected_output files.

xtp_job_control.workflows.workflow_components.create_promise_command(string: str, *args) → str

(scheduled) Use a string as template command and fill in the options using possible promised args