Connecting/Logging in to the legacy cluster (Grid Engine)

Important

This page is for the legacy partition of the Hoffman2 Cluster, which runs the Altair Grid Engine (SGE) scheduler. For the production Hoffman2 Cluster, which runs the Slurm workload manager, see Connecting/Logging in.

The legacy cluster is reached through its own login host:

$ ssh login_id@hoffman2.idre.ucla.edu

where login_id is your Hoffman2 Cluster user name.

Your $HOME, $SCRATCH and project directories, if any, are shared between the legacy and the production cluster, but the operating system and the application software environment are different. Jobs are submitted on the legacy cluster with Grid Engine commands (qsub, qrsh), see: Computing with Altair Grid Engine on the legacy cluster.

Remote desktops via NX or X2Go are available only on the legacy cluster, see Connecting via remote desktop below; on the production cluster use DCV. Jupyter Notebook/Lab sessions on the legacy cluster use the Grid Engine version of h2jupynb, see Connecting via Jupyter Notebook/Lab below; for the production cluster see Jupyter Notebook/Lab with h2jupynb.

Connecting to the legacy cluster with SSH

Use the same terminal applications and SSH clients described in Connecting via terminal and SSH and Setting up SSH clients for Windows, using the legacy hostname hoffman2.idre.ucla.edu in place of the production hostname hoffman2.oarc.ucla.edu.

To open GUI applications with X11 forwarding (see Opening GUI applications), use:

$ ssh -X login_id@hoffman2.idre.ucla.edu   # Linux
$ ssh -Y login_id@hoffman2.idre.ucla.edu   # macOS with XQuartz

The first time you connect, SSH will ask you to confirm the authenticity of the host. Only accept the connection if the fingerprint matches one of the legacy cluster fingerprints.

SSH configuration for the legacy cluster

You can add a shortcut for the legacy cluster to your local $HOME/.ssh/config file, next to the one for the production cluster (see Hoffman2 Cluster specific customization):

Host hoffman2-legacy
  HostName hoffman2.idre.ucla.edu
  User substitute_your_H2_login_id_here
  ServerAliveInterval 30
  ServerAliveCountMax 5
  ForwardX11Trusted yes
  ForwardX11 yes

After saving the file, connect with:

$ ssh hoffman2-legacy

Legacy cluster hostkey fingerprints

The legacy cluster has the following classes of public, or external facing, hosts that are used to connect or to transfer data to and from the cluster:

Class

Hostname

Login nodes

hoffman2.idre.ucla.edu

Data transfer nodes

dtn.hoffman2.idre.ucla.edu

NX nodes

nx.hoffman2.idre.ucla.edu

x2go nodes

x2go.hoffman2.idre.ucla.edu

All of these hosts have the following hostkey fingerprint:

ED25519 SHA256: lZdo2eNOmwgroOyCOXXFFdQjfQQA1vMpBxgwhGwirwY
ED25519 SHA256 (hex): 959768d9e34e9b082ba0ec823975c515d4237d0400d6f329071830846c22af06
ED25519 SHA1: /vL4oZulkOMuLnA1hd0EGZx0GcI
ED25519 SHA1 (hex): fef2f8a19ba590e32e2e703585dd04199c7419c2
ED25519 MD5: a4:eb:80:cd:84:8d:e3:69:62:a2:4a:3c:7b:f6:6d:f7

RSA SHA256: kah9BJwSzrlFnVp9Tg+El2IdcCN7JgN5+Ur2RyIdvwM
RSA SHA256 (hex): 91a87d049c12ceb9459d5a7d4e0f8497621d70237b260379f94af647221dbf03
RSA SHA1: t+AS3JPkPxJvcsD7z63Vekcamt8
RSA SHA1 (hex): b7e012dc93e43f126f72c0fbcfadd57a471a9adf
RSA MD5: 3c:9c:67:d8:c5:a4:ae:77:07:5f:10:2f:20:4a:75:0f

Even though all of the legacy public hosts use the same ED25519 (or RSA) public hostkey, depending on the software package you use to connect, that public key can be represented with any one of the fingerprint hashes given above.

Warning

If the fingerprint hash doesn’t match one listed above, do not continue authentication and contact us here or by email at: support@idre.ucla.edu.

Connecting via remote desktop

Note

This section is for the legacy cluster. On the production (Slurm) cluster, remote desktops are provided by DCV, see Connecting via DCV remote desktop.

