Visual Studio Code: Difference between revisions

Jump to navigation Jump to search
Clarified external terminal vs VS Code terminal
(How to get SLURM_TMPDIR)
(Clarified external terminal vs VS Code terminal)
Line 100: Line 100:
Connection procedure:
Connection procedure:
# Make sure VS Code Server is installed as described in the previous section.
# Make sure VS Code Server is installed as described in the previous section.
# Start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>).
# In an external <b>[[SSH|SSH client]]</b> connected to the cluster, start a new <b>[[Running_jobs#Interactive_jobs|interactive job]]</b> (with <code>salloc</code>).
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).
## <b>Important:</b> make sure to request enough memory (at least <code>2000M</code>).
## Take note of the allocated compute node name.
## Take note of the allocated compute node name.
## Take note of the job identifier (usually a number in the millions).
## If you will need to work with <code>SLURM_*</code> environment variables in VS Code, save them all in a ''source'' file: {{Command|env {{!}} grep SLURM_ {{!}} sed -e 's/^\(.*\){{=}}\(.*\)$/export \1{{=}}"\2"/g' > slurm_var.sh}}
# In VS Code, start a new remote session with the name of the allocated compute node:
# In VS Code, start a new remote session with the name of the allocated compute node:
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.
## Press <code>F1</code> or <code>Ctrl+Shift+P</code> to start the command prompt <code>&gt;</code> in the Command Palette.
Line 109: Line 109:
## Enter the noted compute node name.
## Enter the noted compute node name.
### If you get prompted for the type of operating system, select <b>Linux</b>
### If you get prompted for the type of operating system, select <b>Linux</b>
# If you need to work with <code>SLURM_*</code> environment variables in the VS Code terminal, you need to recreate them manually from values in the interactive session started with <code>salloc</code>:
# If you need to work with <code>SLURM_*</code> environment variables, navigate to the working directory in a VS Code terminal and ''source'' the <code>slurm_var.sh</code> file: {{Command|source slurm_var.sh}}
## For the <code>SLURM_TMPDIR</code> variable, use the noted job identifier. For example, with 12345678, in the VS Code terminal:
{{Command|export SLURM_TMPDIR{{=}}/localscratch/$USER.12345678.0}}


=Troubleshooting= <!--T:21-->
=Troubleshooting= <!--T:21-->
cc_staff
782

edits

Navigation menu