.. _templates:

Jinja templates
===============

These templates are filled with the :ref:`inputs_context` and the :ref:`inputs_envvars` that are generated by the workflow for each task.

.. _templates.job.sh:

The :file:`job.sh` template
---------------------------

This template is used by :meth:`woom.tasks.Task.render_content` to create the job script.

.. literalinclude:: ../woom/templates/job.sh
    :language: jinja
    :caption: Default :file:`job.sh` jinja template

.. _templates.env.sh:

The :file:`env.sh` template
---------------------------

This template is used by :meth:`woom.env.EnvConfig.render` to format the environment declaration in :ref:`templates.job.sh`.

.. literalinclude:: ../woom/templates/env.sh
    :language: jinja
    :caption: Default :file:`env.sh` jinja template

.. _templates.sentinel.sh:

The :file:`sentinel.sh` template
---------------------------------

This template is used to create the sentinel job script that monitors all workflow jobs when using a scheduler (SLURM, PBS Pro). The sentinel automatically kills jobs on failure and terminates non-blocking jobs when all blocking jobs complete.

.. literalinclude:: ../woom/templates/sentinel.sh
    :language: jinja
    :caption: Default :file:`sentinel.sh` jinja template