NX is a secure, compressed protocol for remote X Window System connections for Windows, Linux, and macOS that allows users to open a virtual desktop on the cluster. We currently support connecting to the Hoffman2 Cluster via the NoMachine client as well as the X2Go client. Advantages of connecting to the cluster via the NX protocol are: speed and the ability to suspend and reconnect to a virtual desktop session.

NoMachine client

Download NoMachine Client for your operating system

A free NoMachine client is available from NoMachine for Windows, macOS, and most Linux distributions.

  • Download NoMachine from the website

  • Use the download link for your operating system (Windows, macOS, or Linux Distributions)

Install

  • Once downloaded, double click on the downloaded package file.

  • Click the Run/Install button.

  • When the NoMachine Client Setup Wizard starts, accept all the setup defaults.

Configure

  • Open the NoMachine client and continue to the connection page

  • Click on the New link to create a connection to the Hoffman2 Cluster

  • Specify the protocol as SSH and press Continue

  • Provide the host name nx.hoffman2.idre.ucla.edu

  • Leave the port field set to 22 and press the Continue button

  • Select Use the system login and press the Continue button

  • Select Password and press the Continue button

  • Select Don’t use a proxy and press the Continue button

  • Name your connection and press the Done button

Note that if you are planning to suspend and reconnect to an NX session, you will need to repeat the configuration steps described above for the hosts:

nx1.hoffman2.idre.ucla.edu
nx2.hoffman2.idre.ucla.edu

Run

  • Open the NoMachine client and continue to the connection page

  • Click on the saved connection that you previously configured

  • Enter your username and password and your NX session with a virtual desktop on the cluster will start

  • The first time you connect to one of the Hoffman2 Cluster NX servers, the NX client software running on your local computer will prompt you with the fingerprint hash for the remote NX server, e.g.

The authenticity of host nx.hoffman2.idre.ucla.edu, 192.154.2.217, can't be established.
The RSA key fingerprint is:
SHA256 91 A8 7D 04 9C 12 CE B9 45 9D 5A 7D 4E 0F 84 97 62 1D 70 23 7B 26 03 79 F9 4A F6 47 22 1D BF 03.
Are you sure you want to continue connecting?
  • Since the SHA256 fingerprint in the box above matches one of the RSA fingerprints for the legacy cluster public hosts, you know you’re connecting to a Hoffman2 Cluster NX server and can continue the connection to get a NX session.

Warning

Only proceed to connect if the RSA key fingerprint displayed in the prompted message corresponds to one of the RSA fingerprints for the legacy cluster public hosts.

If the RSA key fingerprint does not match, do not continue authentication and instead, contact support.

How to get a terminal window

After you have logged into the Hoffman2 Cluster remote desktop, click on the Applications menu. Then select System Tools and Terminal.

Note

To pin the terminal to the panel, right click on the Terminal menu item and select Add this launcher to panel.

How to terminate your NX session

From the remote desktop, select:

System -> Log Out login_id …

A small window will open. Click the Log Out button.

How to suspend an NX session

Make note of the actual NX node where your session is running (typically NX1 or NX2) to allow for future reconnections. To terminate the NX client on your computer, close the application or close the virtual desktop window.

How to reconnect to a suspended NX session

If you are planning to reconnect to a session, make note of the actual NX node where your session is running (typically NX1 or NX2). Make sure to configure your NX client for the NX node where your session is running. You will need to create a configuration using either nx1.hoffman2.idre.ucla.edu or nx2.hoffman2.idre.ucla.edu. See the Configuration section for more detailed instructions.

Note

Reconnecting to a suspended NX session is not always possible. Lengthy computations should be run as batch jobs. We recommend terminating NX sessions (logout) instead of suspending them.

On fast networks, a preferred alternative to NX is to run an X server on your platform (e.g., X11 packages for linux platforms, XQuartz for mac OSX, XMing and Xming fonts for Windows), and connect to the cluster via a terminal (or via PuTTY on Windows platforms) by setting up X11 forwarding.

X2Go client

Install X2Go client

Follow the installation guide at X2Go site. Download the X2Go client, select the appropriate client for your operating system (Windows, macOS, Linux) and the correct version onto your computer.

Double-click on the icon of the downloaded package, accept the licensing terms, and follow the instruction on the screen.

Note

macOS users will need to install the XQuartz dependency prior to installing X2Go. It may be obtained on the XQuartz website. You may encounter a security warning prompting you that x2goclient.app is from an unidentified developer. Simply right click on the app again and select Open. See also the Mac section of Opening GUI applications.

Configure the X2Go client to connect to the Hoffman2 Cluster

