Welcome to Jet¶
You have done it! Your Notebook Server is running on the Jet Cluster.
Welcome, please skip this, if your know where you are, as this is meant as an introduction. However, not complete as it is. If you need more infos about Notebooks have a look at my Homepage and there are numerous Tutorials on the Internet for any advice, but feel free to ask me and give me feedback.
Help can be found here:
- Goto Help -> JupyterLab Reference
- Goto Help -> Jupyter Reference
- Tour
In the following I will show you some useful things.
First: This Notebook is in your Home directory, but also on /jetfs/scratch
for any reason.
Check your current Host¶
!hostnamectl
Static hostname: localhost.localdomain Transient hostname: jet03.jet.local Icon name: computer-server Chassis: server Operating System: ]8;;https://www.centos.org/CentOS Linux 8 (Core)]8;; CPE OS Name: cpe:/o:centos:centos:8 Kernel: Linux 4.18.0-147.el8.x86_64 Architecture: x86-64
Who is running this process¶
!whoami
yourusername
# Where are you
!pwd
/jetfs/home/yourusername/Documents
# Show my Current Jobs in the Queue
!squeue -u $(id -u) -l
Fri Oct 16 23:10:58 2020 JOBID PARTITION NAME USER STATE TIME TIME_LIMI NODES NODELIST(REASON) 235 compute jupyters mblasche RUNNING 6:29:07 8:00:00 1 jet03
There you can see your TIME_LIMIT
of 8 hours again and how much time has passed on your current jobs
%env PATH
'/jetfs/manual/micromamba/2.2.0/bin:/jetfs/spack/bin:/jetfs/home/yourusername/micromamba/condabin:/jetfs/home/yourusername/bin:/jetfs/home/yourusername/.local/bin:/jetfs/userservices:/jetfs/spack/bin:/usr/share/Modules/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/jetfs/jupyterhub/jhub/bin'
Check what modules are currently loaded in this Notebook session¶
!module list --no-pager
Currently Loaded Modulefiles: 1) micromamba/2.2.0
Put this file load_modules_into_jupyter.conf
into your Home directory and your Notebook environment will have these modules loaded.
It is not possible to load these modules via magic (python magic ;).
It needs the empty line at the end...
%%writefile ~/load_modules_into_jupyter.conf
eccodes/2.25.0-gcc-12.2.0-y2gnn47
Overwriting /jetfs/home/yourusername/load_modules_into_jupyter.conf
Restarting the kernel will show now loaded modules
# after restarting
!module list --no-pager
Currently Loaded Modulefiles: 1) micromamba/2.2.0 4) netcdf-c/4.9.2-gcc-12.2.0-wicjkfm 2) mpich/4.1.2-gcc-12.2.0-mzdfzqb 5) eccodes/2.25.0-gcc-12.2.0-y2gnn47 3) hdf5/1.10.10-gcc-12.2.0-cnot2wb
Currently available Modules¶
# --no-pager is needed only inside notebook
!module avail --no-pager
--------- /jetfs/spack/share/spack/modules/linux-rocky8-skylake_avx512 --------- anaconda3/2022.05-gcc-8.5rocky8-4bmyals anaconda3/2023.03-1-gcc-8.5rocky8-sqi7jtx arm-forge/22.1.1-gcc-8.5rocky8-bspohkw autoconf/2.69-gcc-8.5rocky8-syodhbh cdo/2.2.2-gcc-12.2.0-msrest5 cdo/2.4.4-gcc-12.2.0-scx5tas cmake/3.24.3-gcc-8.5rocky8-xbvhp7b cmake/3.24.3-intel-2021.7.1-mqya6yj eccodes/2.25.0-gcc-12.2.0-vp5krmy eccodes/2.25.0-gcc-12.2.0-y2gnn47 eccodes/2.25.0-intel-2021.7.1-nmixz3j eccodes/2.35.0-gcc-12.2.0-llkav24 eccodes/2.38.0-gcc-12.2.0-akxktxn eccodes/2.40.0-gcc-12.2.0-bkcs4rk extrae/4.0.6-gcc-12.2.0-p2ftbwa fftw/3.3.10-gcc-12.2.0-fxobhly fftw/3.3.10-gcc-12.2.0-jfdku2j gcc/12.2.0-n4mqta4 gcc/13.2.0-q3jhn5x geos/3.9.1-intel-2021.7.1-taqq53o geos/3.12.0-gcc-12.2.0-fa7igw7 hdf5/1.10.10-gcc-12.2.0-cnot2wb hdf5/1.12.2-intel-2021.7.1-eezva36 intel-oneapi-compilers-classic/2021.7.0-gcc-8.5rocky8-fdw37cv intel-oneapi-compilers/2022.2.1-exnxgdl intel-oneapi-mkl/2022.2.1-intel-2021.7.1-vccyt4d intel-oneapi-mkl/2023.2.0-gcc-12.2.0-hgi4mnb intel-oneapi-mpi/2021.7.1-intel-2021.7.1-lsywigf miniconda3/22.11.1-gcc-8.5rocky8-litfvls mpich/4.1.2-gcc-12.2.0-mzdfzqb nco/5.1.0-intel-2021.7.1-sftop5w nco/5.1.6-gcc-12.2.0-k2osggy ncview/2.1.8-intel-2021.7.1-thdjwvq ncview/2.1.9-gcc-12.2.0-dyvf7db netcdf-c/4.7.4-intel-2021.7.1-j4fp2gi netcdf-c/4.9.2-gcc-12.2.0-wicjkfm netcdf-fortran/4.5.3-intel-2021.7.1-sbwn2nk netcdf-fortran/4.6.1-gcc-12.2.0-eicuxhe netlib-lapack/3.9.1-gcc-8.5rocky8-cm6nni5 netlib-lapack/3.9.1-index64-gcc-8.5rocky8-7isczxn netlib-lapack/3.11.0-gcc-12.2.0-mlo7s42 netlib-scalapack/2.2.0-gcc-12.2.0-kblcxkf openblas/0.3.24-gcc-12.2.0-y7gmad2 opencoarrays/2.10.1-gcc-12.2.0-bbwmgah opencoarrays/2.10.1-gcc-12.2.0-o7auzjk openmpi/4.1.1-gcc-8.5rocky8-kdi5pov openmpi/4.1.6-gcc-12.2.0-nbabgma proj/8.2.1-intel-2021.7.1-bgcfd33 proj/9.2.1-gcc-12.2.0-bx4rp63 r/4.3.0-gcc-12.2.0-mhbmxih rdma-core/46.0-gcc-12.2.0-mkh4thn valgrind/3.19.0-gcc-8.5rocky8-6nzwgjy --------- /jetfs/spack/share/spack/modules/linux-rhel8-skylake_avx512 ---------- anaconda3/2020.11-gcc-8.5.0-gf52svn anaconda3/2021.05-gcc-8.5.0-gefwhbz autoconf/2.69-gcc-8.5.0-lejmm2i autoconf/2.69-gcc-8.5rhel8-civunpc cdo/2.0.1-gcc-8.5.0-dyzjir7 cdo/2.1.1-intel-2021.7.1-wtifahn cmake/3.21.4-gcc-8.5.0-bsilzh3 cmake/3.21.4-gcc-8.5rhel8-tlexfai cmake/3.24.3-intel-2021.7.1-3e63fby eccodes/2.21.0-gcc-8.5.0-zjundl7 eccodes/2.25.0-intel-2021.7.1-zqawf62 gcc/8.5.0-7ka2e42 geos/3.8.1-gcc-8.5.0-bymxoyq geos/3.9.1-gcc-8.5.0-smhcud5 geos/3.9.1-intel-2021.7.1-zrinbiw hdf5/1.10.7-gcc-8.5.0-lt2uriw hdf5/1.12.2-intel-2021.7.1-w5sw2dq intel-oneapi-compilers/2022.2.1-zkofgc5 intel-oneapi-mkl/2022.2.1-intel-2021.7.1-uu65kbx intel-oneapi-mpi/2021.7.1-intel-2021.7.1-pt3unoz intel-oneapi-vtune/2022.4.1-intel-2021.7.1-thzvq7z libemos/4.5.9-gcc-8.5.0-igrwju3 miniconda2/4.7.12.1-gcc-8.5.0-hkx7ovs miniconda3/4.10.3-gcc-8.5.0-eyq4jvx nco/5.0.1-gcc-8.5.0-pz242kb nco/5.1.0-intel-2021.7.1-izrhxv2 ncview/2.1.8-gcc-8.5.0-drrsgw2 ncview/2.1.8-intel-2021.7.1-croyrc7 netcdf-c/4.7.4-gcc-8.5.0-jchgjiu netcdf-c/4.7.4-intel-2021.7.1-lnfs5zz netcdf-cxx/4.2-gcc-8.5.0-l4wm5jr netcdf-cxx4/4.3.1-gcc-8.5.0-vb2y67x netcdf-fortran/4.5.3-gcc-8.5.0-qsqbozc netcdf-fortran/4.5.3-intel-2021.7.1-27ldrnt netlib-lapack/3.9.1-gcc-8.5.0-ipqdnxj netlib-scalapack/2.1.0-gcc-8.5.0-azz4ujr openblas/0.3.18-gcc-8.5.0-zv6qss4 openmpi/4.0.5-gcc-8.5.0-ajmjw6n openmpi/4.1.1-gcc-8.5.0-qlcihhp openmpi/4.1.2-gcc-8.5.0-ioxcpyc parallel-netcdf/1.12.2-gcc-8.5.0-4ucyla7 proj/7.1.0-gcc-8.5.0-k3kp5sb proj/8.1.0-gcc-8.5.0-4ydzmxc proj/8.2.1-intel-2021.7.1-kxxw7ym ucx/1.11.2-gcc-8.5.0-nqn7ryc ------------- /jetfs/spack/share/spack/modules/linux-rhel8-haswell ------------- intel-parallel-studio/composer.2017.7-disfj2g ---------------------------- /jetfs/manual/modules ----------------------------- azure-cli/2.56.0 intel-stack/2021.7.1 rttov/v12.3-gcc-8.5.0 dwd-opendata/0.2.0 mayavi/4.8.1 rttov/v13.2-gcc-8.5.0 ecaccess-webtoolkit/6.3.1 micro/2.0.14 teleport/10.1.4 enstools/v2020.11 micromamba/0.27.0 teleport/10.3.3 enstools/v2021.11 micromamba/2.2.0 teleport/13.4.15 gcc-stack/12.2.0 mojo/0.5.0 teleport/17.4.2 go/1.22.4 ncl/6.6.2
Software on JET¶
Currently:
- micromamba
- OPENMPI (4.0.5, 3.6.1) optimized for JET
- HDF5 (1.12) optimized with OPENMPI
- NetCDF (Parallel (NC3), NC4->HDF5)
- ECCodes
- CDO
- Intel compiled Libraries
- Ecaccess
- RTTOV
Currently there are a few choices:¶
- Python (2, 3)
- micromamba environments
- Julia (not yet)
- R
Install Python packages¶
# Please use the --user flag to install the packages into .local/lib/python...
%pip install --user numpy scipy
Requirement already satisfied: numpy in /jetfs/home/yourusername/.local/lib/python3.8/site-packages (1.19.2) Requirement already satisfied: scipy in /jetfs/home/yourusername/.local/lib/python3.8/site-packages (1.5.2) Note: you may need to restart the kernel to use updated packages.
import os
import sys
import site
# Need to update search Path / only necessary here for the first time
# sys.path.append(os.path.expandvars("$HOME/.local/lib/python3.8/site-packages"))
sys.path.append(site.getusersitepackages())
import numpy as np
import scipy as sp
# WORKS! ;)
Using micromamba¶
!micromamba info
libmamba version : 2.2.0 micromamba version : 2.2.0 curl version : libcurl/8.14.1 OpenSSL/3.5.0 zlib/1.3.1 zstd/1.5.7 libssh2/1.11.1 nghttp2/1.64.0 libarchive version : libarchive 3.7.7 zlib/1.3.1 bz2lib/1.0.8 libzstd/1.5.7 envs directories : /jetfs/home/yourusername/micromamba/envs package cache : /jetfs/home/yourusername/micromamba/pkgs /jetfs/home/yourusername/.mamba/pkgs environment : base env location : /jetfs/home/yourusername/micromamba user config files : /jetfs/home/yourusername/.mambarc populated config files : /jetfs/home/yourusername/.condarc virtual packages : __unix=0=0 __linux=4.18.0=0 __glibc=2.28=0 __archspec=1=x86_64_v4 channels : https://conda.anaconda.org/conda-forge/linux-64 https://conda.anaconda.org/conda-forge/noarch base environment : /jetfs/home/yourusername/micromamba platform : linux-64
# Create a environment with conda
# use -q quiet
# -y yes to all questions
# -c [] use conda-forge FLOSS channel
# -n [] name of the environment
# add packages, e.g.: python at version 3.12 numpy an ipykernel (required for jupyter integration)
!micromamba create -q -y -c conda-forge -n myenv python=3.12 numpy ipykernel
# show available environment
!micromamba env list
Name Active Path ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── base * /jetfs/home/yourusername/micromamba modern /jetfs/home/yourusername/micromamba/envs/modern myenv /jetfs/home/yourusername/micromamba/envs/myenv
Add the new environment to your active kernels¶
This way you can choose the kernel from the Jupyterlab launcher.
!~/micromamba/envs/myenv/bin/python -m ipykernel install --user --name MYENV --display-name "Py3.12"
Installed kernelspec MYENV in /jetfs/home/yourusername/.local/share/jupyter/kernels/myenv
Activate your environment¶
Micromamba environments need to be added to the PATH
to work well. So there is an activate
function for these environments.
You just need to run this once
# initialize bash shell
$ micromamba shell init -s bash
Running `shell init`, which:
- modifies RC file: "/jetfs/home/yourusername/.bashrc"
- generates config for root prefix: "/jetfs/home/yourusername/micromamba"
- sets mamba executable to: "/jetfs/manual/micromamba/2.2.0/bin/micromamba"
The following has been added in your "/jetfs/home/yourusername/.bashrc" file
# >>> mamba initialize >>>
# !! Contents within this block are managed by 'micromamba shell init' !!
export MAMBA_EXE='/jetfs/manual/micromamba/2.2.0/bin/micromamba';
export MAMBA_ROOT_PREFIX='/jetfs/home/yourusername/micromamba';
__mamba_setup="$("$MAMBA_EXE" shell hook --shell bash --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__mamba_setup"
else
alias micromamba="$MAMBA_EXE" # Fallback on help from micromamba activate
fi
unset __mamba_setup
# <<< mamba initialize <<<
will edit your .bashrc
. After some time you might have to do this again, when the micromamba version changed a lot (e.g.: micromamba shell reinit -s bash
)
# List available Kernels
!jupyter kernelspec list
Available kernels: myenv /jetfs/home/yourusername/.local/share/jupyter/kernels/myenv rttovv13.2 /jetfs/home/yourusername/.local/share/jupyter/kernels/rttovv13.2 enstoolsv2021.11 /jetfs/jupyterhub/alpha/share/jupyter/kernels/enstoolsv2021.11 ir /jetfs/jupyterhub/alpha/share/jupyter/kernels/ir modelling /jetfs/jupyterhub/alpha/share/jupyter/kernels/modelling python3 /jetfs/jupyterhub/alpha/share/jupyter/kernels/python3
Custom Environment Python Environment¶
# Setup a virtual Environment for your Python in the directoy: myfancyenv
!python -m venv myfancyenv
# Install some package into that environment
# important is ipykernel to use it within jupyterlab/notebook
!./myfancyenv/bin/pip -q install numpy scipy pandas ipykernel
WARNING: You are using pip version 19.2.3, however version 20.2.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
# Allow this environment to be available on the LAUNCHERS (+) sign on the left
!./myfancyenv/bin/python -m ipykernel install --user --name fancy --display-name "My Python"
Installed kernelspec fancy in /jetfs/home/yourusername/.local/share/jupyter/kernels/fancy
Wait a bit and the new python environment should be available on your launchers.
!jupyter kernelspec list
Available kernels: fancy /jetfs/home/yourusername/.local/share/jupyter/kernels/fancy myenv /jetfs/home/yourusername/.local/share/jupyter/kernels/myenv
There you go. Your personal Environment.