"* `walltime` (str): walltime ( <=> `-t` option in slurm)\n",
"* `python_venv` (str): path to the python environment to source before executing script lines\n",
"* `modules` (tuple of str): module names to load before executing script lines\n",
"* `sbatch_extra_params`: dict: possible extra parameter to be used when cal the 'sbatch' command. For now handles 'export' only"
"* `sbatch_extra_params`: dict: possible extra parameter to be used when calling the 'sbatch' command. For now handles 'export' and 'gpu_card'"
]
},
{
...
...
@@ -80,9 +80,6 @@
}
],
"metadata": {
"nbsphinx": {
"allow_errors": true
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
...
...
@@ -99,6 +96,9 @@
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
},
"nbsphinx": {
"allow_errors": true
}
},
"nbformat": 4,
...
...
%% Cell type:markdown id: tags:
# How to launch a shell script to slurm using sluurp
The class to launch a shell script to slurm is `SBatchScriptJob` and with it you must provide:
*`slurm_config`: configuration to slurl
*`script`: script to launch
*`script_path`: where to save the script (if clean_script is set to True) then this script will be removed once processing is done. It can be useful to keep it for debugging
*`working_directory`: working directory to provide to `SBATCH` when executing the script
Once the job is created you can submit it to slurm using the `submit` function from `sluurp.executor`
%% Cell type:markdown id: tags:
## slurm_config
`slurm_config` must be provided as a dictionary and can contain the following keys:
*`cpu-per-task` (int): define number of cpu to require for each task
*`n_tasks` (int): define th enumber of tasks
*`memory` (int): memory in GB ( <=>`--mem` option in slurm)
*`partition` (str): partition to be used
*`n_gpus` (int): number of gpu to use
*`job_name` (str): name of the job ( <=>`-J` option in slurm)
*`walltime` (str): walltime ( <=>`-t` option in slurm)
*`python_venv` (str): path to the python environment to source before executing script lines
*`modules` (tuple of str): module names to load before executing script lines
*`sbatch_extra_params`: dict: possible extra parameter to be used when cal the 'sbatch' command. For now handles 'export' only
*`sbatch_extra_params`: dict: possible extra parameter to be used when calling the 'sbatch' command. For now handles 'export' and 'gpu_card'