Launch the application by double-clicking on the X2Go Client desktop icon, if you have chosen to create one during installation, or by searching for the application in your Applications folder and double-clicking on the x2goclient icon. If prompted by the Windows Firewall, select Allow access so that sshd.exe and other X2Go related programs will be able to run.

Create a new session

From the Session tab in the X2Go client select New session. You can name your session with any name (e.g., x2go@hoffman2). Leave the Path field unchanged and in the Host field enter:

x2go.hoffman2.idre.ucla.edu

Leave the other fields unchanged and choose the Session type to be MATE or Xfce. Save the new session by pressing the OK button.

You can also create sessions for the specific nodes x2go1 and x2go2 if you will need to reconnect to a suspended session. However, we strongly suggest you start new sessions by using the session associated with the x2go.hoffman2.idre.ucla.edu address. Sessions on the x2go1 and x2go2 nodes can be created by using in the “Host” field respectively:

x2go1.hoffman2.idre.ucla.edu
x2go2.hoffman2.idre.ucla.edu

Name the sessions accordingly (for example: x2go1@hoffman2, x2go2@hoffman2).

Start the X2Go client

To connect to the Hoffman2 Cluster open the X2Go client, double-click on an already created session, and enter your Hoffman2 Cluster username and password.

The first time you connect to a remote x2goserver, your x2goclient software will prompt to trust the remote servers’ host key, you should be seeing a pop up with information similar to:

The server is unknown.  Do you truyst the host key?
Public key hash: x2go.hoffman2.idre.ucla.edu:22 -
b7:e0:12:dc:93:e4:3f:12:6f:72:c0:fb:cf:ad:d5:7a:47:1a:9a:df

since the SHA1 fingerprint in the box above matches one of the RSA fingerprints for the legacy cluster public hosts, you know you’re connecting to a Hoffman2 Cluster x2go server and can continue the connection to get a virtual desktop session by pressing the Yes button.

Warning

Only proceed to connect if the RSA key fingerprint displayed in the prompted message corresponds to one of the RSA fingerprints for the legacy cluster public hosts.

If the RSA key fingerprint does not match, do not continue authentication and instead, contact support.

On Windows, a few more firewalls will pop up and you will have to allow access to the X2Go Client and associated programs.

You should now be connected to a remote desktop on the Hoffman2 Cluster.


Problems with the instructions on this section? Please send comments here.

Connecting via Jupyter Notebook/Lab

Note

This section is for the legacy cluster and uses the Grid Engine version of h2jupynb. For Jupyter sessions on the production (Slurm) cluster, see Jupyter Notebook/Lab with h2jupynb.

It is possible to connect to the Hoffman2 Cluster via the web application Jupyter Notebook, or Jupyter Lab. A Jupyter Notebook/Lab is a multi-language environment for interactive computing, especially well suited for agile prototyping and sharing of code.

Tip

While you can connect to the Hoffman2 Cluster with X11-Forwarding and run a Jupyter Notebook on a remote web-browser instance running on the Hoffman2 Cluster, running Jupyter Notebook or Jupyter Lab on your local browser is a preferred strategy that can eliminate substantial latency.

The following are directions on how to run a Jupyter Notebook, or Jupyter Lab, on the Hoffman2 Cluster while displaying it on a browser local to your computer.

Required software on your local computer

On your local computer you will need to have:

Connecting from Linux or macOS

A terminal application and an SSH client are installed as part of the operating system in Linux or macOS <https://www.apple.com/macos>. An installation of python is also generally available with the operating system or it can be readily installed from Python.org.

Connecting from Windows

On Windows, current Windows 10 and Windows 11 systems include an OpenSSH client that can be used from Windows Terminal, PowerShell, or Command Prompt. Other terminal options include Git Bash, MobaXterm, and Windows Subsystem for Linux (WSL).

Depending on the type of terminal you will need to install python on your local computer in different ways, here are a few examples:

If installing python from Python.org make sure to check the box: Add Python to PATH (e.g.: Add Python 3.10 to PATH).

Downloading the h2jupynb script

The script h2jupynb can be downloaded by issuing the following command on a terminal open on your local computer (not connected to the Hoffman2 Cluster):

$ wget https://raw.githubusercontent.com/rdauria/jupyter-notebook/main/h2jupynb

or, if wget is not available on your system:

$ curl -O https://raw.githubusercontent.com/rdauria/jupyter-notebook/main/h2jupynb

you can then make the python script executable issuing the command:

$ chmod u+x h2jupynb

