JUSTUS2/Software/Julia/VSCode: Difference between revisions
M Carmesin (talk | contribs) |
M Carmesin (talk | contribs) No edit summary |
||
| (4 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
== Wrapper Script for Module Loading== |
== Wrapper Script for Module Loading== |
||
Using Julia requires loading the module, whcih is not directly supported by the Julia extension of VS Code. Thus we need a wrapper script for this: |
|||
The Julia Extension of VS Code needs to run Julia, which requires loading the module. |
|||
Save the following wrapper script e.g. as $HOME/bin/julia_wrapper.sh and make it executable: |
Save the following wrapper script e.g. as $HOME/bin/julia_wrapper.sh and make it executable: |
||
<syntaxhighlight lang="bash"> |
|||
| ⚫ | |||
#!/bin/bash |
#!/bin/bash |
||
| Line 22: | Line 22: | ||
# Pass on all arguments to julia |
# Pass on all arguments to julia |
||
exec julia "${@}" |
exec julia "${@}" |
||
</syntaxhighlight> |
|||
| ⚫ | |||
Next, we need to configure VSCode to use the script as Julia executable. You find the corresponding setting at File|Preferences|Settings → Tab “Remote” → Extensions|Julia → setting “Julia: Executable path“ |
Next, we need to configure VSCode to use the script as Julia executable. You find the corresponding setting at File|Preferences|Settings → Tab “Remote” → Extensions|Julia → setting “Julia: Executable path“ |
||
| Line 28: | Line 28: | ||
== Connect to Nodes == |
== Connect to Nodes == |
||
If you |
If you don't need considerable CPU resources or memory you can develop your code on the login nodes. If you however need more resources, you must use an interactive job, see [[BwForCluster_JUSTUS_2_Slurm_HOWTO#How to submit an interactive job?]]. |
||
You can only connect to the compute nodes via a login node. Therefore you need to adjust your SSH config to use a login node for a proxy jump to the compute node, where your interactive job is running. Thus add the following lines to $HOME/.ssh/config on your PC: |
|||
| ⚫ | |||
Host n???? |
|||
User YOUR_JUSTUS_USERNAME |
|||
ProxyJump justus2.uni-ulm.de |
|||
| ⚫ | |||
Please replace YOUR_JUSTUS_USENAME by your username on the cluster. |
|||
To avoid to enter repeatedly your password, you should set up an SSH key to login. |
|||
# proxy jump |
|||
# SSH keys |
|||
Latest revision as of 10:38, 3 July 2026
Setting Up VS Code for Interactive Julia Sessions
Wrapper Script for Module Loading
Using Julia requires loading the module, whcih is not directly supported by the Julia extension of VS Code. Thus we need a wrapper script for this:
Save the following wrapper script e.g. as $HOME/bin/julia_wrapper.sh and make it executable:
#!/bin/bash
## Making module command available
## ------------------------------------------------------------
export MODULEPATH=/opt/bwhpc/ul/modulefiles/Core:/opt/bwhpc/common/modulefiles/Core:/etc/modulefiles:/usr/share/modulefiles:/usr/share/modulefiles/Linux:/usr/share/modulefiles/Core:/usr/share/lmod/lmod/modulefiles/Core
source /usr/share/lmod/lmod/init/profile
## ------------------------------------------------------------
# Load julia
module load math/julia/1.11.3
# Pass on all arguments to julia
exec julia "${@}"
Next, we need to configure VSCode to use the script as Julia executable. You find the corresponding setting at File|Preferences|Settings → Tab “Remote” → Extensions|Julia → setting “Julia: Executable path“
Connect to Nodes
If you don't need considerable CPU resources or memory you can develop your code on the login nodes. If you however need more resources, you must use an interactive job, see BwForCluster_JUSTUS_2_Slurm_HOWTO#How to submit an interactive job?.
You can only connect to the compute nodes via a login node. Therefore you need to adjust your SSH config to use a login node for a proxy jump to the compute node, where your interactive job is running. Thus add the following lines to $HOME/.ssh/config on your PC:
Host n????
User YOUR_JUSTUS_USERNAME
ProxyJump justus2.uni-ulm.de
Please replace YOUR_JUSTUS_USENAME by your username on the cluster.
To avoid to enter repeatedly your password, you should set up an SSH key to login.