Demo workflows#
A good way to get started with hpcFlow is to run one of the built-in demo workflows. This will also test your installation, configuration, and some of your environments.
Submit a workflow#
hpcFlow comes with some demo workflows, which can be listed using
hpcflow demo-workflow --list
We can run the following command to copy the in-built workflow file to the current directory (note the final dot at the end),
hpcflow demo-workflow copy <workflow_name.yaml> .
which we can then use to submit the workflow.
hpcflow go <workflow_name.yaml>
This small workflow should complete in less than 30s. Note that there is also a convenience shortcut for the demo workflows which combines the copy-then-submit pattern we saw above:
hpcflow demo-workflow go <workflow_name.yaml>
However, in general workflows would first be created in a yaml file which is then submitted using
hpcflow go WORKFLOW_FILE.
Follow jobscript output#
Add --follow (or -f) when submitting to display jobscript standard output
and error as they are written:
hpcflow go WORKFLOW_FILE --follow
hpcflow workflow WORKFLOW_REF submit --follow
hpcflow demo-workflow go <workflow_name.yaml> --follow
Following also waits for execution to finish; --wait is not required.
Output already written is displayed from the beginning, followed by new output.
As jobscripts start, their output is picked up automatically, including parallel
direct jobscripts. Following is currently supported only for direct schedulers.
Submission with --follow is rejected before launching any jobscripts if a
jobscript to be submitted uses a non-direct scheduler (such as Slurm or SGE).
Likewise, wait --follow rejects selections containing non-direct jobscripts
without polling their schedulers. Scheduler array jobs are not supported yet.
Headers identify the submission, jobscript, and stream. Separate error streams
are sent to stderr; combined stdout/error files are displayed only once, on stdout.
--quiet hides headers and status messages, but still displays job output.
Press Ctrl+C to stop following without cancelling workflow execution. To attach to an existing workflow’s active jobscripts later, use:
hpcflow workflow WORKFLOW_REF wait --follow
Use --jobscripts '0:0,1;1:0' with wait to select particular jobscripts,
including ones that have already finished. Output appears only when the job’s
program or scheduler flushes it to disk, so buffered programs may need their own
unbuffered-output options. Following does not change buffering or jobscript files.
Delete the workflow after completion#
Add --delete when submitting to permanently delete the workflow directory once
execution has finished, for example when only the job output or side effects are
needed:
hpcflow go WORKFLOW_FILE --delete
hpcflow go WORKFLOW_FILE --follow --delete
--delete implies --wait, and works with any scheduler. The workflow is
deleted without confirmation, whether or not execution succeeded, so any outputs
stored in the workflow (including jobscript standard output and error files) are
lost. If waiting is interrupted with Ctrl+C, the workflow is not deleted.
Check the status of a workflow#
After submitting a workflow, you can check whether it has run successfully using
hpcflow show -f
For clarification of the output, a legend can be shown using
hpcflow show --legend
Cancel a workflow#
Sometimes you might want to cancel a workflow that is running. Use
hpcflow cancel WORKFLOW_REF
where WORKFLOW_REF is either the path to the workflow directory,
or the ID of the workflow displayed by hpcflow show.
Workflow output#
In your working directory, a new directory will be created with the name of the workflow and the date and time of submission. This directory contains the output of the workflow, including your results files, the log files and any other files generated by the workflow.
The directory structure is as follows:
workflow_name_YYYY-MM-DD_timestamp/
├── artifacts/
│ ├── workflow.yaml
│ ├── submissions/
│ └── tasks/
├── execute/
├── metadata/
└── parameters/
The artifacts directory contains a copy of the workflow template file that you submitted, the submission files, and the task artifact files.
The submissions directory contains generated jobscripts that are submitted to the scheduler,
standard output and error stream files from those jobscripts, and app log files (if hpcFlow is configured to generate them).
If your workflow crashes, you should first check the files in the js_std directory to see what happened.
The tasks directory contains files associated with task execution that we wish to keep (for example input and output files for a simulation).
We can control which files are kept within the task schema.
The execute directory contains the working directories for the tasks, and so any output files generated by the software that is invoked will be here.
The metadata and parameters directories contain binary files, corresponding to workflow structural metadata, and input and output parameters, respectively.
You will not normally need to look at these files, but they are available there for advanced debugging and checkpointing.