the script can then be generally executed, for example to see its help menu, with:

$ h2jupynb --help

or:

$ python h2jupynb --help

Starting a Jupyter Notebook session

Warning

The script h2jupynb should be run from a terminal open on your client machine and not on a terminal already connected to the Hoffman2 Cluster.

To start a jupyter notebook that will use one computational core, one GB of memory and run for two hours (see: Requesting resources for your Jupyter Notebook session to learn how to request specific resources for your Jupyter notebook session), issue:

$ ./h2jupynb -u user_id

or with:

$ python h2jupynb -u user_id

or with:

$ python3 h2jupynb -u user_id

where user_id is your Hoffman2 Cluster user name.

Note

Unless you have set up passwordless authentication, you will be prompted to enter your Hoffman2 Cluster password twice.

At the end of a successful negotiation (which generally ends after you enter your password a second time), depending on the terminal that you are running, you should see a message similar to:

Warning: No xauth data; using fake authentication data for X11 forwarding.
Pseudo-terminal will not be allocated because stdin is not a terminal.

or:

Warning: No xauth data; using fake authentication data for X11 forwarding.
Pseudo-terminal will not be allocated because stdin is not a terminal.
TUNNEL
Successfully opened notebook!
Kill this process to end your notebook connection.

Note

If you are connecting from Git Bash to see the full output of the h2jupynb script as it negotiates the opening of a Jupyter session, use:

$ python -u h2jupynb -u user_id

or:

$ python3 -u h2jupynb -u user_id

Starting a Jupyter LAB session

Please download the latest version of the h2jupynb script and start a Jupyter Notebook session as described in Starting a Jupyter Notebook session.

When you get to the jupyter session on your browser, go to the address bar and modify it so that instead of localhost:PORT/tree it will have localhost:PORT/lab. For example, should your address will look like:

http://localhost:9394/tree

replace tree with lab as in:

http://localhost:9394/lab

A jupyter lab session should start.

Securing your Jupyter Sessions

From the New menu of your Jupyter Session select Terminal, at the terminal prompt issue:

$ jupyter notebook password

we recommend that you select a password different than your Hoffman2 Cluster account password. Your selected hashed password will be stored in:

$HOME/.jupyter/jupyter_notebook_config.json

should you forget the password, remove the $HOME/.jupyter/jupyter_notebook_config.json file and re-run the command jupyter notebook password to set your Jupyter password anew.

Requesting resources for your Jupyter Notebook session

By default the remote Jupyter Notebook starts in an interactive session with the following computing resources: 1GB of memory, one core, and a run-time of up to 2 hours. To learn how to change the default options, run:

$ ./h2jupynb --help

User joebruin could request a Jupyter Notebook session that will run for 5 hours on a node with an Intel Gold processor and use up to 10 GB of memory (and 1 core) with:

$ ./h2jupynb -u joebruin -t 5 -m 10 -a "intel-gold\*"

Running python kernels in Jupyter

On the Hoffman2 Cluster several versions of python are supported. Depending on the version chosen when starting the jupyter notebook (for example via the -v <VERSION> switch to the h2jupynb script) a corresponding version of python will be available via the ipython kernel.

To see which versions of python on the Hoffman2 Cluster are supported issue:

$ ./h2jupynb --help

among other information the command currently returns:

python versions currently available are: 2.7.18, 3.7.3, 3.9.6, mamba

Accordingly, in order to select, for example, python version 3.9.6, user joebruin would issue:

$ ./h2jupynb -u joebruin -v 3.9.6

Installing python libraries via Pip in a python notebook

To install numpy, for example, in a python jupyter notebook type in a notebook cell:

In [1]: import sys
   ...: !{sys.executable} -m pip install numpy --user

Note

If you are running a in a python virtual environment kernel you will not need to add the --user flag.

Running mamba python kernels in Jupyter

It is possible to run Jupyter Notebook/Lab under one of the Mamba python installation centrally installed on the cluster. The h2jupynb script supports several versions of mamba. To see which versions are supported use:

$ ./h2jupynb --help

To run a Jupyter session using, for example, the default mamba version on the Hoffman2 Cluster, user joebuin would use:

$ ./h2jupynb -u joebruin -v mamba

Running python/mamba virtual environment kernels in Jupyter

You may need to run a Jupyter notebook on a python or mamba virtual environment (note: conda and mamba environments and commands are largely interchangeable). To do so you will need to install the ipykernel in the python/conda environment. Here we show how you can do so in an previously created mamba virtual environment called MYCONDAENV:

