Customizing the submission script header

When submitting jobs to some clusters, such as the Tiger Cluster 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 strategy/customized_script_header_template_file to a template file:

 2  "number_node": 1,
 3  "cpu_per_node": 32,
 4  "kwargs":{
 5    "qos": "tiger-vshort"
 6  },
 7  "source_list": ["activate abacus_env"],
 8  "strategy": {
 9    "customized_script_header_template_file": "./template.slurm"
10  },
11  "group_size": 2000

template.slurm is the template file, where str.format() is used to format the template with Resources Parameters:

1#!/bin/bash -l
2#SBATCH --parsable
3#SBATCH --nodes={number_node}
4#SBATCH --ntasks-per-node={cpu_per_node}
5#SBATCH --qos={kwargs[qos]}
6#SBATCH --time=01:02:00
7#SBATCH --mem-per-cpu=4G

See Python Format String Syntax for how to insert parameters inside the template.