Note
Go to the end to download the full example code. or to run this example in your browser via Binder
How to run in SLURM#
Note
This is a quick how-to on SLURM. See here for a long-form tutorial.
See the default SLURM options, used when slurm=True
import spikewrap as sw
import json
default_arguments = sw.default_slurm_options()
print(
json.dumps(default_arguments, indent=4) # json just for visualising output
)
{
"nodes": 1,
"mem_gb": 40,
"timeout_min": 1440,
"cpus_per_task": 8,
"tasks_per_node": 1,
"wait": false,
"env_name": "spikewrap",
"slurm_partition": "cpu"
}
Otherwise, we can update these as desired:
gpu_arguments = sw.default_slurm_options("gpu")
gpu_arguments["mem_gb"] = 60
gpu_arguments["env_name"] = "my_conda_environment"
print(
json.dumps(gpu_arguments, indent=4)
)
# and then use like:
# session.save_preprocessed(n_jobs=12, slurm=gpu_arguments)
{
"nodes": 1,
"mem_gb": 60,
"timeout_min": 1440,
"cpus_per_task": 8,
"tasks_per_node": 1,
"wait": false,
"env_name": "my_conda_environment",
"slurm_partition": "gpu",
"slurm_gres": "gpu:1",
"exclude": "gpu-sr670-20,gpu-sr670-21,gpu-sr670-22"
}
Total running time of the script: (0 minutes 0.001 seconds)