$ qrsh -l h_data=6G,h_rt=1:00:00
$ module load mamba
$ conda activate MYCONDAENV  # activate previously created environment
$ conda install ipykernel
$ python -m ipykernel install --user --name=MYCONDAENV --display-name "MYCONDAENV"

After starting a Jupyter notebook you should see MYCONDAENV in the list of possible kernels.

In the example below user joebruin creates a mypytorch2 mamba environment, activates it and installs ipykernel so that the environment can be loaded as a jupyter notebook:

$ qrsh -l A100,gpu,h_rt=1:00:00,cuda=1
$ module load cuda/11.8
$ module load mamba
$ mamba create -n mypytorch2 pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
$ mamba activate mypytorch2
$ mamba install ipykernel
$ python -m ipykernel install --user --name=mypytorch2 --display-name "pyt2-cuda11.8"

user joebruin can then connect to the Hoffman2 Cluster via a jupyter session issuing from his local computer:

$ h2jupynb -v mamba -g yes -c A100 -l 11.8 -j mypytorch2 -u joebruin

when the session starts on a local web browser, user joebruin should be able to see pyt2-cuda11.8 as a possible kernel as shown in the figure below:

Jupyter Notebook interface with New launcher menu showing

Jupyter Notebook interface with the launcher menu showing available kernels.

Upon selecting pyt2-cuda11.8 as a kernel to launch a new notebook, it is easy to verify that we are indeed in a mamba environment, as shown in the figure below:

Jupyter Notebook running a python notebook within mypytorch2 mamba environment

Jupyter Notebook running a python notebook within mypytorch2 mamba environment.

Installing python libraries via mamba in an mamba python notebook

Warning

This is only possible when running within a a mamba virtual environment

To install, for example, numpy, in an mamba python jupyter notebook type:

In [1]: import sys
   ...: !mamba install --yes --prefix {sys.prefix} numpy

Running R kernels in Jupyter

Several R kernels, IRkernel,are available from the jupyter interface. For example, in the figure below a Jupyter Notebook interface is shown with the New launcher menu displaying several versions of R.

Jupyter Notebook interface with New launcher menu showing

Jupyter Notebook interface with the launcher menu showing, among others, several versions of R kernels.

Should you need to install your own R kernel, after starting the desired version of R on the Hoffman2 Cluster, at the R command prompt issue:

> install.packages('IRkernel')
> library(IRkernel)

for example, user joebruin part of gobruin Unix group, who needs to install the IRkernel for R version 4.1.0 in order to load some R libraries that are installed in the user $HOME/apps/myRlibs would issue at the R prompt:

> IRkernel::installspec(name = 'ir410', displayname = 'My R 4.1.0')
[InstallKernelSpec] Installed kernelspec ir410 in /u/home/gobruin/joebruin/.local/share/jupyter/kernels/ir410
>

