A VSCode extension to run Slurm batch jobs on HPC clusters directly from your IDE.
Features
Recognises .slurm files as a distinct file type
Provides an inline "Run on cluster" button at the top of Slurm scripts
Automatically copies your code to the cluster using rsync
Submits the job using sbatch and displays the job ID
Requirements
VSCode 1.97.0 or later
rsync installed on your local machine
SSH access to a Slurm cluster
Usage
Install the extension from the VSCode marketplace
Open a .slurm file in VSCode
If you haven't set a cluster yet, you'll be prompted to enter an SSH command (e.g., ssh user@cluster.example.com)
Click the "Run on [cluster]" button that appears at the top of the file
The extension will:
Check if rsync is installed
Copy your workspace to /home/$USER/clusterfudge/latest_run on the cluster
Submit the job using sbatch
Display the job ID
Configuration
You can set your cluster SSH command through:
The command palette: Clusterfudge: Set Cluster SSH Command
VSCode settings: Add "clusterfudge.sshCommand": "ssh user@cluster.example.com" to your settings.json
How it works
The extension finds the workspace root (defined by a .git directory or the root of the workspace) and synchronises all files to the cluster. It then runs sbatch on the cluster to submit the job.