VSCode
Microsoft VSCode is a common tool for software development, and can be used with Spartan.
Please note however that it can cause problems in its default configuration. First you will need to limit its behavior so that it does not get overloaded with the amount of files on the HPC system. Secondly, you must configure it to actually use Spartan's Slurm system. This will allow you to run directly on compute hardware, rather than on Spartan's login nodes... This is to prevent your processes being terminated when they exceed default limits, and to prevent user processes running into each other.
Index limiting
A few changes must be made to your settings.json file to ensure that VSCode does not try to index certain file locations, mostly because of their prohibitive sizes. If you do not do this step you may see VSCode become unresponsive as it attempts to read all the files in these locations and map them.
Important
These changes must be synced to "~/.vscode-server/data/Machine/settings.json" file on Spartan and not just in your desktop/laptop's settings.json. Choose the appropriate Remote SSH sync setting option(s) in VSCode to synchronize your exclude settings to the remote host.
Settings
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"/apps/**": true,
"/data/gpfs/**": true,
"/data/projects/**": true,
"/data/cephfs/**": true,
"/data/scratch/**": true,
"/scratch/**": true},
"search.followSymlinks": false,
"search.exclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"/apps/**": true,
"/data/gpfs/**": true,
"/data/projects/**": true,
"/data/cephfs/**": true,
"/data/scratch/**": true,
"/scratch/**": true},
Connecting via slurm
You will first need to install the Remote SSH extension.
After Remote SSH is installed, press F1. Use the search interface to locate (Remote-SSH: Open SSH Configuration File) and add the following, replacing 'username' with your own Spartan account name.
Settings
Important
Advanced users can alter the RemoteCommand --salloc-arg=
settings to customise the Slurm session that is being requested. Note that requesting more resources may increase wait times when initiating your session
press F1 again, select Preferences: Open User Settings (JSON):
Settings
Important
You must alter the above file directly rather than using the VSCode Settings menu. There is a form entry at Settings>Extensions>Remote-SSH>useLocalServer that is currently not working in the Windows version of this plugin. Because of this and releated issues, you must also ake sure there are no entries in Settings>Extensions>Remote-SSH>RemotePlatform list.
-
Connecting to Spartan
Press F1 and select Remote-SSH: Connect to Host. You will be presented with a list of locations, including the hostname set in your SSH configuration file. Assuming you have followed the above directions, you should see 'spartanslurm' in the list. Selecting this entry should start the connection process.
After you have connected, open a terminal from the Terminal dropdown menu and enter the linux command
hostname
. You should see 'spartan-bm' suffixed with a number. If you instead see 'spartan-login' then something has gone wrong in the setup.Assuming you are connected correctly you should now be able to execute code on Spartan's compute nodes. If you are unable to connect as expected then please contact Spartan's admins.