There are a few steps that user joebruin will need to perform before the kernel will be accessible from the jupyter interface, the steps are reproduced below for user joebruin (whose $HOME directory is /u/home/j/joebruin), who has installed R libraries in $HOME/apps/myRlibs for R version 4.1.0, you will need to modify the command according to your username, $HOME directory and version of R:

  1. Alter the definition of the kernel.json, to do so on a terminal open on the Hoffman2 Cluster, issue:

    $ cp -p $HOME/.local/share/jupyter/kernels/ir41/kernel.json $HOME/.local/share/jupyter/kernels/ir41/kernel.json_ORIG
    

    now edit the file $HOME/.local/share/jupyter/kernels/ir41/kernel.json and change its current content to:

    {
       "argv": ["/u/home/j/joebruin/.local/share/jupyter/kernels/ir410/R410-kernel.sh", "{connection_file}"],
       "display_name": "My R 4.1.0",
       "language": "R"
    }
    
  2. Create the script $HOME/.local/share/jupyter/kernels/ir410/R410-kernel.sh which contents will be (please update the contents in order to reflect the version of R and, if needed, the R_LIBS environmental variable (notice, if you used the default location, set up by R, to install R libraries you would not need to install your IRkernel - this example is for the sake of argument as there can be legitimate case-use that could benefit from it):

#!/usr/bin/env bash
. /u/local/Modules/default/init/modules.sh
module load R/4.1.0 > /dev/null 2>&1
export R_LIBS=/u/home/j/joebruin/apps/myRlibs

exec R --slave -e IRkernel::main\(\) --args $@
  1. Make the $HOME/.local/share/jupyter/kernels/ir410/R410-kernel.sh script executable by issuing the command:

$ chmod u+x $HOME/.local/share/jupyter/kernels/ir410/R410-kernel.sh

You should be able to see the newly installed kernel when opening next a jupyter session on the Hoffman2 Cluster.

Installing R packages within an R notebook

To run your R notebook you might need a package (or a version of a package) that is not available yet. You can install a package directly from your R notebook using the usual R syntax, that is:

In [1]: if (!file.exists(Sys.getenv("R_LIBS_USER"))) {dir.create(Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)}
   ...: install.packages("PACKAGE-NAME", dependencies=TRUE, lib=Sys.getenv("R_LIBS_USER"))

where: PACKAGE-NAME is the actual package name that you need to install (for example: BiocManager).

For Bioconductor use instead:

In [1]: if (!file.exists(Sys.getenv("R_LIBS_USER"))) {dir.create(Sys.getenv("R_LIBS_USER"), showWarnings = FALSE, recursive = TRUE)}
   ...: if (!require("BiocManager", quietly = TRUE))
   ...:     install.packages("BiocManager",dir=Sys.getenv("R_LIBS_USER"))
   ...: BiocManager::install(c("PACKAGE_NAME", "ANOTHER_PACKAGE_NAME"),dir=Sys.getenv("R_LIBS_USER"))

Running the Bash kernel in Jupyter

The Bash kernel is available from the jupyter interface. Use this kernel to try out snippets of Bash code as if you were at the Hoffman2 Cluster command line. The Bash kernel is very handy when you are developing a recipe that you may need to share with fellow users.

Installing and Running Julia kernels in Jupyter

The IJulia kernel <https://github.com/JuliaLang/IJulia.jl> allows the Julia language <https://julialang.org/> to be run on a Jupyter notebook. Because of the way julia packages are installed, users will need to install the IJulia kernel in their $HOME directory. Directions are give here to install IJulia under python/3.9.6 and julia/1.6.3, to install IJulia for other combinations of python and julia the commands below will need to be modified accordingly.

On terminal connected to the Hoffman2 Cluster issue:

$ qrsh
$ module load python/3.9.6
$ module load julia/1.6
$ julia

at the julia prompt issue:

julia> using Pkg
julia> Pkg.add("IJulia")

terminate julia.

On a terminal on your local machine execute the h2jupynb script requesting, for example, 3 hours runtime a total of 4GB of memory and one computing core (remember to substitute user_id with your actual Hoffman2 Cluster account name):

$ python h2jupynb -u user_id -t 3 -m 4

once the Jupyter session starts you should see Julia 1.6.3 in the list of possible kernels.

Passing environmental variable to your Julia notebook

Certain environmental variables have to be set before starting a julia notebook, for the sake of argument, we will consider JULIA_NUM_THREADS, the environmental variable that sets the maximum number of threads available to Julia.

Let’s assume that you would like to run a julia notebook with a maximum number of threads available to julia equal to 4. Here are the steps to set JULIA_NUM_THREADS=4 in the context of a notebook. After installing the IJulia kernel on the Hoffman2 Cluster make a copy of your $HOME/.local/share/jupyter/kernels/julia-1.6 to $HOME/.local/share/jupyter/kernels/julia-1.6-3THREADS

$ cp -rp $HOME/.local/share/jupyter/kernels/julia-1.6  $HOME/.local/share/jupyter/kernels/julia-1.6-4THREADS

Now edit $HOME/.local/share/jupyter/kernels/julia-1.6-4THREDAS/kernel.json and change:

"display_name": "Julia 1.6.3"

to:

"display_name": "Julia 1.6.3 - 4 THREADS"

and:

"env": {}

to:

"env": {"JULIA_NUM_THREADS":"4"}

save the file. Next time you will start jupyter notebooks on the cluster you will see a new kernel named:

Julia 1.6.3 - 4 THREADS

if you select this kernel you can then check that the correct number of threads is set by running in one of its cells:

In [1]: Threads.nthreads()

if all went well when you execute such cell you should get:

4

Installing other kernels in Jupyter

Many jupyter kernels are available from the GitHub Jupyter project repository you can either install them under your account or request that they be installed globally by opening a request ticket with our online help desk.

Passing variable to a kernel

Please see Passing environmental variable to your Julia notebook to learn how environmental variables can be set before the start of a specific kernel. In particular, the kernel.json provides the env key which function as a dictionary of environment variables to set for the kernel (for more details see: the Jupyter Client kernel specs).


Problems with the instructions on this section? Please send comments here.