Skip to content

Commit

Permalink
docs: document customized header (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz committed Oct 23, 2023
1 parent cb77da2 commit 0238340
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions doc/examples/template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Customizing the submission script header

When submitting jobs to some clusters, such as the [Tiger Cluster](https://researchcomputing.princeton.edu/systems/tiger) at Princeton University, the Slurm header is quite different from the standard one. In this case, DPDispatcher allows users to customize the templates by setting {dargs:argument}`strategy/customized_script_header_template_file <resources/strategy/customized_script_header_template_file>` to a template file:

```{literalinclude} ../../examples/resources/tiger.json
:language: json
:linenos:
```

`template.slurm` is the template file, where {meth}`str.format` is used to format the template with [Resources Parameters](resources):

```{literalinclude} ../../examples/resources/template.slurm
:linenos:
```

See [Python Format String Syntax](https://docs.python.org/3/library/string.html#formatstrings) for how to insert parameters inside the template.
5 changes: 4 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ DPDispatcher will monitor (poke) until these jobs finish and download the result
:caption: Examples
:glob:

examples/*
examples/expanse
examples/g16
examples/shell
examples/template

.. toctree::
:caption: Project details
Expand Down

0 comments on commit 0238340

Please sign in to comment.