<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bwhpc.de/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=S+Fischer</id>
	<title>bwHPC Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bwhpc.de/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=S+Fischer"/>
	<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/e/Special:Contributions/S_Fischer"/>
	<updated>2026-10-06T02:22:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=When_to_use_an_HPC_Cluster&amp;diff=16422</id>
		<title>When to use an HPC Cluster</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=When_to_use_an_HPC_Cluster&amp;diff=16422"/>
		<updated>2026-09-16T08:16:38Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: feedback from bwCloud colleagues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I have calculations to do - should I try using one of the bwHPC clusters for my tasks?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== When to use HPC computers ==&lt;br /&gt;
&lt;br /&gt;
You can benefit from an HPC-Cluster if:&lt;br /&gt;
&lt;br /&gt;
#  You can run many separate calculations in parallel&lt;br /&gt;
#  Software can efficiently divide your problem into many smaller problems that run in parallel&lt;br /&gt;
#  You need more RAM (memory) than your computer can provide&lt;br /&gt;
#  You need more GPUs and have no other source&lt;br /&gt;
#  You need to process large amounts of data that do not fit on your computer&lt;br /&gt;
&lt;br /&gt;
== When &#039;&#039;&#039;not&#039;&#039;&#039; to use HPC computers ==&lt;br /&gt;
&lt;br /&gt;
You will probably not have a big benefit from using HPC when:&lt;br /&gt;
&lt;br /&gt;
* Your calculation runs in serial (only on one compute core is used, things cannot run in parallel) and you have few calculations&lt;br /&gt;
* Your workflow requires that you run one calculation, then retrieve data to analyze it locally, then run the next calculation&lt;br /&gt;
* You have different computational needs than raw computing power. &lt;br /&gt;
&lt;br /&gt;
Except 3) or 4) of &amp;quot;when to use a cluster&amp;quot; force you to use the clusters anyway.&lt;br /&gt;
&lt;br /&gt;
If you need other computational tasks of the likes of &lt;br /&gt;
&lt;br /&gt;
* hosting a web server&lt;br /&gt;
* hosting a database&lt;br /&gt;
* having a test bed for software development&lt;br /&gt;
* having systems for university courses on linux, programming languages, etc&lt;br /&gt;
* having an environment for student projects or theses,&lt;br /&gt;
&lt;br /&gt;
then the bwCloud-OS offering virtual machines might be the right thing for you&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&amp;amp;rarr; https://bwcloud-os.de/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Misconceptions == &lt;br /&gt;
=== &amp;quot;Everything will be faster&amp;quot; ===&lt;br /&gt;
[[File:BwUniCluster_2.0_Feb2020_1024x423.jpg|right|thumb|alt=bwUniCluster2.0 |upright=1| many compute cores: Every &amp;quot;tray&amp;quot; in these racks contains 1-4 computers, every computer typically has 50-200 compute cores. ]]&lt;br /&gt;
&lt;br /&gt;
The performance of a single compute core is not higher than that of your typical desktop computer. The main things we can offer are:&lt;br /&gt;
&lt;br /&gt;
* Many compute cores &lt;br /&gt;
* Much RAM (memory) &lt;br /&gt;
* GPUs&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;It&#039;s just a computer, I know how to use a computer&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
While the clusters are indeed &amp;quot;just&amp;quot; many Linux computers, they are also multi-million Euro instruments. So while they may have many similarities with a Linux desktop, in some respects, it is better to think of them like of other expensive instruments you may use in your research. HPC clusters have hardware components you may have never heard of in the consumer market, they typically have more than one CPU socket (making among other things memory management more complicated), etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;I want to host servers on bwHPC&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
On the bwHPC clusters, you submit jobs to a supercomputer that get scheduled and processed over time. It is not the place for permanent server hosting. If you need self-service virtual machines, check out [https://bwcloud-os.de/en/ bwCloud-OS], which offers an OpenStack-based [https://en.wikipedia.org/wiki/Infrastructure_as_a_service IaaS] platform for research, teaching, and administration in Baden-Württemberg.&lt;br /&gt;
&lt;br /&gt;
== What are the Costs? ==&lt;br /&gt;
&lt;br /&gt;
=== Monetary ===&lt;br /&gt;
&lt;br /&gt;
No cost to you as the end-user&lt;br /&gt;
&lt;br /&gt;
(But of course the HPC systems are bought for millions of Euro and the power cost of running calculations is in the same order of magnitude as buying the systems)  &lt;br /&gt;
&lt;br /&gt;
=== Effort / Time ===&lt;br /&gt;
&lt;br /&gt;
There is quite a learning curve to start calculating. &lt;br /&gt;
&lt;br /&gt;
* Linux shell knowledge is a major part&lt;br /&gt;
* HPC-specific knowledge:&lt;br /&gt;
** Software module system - software supplied by the cluster maintainers (vide infra)&lt;br /&gt;
** How to use the scheduler / write job scripts: how to send calculations to a computer on the cluster (vide infra)&lt;br /&gt;
* Wait times: a good cluster is always busy. Expect a waiting time betwween 1h and 2 days until your calculation(s) start&lt;br /&gt;
&lt;br /&gt;
=== Compute Workflow ===&lt;br /&gt;
&lt;br /&gt;
A short description of the workflow how running calculation works can be found under [[Running Calculations]] and can give you a general idea.&lt;br /&gt;
&lt;br /&gt;
=== Software === &lt;br /&gt;
&lt;br /&gt;
Basic usage is very simple: you run &amp;lt;code&amp;gt; module load module_name &amp;lt;/code&amp;gt; and use the software, but important documentation and examples are also built into the modules. &lt;br /&gt;
&lt;br /&gt;
The usage of the software on the cluster is described in [[Environment Modules]]&lt;br /&gt;
&lt;br /&gt;
== Still With Us? ==&lt;br /&gt;
&lt;br /&gt;
If you feel your calculations meet the requirements and you will save a lot of time despite some learning overhead, proceed to the [[Registration]] page.&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=Helix/Software/Matlab&amp;diff=16418</id>
		<title>Helix/Software/Matlab</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=Helix/Software/Matlab&amp;diff=16418"/>
		<updated>2026-09-11T10:29:16Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: /* MATLAB Compiler/Runtime */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;border: 2px solid #d33; background-color: #fee7e6; padding: 10px; margin-bottom: 1em; width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;⚠ MATLAB modules have been removed on March 31, 2026.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The MathWorks state license (Landeslizenz) has expired on March 31, 2026 and will not be renewed. The MATLAB modules &amp;lt;code&amp;gt;math/matlab&amp;lt;/code&amp;gt; are no longer be available on Helix.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alternatives:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;GNU Octave&#039;&#039;&#039; (&amp;lt;code&amp;gt;module load math/octave&amp;lt;/code&amp;gt;): MATLAB scripts that do not use special features of toolboxes may run with Octave without or with minor changes.&lt;br /&gt;
* &#039;&#039;&#039;Matlab Compiler / Matlab Runtime&#039;&#039;&#039;: Use the [https://de.mathworks.com/products/compiler.html MATLAB Compiler] to build stand-alone binaries on your local computer (with your own license) and run them with the MATLAB Runtime on the cluster — no license required at runtime (see section &amp;quot;Compile MATLAB binaries with mcc&amp;quot; below).&lt;br /&gt;
* &#039;&#039;&#039;Institute license&#039;&#039;&#039;: If your institute has its own MathWorks network license, it may be possible to use it from the cluster. This must be checked on a case-by-case basis — please [https://www.bwhpc.de/supportportal.php submit a ticket].&lt;br /&gt;
* Other alternatives: &amp;lt;code&amp;gt;math/julia&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;math/R&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;devel/python&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Softwarepage|math/matlab}}&lt;br /&gt;
&lt;br /&gt;
{| width=600px class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Content&lt;br /&gt;
|-&lt;br /&gt;
| module load&lt;br /&gt;
| math/matlab&lt;br /&gt;
|-&lt;br /&gt;
| License&lt;br /&gt;
| [https://de.mathworks.com/pricing-licensing/index.html?intendeduse=edu&amp;amp;prodcode=ML Academic License/Commercial]&lt;br /&gt;
|-&lt;br /&gt;
| Citing&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
| Links&lt;br /&gt;
| [https://de.mathworks.com/products/matlab/ MATLAB Homepage] &amp;amp;#124; [https://de.mathworks.com/index.html?s_tid=gn_logo MathWorks Homepage] &amp;amp;#124; [https://de.mathworks.com/support/?s_tid=gn_supp Support and more]&lt;br /&gt;
|-&lt;br /&gt;
| Graphical Interface&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MATLAB&#039;&#039;&#039; (MATrix LABoratory) is a high-level programming language and interactive computing environment for numerical calculation and data visualization.&lt;br /&gt;
&lt;br /&gt;
= Loading MATLAB =&lt;br /&gt;
&lt;br /&gt;
The preferable way is to run the MATLAB command line interface without GUI:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab -nodisplay&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interactive MATLAB session with graphical user interface (GUI) can be started with the command (requires X11 forwarding enabled for your ssh login):&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Do not start a long-duration interactive MATLAB session on a login node of the cluster. Submit an [[Helix/Slurm#Interactive_Jobs | interactive job]] and start MATLAB from within the dedicated compute node assigned to you by the queueing system.&lt;br /&gt;
&lt;br /&gt;
The following generic command will execute a MATLAB script or function named &amp;quot;example&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab -nodisplay -batch example &amp;gt; result.out 2&amp;gt;&amp;amp;1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of this session will be redirected to the file result.out. The option &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;-batch&amp;lt;/syntaxhighlight&amp;gt; executes the MATLAB statement non-interactively.&lt;br /&gt;
&lt;br /&gt;
= Parallel Computing Using MATLAB =&lt;br /&gt;
&lt;br /&gt;
Parallelization of MATLAB jobs is realized via the built-in multi-threading provided by MATLAB&#039;s BLAS and FFT implementation and the parallel computing functionality of MATLAB&#039;s Parallel Computing Toolbox (PCT).&lt;br /&gt;
&lt;br /&gt;
== Implicit Threading ==&lt;br /&gt;
&lt;br /&gt;
A large number of built-in MATLAB functions may utilize multiple cores automatically without any code modifications required. This is referred to as implicit multi-threading and must be strictly distinguished from explicit parallelism provided by the Parallel Computing Toolbox (PCT) which requires specific commands in your code in order to create threads.&lt;br /&gt;
&lt;br /&gt;
Implicit threading particularly takes place for linear algebra operations (such as the solution to a linear system A\b or matrix products A*B) and FFT operations. Many other high-level MATLAB functions do also benefit from multi-threading capabilities of their underlying routines. If multi-threading is not desired, single-threading can be enforced by adding the command line option &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;-singleCompThread&amp;lt;/syntaxhighlight&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Whenever implicit threading takes place, MATLAB will detect the total number of cores that exist on a machine and by default makes use of all of them. This has very important implications for MATLAB jobs in HPC environments with shared-node job scheduling policy (i.e. with multiple users sharing one compute node). Due to this behaviour, a MATLAB job may take over more compute resources than assigned by the queueing system of the cluster (and thereby taking away these resources from all other users with running jobs on the same node - including your own jobs).&lt;br /&gt;
&lt;br /&gt;
Therefore, when running in multi-threaded mode, MATLAB always requires the user&#039;s intervention to not allocate all cores of the machine (unless requested so from the queueing system). The number of threads must be controlled from within the code by means of the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;maxNumCompThreads(N)&amp;lt;/syntaxhighlight&amp;gt; function or, alternatively, with the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;feature(&#039;numThreads&#039;, N)&amp;lt;/syntaxhighlight&amp;gt; function (which is undocumented).&lt;br /&gt;
&lt;br /&gt;
== Using the Parallel Computing Toolbox (PCT) ==&lt;br /&gt;
&lt;br /&gt;
By using the PCT one can make explicit use of several cores on multicore processors to parallelize MATLAB applications without MPI programming. Under MATLAB version 8.4 and earlier, this toolbox provides 12 workers (MATLAB computational engines) to execute applications locally on a single multicore node. Under MATLAB version 8.5 and later, the number of workers available is equal to the number of cores on a single node (up to a maximum of 512).&lt;br /&gt;
&lt;br /&gt;
If multiple PCT jobs are running at the same time, they all write temporary MATLAB job information to the same location. This race condition can cause one or more of the parallel MATLAB jobs fail to use the parallel functionality of the toolbox.&lt;br /&gt;
&lt;br /&gt;
To solve this issue, each MATLAB job should explicitly set a unique location where these files are created. This can be accomplished by the following snippet of code added to your MATLAB script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% create a local cluster object&lt;br /&gt;
pc = parcluster(&#039;local&#039;)&lt;br /&gt;
&lt;br /&gt;
% get the number of dedicated cores from environment&lt;br /&gt;
nprocs = str2num(getenv(&#039;SLURM_NPROCS&#039;))&lt;br /&gt;
&lt;br /&gt;
% you may explicitly set the JobStorageLocation to the tmp directory that is unique to each cluster job (and is on local, fast scratch)&lt;br /&gt;
parpool_tmpdir = [getenv(&#039;TMP&#039;),&#039;/.matlab/local_cluster_jobs/slurm_jobID_&#039;,getenv(&#039;SLURM_JOB_ID&#039;)]&lt;br /&gt;
mkdir(parpool_tmpdir)&lt;br /&gt;
pc.JobStorageLocation = parpool_tmpdir&lt;br /&gt;
&lt;br /&gt;
% start the parallel pool&lt;br /&gt;
parpool(pc, nprocs)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If a large number of MATLAB-jobs are run in parallel, they can also conflict when writing generic information to &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;~/.matlab&amp;lt;/syntaxhighlight&amp;gt;. This can be circumvented by setting &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;$MATLAB_PREFDIR&amp;lt;/syntaxhighlight&amp;gt; to different directories in your Batch-script, e.g.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export MATLAB_PREFDIR=$TMP&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using a different implementation of BLAS/LAPACK ==&lt;br /&gt;
&lt;br /&gt;
By default, Matlab uses a version of Intel MKL as its BLAS/LAPACK library. It is possible to manually change this to different libraries by setting the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;BLAS_VERSION&amp;lt;/syntaxhighlight&amp;gt; and &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;LAPACK_VERSION&amp;lt;/syntaxhighlight&amp;gt; environment variables. The following lines can be added to the batch-script to change it, in this example to BLIS and Flame, which are optimized for AMD processors: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load numlib/aocl/3.2.0&lt;br /&gt;
&lt;br /&gt;
export BLAS_VERSION=$AOCL_LIB_DIR/libblis-mt.so&lt;br /&gt;
export LAPACK_VERSION=$AOCL_LIB_DIR/libflame.so&lt;br /&gt;
&lt;br /&gt;
export BLIS_NUM_THREADS=$SLURM_NTASKS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can increase performance depending on the task, for example large matrix multiplications, but caution is advised.&lt;br /&gt;
&lt;br /&gt;
= General Performance Tips for MATLAB =&lt;br /&gt;
&lt;br /&gt;
MATLAB data structures (arrays or matrices) are dynamic in size, i.e. MATLAB will automatically resize the structure on demand. Although this seems to be convenient, MATLAB continually needs to allocate a new chunk of memory and copy over the data to the new block of memory as the array or matrix grows in a loop. This may take a significant amount of extra time during execution of the program.&lt;br /&gt;
&lt;br /&gt;
Code performance can often be drastically improved by pre-allocating memory for the final expected size of the array or matrix before actually starting the processing loop. In order to pre-allocate an array of strings, you can use MATLAB&#039;s build-in cell function. In order to pre-allocate an array or matrix of numbers, you can use MATLAB&#039;s build-in zeros function.&lt;br /&gt;
&lt;br /&gt;
The performance benefit of pre-allocation is illustrated with the following example code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% prealloc.m&lt;br /&gt;
&lt;br /&gt;
clear all;&lt;br /&gt;
&lt;br /&gt;
num=10000000;&lt;br /&gt;
&lt;br /&gt;
disp(&#039;Without pre-allocation:&#039;)&lt;br /&gt;
tic&lt;br /&gt;
for i=1:num&lt;br /&gt;
    a(i)=i;&lt;br /&gt;
end&lt;br /&gt;
toc&lt;br /&gt;
&lt;br /&gt;
disp(&#039;With pre-allocation:&#039;)&lt;br /&gt;
tic&lt;br /&gt;
b=zeros(1,num);&lt;br /&gt;
for i=1:num&lt;br /&gt;
    b(i)=i;&lt;br /&gt;
end&lt;br /&gt;
toc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a compute node, the result may look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Without pre-allocation:&lt;br /&gt;
Elapsed time is 2.879446 seconds.&lt;br /&gt;
With pre-allocation:&lt;br /&gt;
Elapsed time is 0.097557 seconds.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please recognize that the code runs almost 30 times faster with pre-allocation.&lt;br /&gt;
&lt;br /&gt;
= MATLAB Compiler/Runtime =&lt;br /&gt;
&lt;br /&gt;
If you do not have access to a full MATLAB installation on Helix, you can still run compiled MATLAB applications using the MATLAB Runtime module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; The MATLAB Runtime version must &#039;&#039;&#039;exactly&#039;&#039;&#039; match the MATLAB version used for compilation. For example, code compiled with R2023a requires &amp;lt;code&amp;gt;math/matlab-runtime/R2023a&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Three steps are necessary:&lt;br /&gt;
# Create a binary on your computer with MATLAB Compiler.&lt;br /&gt;
# Transfer the compiled binary to Helix.&lt;br /&gt;
# Load MATLAB Runtime and run compiled binary on Helix.&lt;br /&gt;
&lt;br /&gt;
While the compiler supports the full MATLAB language, not all toolboxes are fully suported. The official documentation provides more details on [https://mathworks.com/products/compiler/compiler_support.html limitations] of the compiler. In addition, the [https://mathworks.com/help/pdf_doc/compiler/compiler.pdf user&#039;s guide] contains examples and a section on troubleshooting.&lt;br /&gt;
&lt;br /&gt;
== Compile MATLAB binaries with mcc ==&lt;br /&gt;
&lt;br /&gt;
If you have a MATLAB license that includes [https://de.mathworks.com/products/compiler.html MATLAB Compiler], e.g. on your local computer, you can use &amp;lt;code&amp;gt;mcc&amp;lt;/code&amp;gt; to create binaries from MATLAB code.&lt;br /&gt;
Stand-alone MATLAB programs compiled with &amp;lt;code&amp;gt;mcc&amp;lt;/code&amp;gt; do not require any license tokens at runtime and you can start jobs in parallel without any risk of running out of licences.&lt;br /&gt;
&lt;br /&gt;
Compile your MATLAB code on a machine where you have a MATLAB license (e.g., your local workstation via an institute license):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mcc -m my_code.m&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Based on your MATLAB code (&amp;lt;code&amp;gt;my_code.m&amp;lt;/code&amp;gt;), the compiler will create a binary (&amp;lt;code&amp;gt;my_code&amp;lt;/code&amp;gt;) and a helper script (&amp;lt;code&amp;gt;run_my_code.sh&amp;lt;/code&amp;gt;), which sets some environmental variables before it calls the binary.&lt;br /&gt;
This script may interfere with the module system.&lt;br /&gt;
Therefore, the binary should be called directly (see example below).&lt;br /&gt;
&lt;br /&gt;
== Running compiled binaries with the MATLAB Runtime ==&lt;br /&gt;
&lt;br /&gt;
Check available versions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module avail math/matlab-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently installed: R2022a, R2023a, R2023b, R2024a, R2024b, R2025a, R2025b, R2026a.&lt;br /&gt;
&lt;br /&gt;
Load a specific version that matches the version of your compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load math/matlab-runtime/R2026a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run your binary:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./my_code&lt;br /&gt;
&lt;br /&gt;
# avoid the shell script generated by the compiler&lt;br /&gt;
# it interferes with the module system&lt;br /&gt;
# ./run_my_code.sh  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The MATLAB Runtime is [https://de.mathworks.com/products/compiler/matlab-runtime.html freely available from MathWorks] and can also be installed locally if needed.&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=Helix/Software/Matlab&amp;diff=16332</id>
		<title>Helix/Software/Matlab</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=Helix/Software/Matlab&amp;diff=16332"/>
		<updated>2026-08-27T10:50:47Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: MATLAB Compiler/Runtime: links to documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;border: 2px solid #d33; background-color: #fee7e6; padding: 10px; margin-bottom: 1em; width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;⚠ MATLAB modules have been removed on March 31, 2026.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The MathWorks state license (Landeslizenz) has expired on March 31, 2026 and will not be renewed. The MATLAB modules &amp;lt;code&amp;gt;math/matlab&amp;lt;/code&amp;gt; are no longer be available on Helix.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alternatives:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;GNU Octave&#039;&#039;&#039; (&amp;lt;code&amp;gt;module load math/octave&amp;lt;/code&amp;gt;): MATLAB scripts that do not use special features of toolboxes may run with Octave without or with minor changes.&lt;br /&gt;
* &#039;&#039;&#039;Matlab Compiler / Matlab Runtime&#039;&#039;&#039;: Use the [https://de.mathworks.com/products/compiler.html MATLAB Compiler] to build stand-alone binaries on your local computer (with your own license) and run them with the MATLAB Runtime on the cluster — no license required at runtime (see section &amp;quot;Compile MATLAB binaries with mcc&amp;quot; below).&lt;br /&gt;
* &#039;&#039;&#039;Institute license&#039;&#039;&#039;: If your institute has its own MathWorks network license, it may be possible to use it from the cluster. This must be checked on a case-by-case basis — please [https://www.bwhpc.de/supportportal.php submit a ticket].&lt;br /&gt;
* Other alternatives: &amp;lt;code&amp;gt;math/julia&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;math/R&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;devel/python&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Softwarepage|math/matlab}}&lt;br /&gt;
&lt;br /&gt;
{| width=600px class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Content&lt;br /&gt;
|-&lt;br /&gt;
| module load&lt;br /&gt;
| math/matlab&lt;br /&gt;
|-&lt;br /&gt;
| License&lt;br /&gt;
| [https://de.mathworks.com/pricing-licensing/index.html?intendeduse=edu&amp;amp;prodcode=ML Academic License/Commercial]&lt;br /&gt;
|-&lt;br /&gt;
| Citing&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
| Links&lt;br /&gt;
| [https://de.mathworks.com/products/matlab/ MATLAB Homepage] &amp;amp;#124; [https://de.mathworks.com/index.html?s_tid=gn_logo MathWorks Homepage] &amp;amp;#124; [https://de.mathworks.com/support/?s_tid=gn_supp Support and more]&lt;br /&gt;
|-&lt;br /&gt;
| Graphical Interface&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MATLAB&#039;&#039;&#039; (MATrix LABoratory) is a high-level programming language and interactive computing environment for numerical calculation and data visualization.&lt;br /&gt;
&lt;br /&gt;
= Loading MATLAB =&lt;br /&gt;
&lt;br /&gt;
The preferable way is to run the MATLAB command line interface without GUI:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab -nodisplay&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interactive MATLAB session with graphical user interface (GUI) can be started with the command (requires X11 forwarding enabled for your ssh login):&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Do not start a long-duration interactive MATLAB session on a login node of the cluster. Submit an [[Helix/Slurm#Interactive_Jobs | interactive job]] and start MATLAB from within the dedicated compute node assigned to you by the queueing system.&lt;br /&gt;
&lt;br /&gt;
The following generic command will execute a MATLAB script or function named &amp;quot;example&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab -nodisplay -batch example &amp;gt; result.out 2&amp;gt;&amp;amp;1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of this session will be redirected to the file result.out. The option &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;-batch&amp;lt;/syntaxhighlight&amp;gt; executes the MATLAB statement non-interactively.&lt;br /&gt;
&lt;br /&gt;
= Parallel Computing Using MATLAB =&lt;br /&gt;
&lt;br /&gt;
Parallelization of MATLAB jobs is realized via the built-in multi-threading provided by MATLAB&#039;s BLAS and FFT implementation and the parallel computing functionality of MATLAB&#039;s Parallel Computing Toolbox (PCT).&lt;br /&gt;
&lt;br /&gt;
== Implicit Threading ==&lt;br /&gt;
&lt;br /&gt;
A large number of built-in MATLAB functions may utilize multiple cores automatically without any code modifications required. This is referred to as implicit multi-threading and must be strictly distinguished from explicit parallelism provided by the Parallel Computing Toolbox (PCT) which requires specific commands in your code in order to create threads.&lt;br /&gt;
&lt;br /&gt;
Implicit threading particularly takes place for linear algebra operations (such as the solution to a linear system A\b or matrix products A*B) and FFT operations. Many other high-level MATLAB functions do also benefit from multi-threading capabilities of their underlying routines. If multi-threading is not desired, single-threading can be enforced by adding the command line option &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;-singleCompThread&amp;lt;/syntaxhighlight&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Whenever implicit threading takes place, MATLAB will detect the total number of cores that exist on a machine and by default makes use of all of them. This has very important implications for MATLAB jobs in HPC environments with shared-node job scheduling policy (i.e. with multiple users sharing one compute node). Due to this behaviour, a MATLAB job may take over more compute resources than assigned by the queueing system of the cluster (and thereby taking away these resources from all other users with running jobs on the same node - including your own jobs).&lt;br /&gt;
&lt;br /&gt;
Therefore, when running in multi-threaded mode, MATLAB always requires the user&#039;s intervention to not allocate all cores of the machine (unless requested so from the queueing system). The number of threads must be controlled from within the code by means of the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;maxNumCompThreads(N)&amp;lt;/syntaxhighlight&amp;gt; function or, alternatively, with the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;feature(&#039;numThreads&#039;, N)&amp;lt;/syntaxhighlight&amp;gt; function (which is undocumented).&lt;br /&gt;
&lt;br /&gt;
== Using the Parallel Computing Toolbox (PCT) ==&lt;br /&gt;
&lt;br /&gt;
By using the PCT one can make explicit use of several cores on multicore processors to parallelize MATLAB applications without MPI programming. Under MATLAB version 8.4 and earlier, this toolbox provides 12 workers (MATLAB computational engines) to execute applications locally on a single multicore node. Under MATLAB version 8.5 and later, the number of workers available is equal to the number of cores on a single node (up to a maximum of 512).&lt;br /&gt;
&lt;br /&gt;
If multiple PCT jobs are running at the same time, they all write temporary MATLAB job information to the same location. This race condition can cause one or more of the parallel MATLAB jobs fail to use the parallel functionality of the toolbox.&lt;br /&gt;
&lt;br /&gt;
To solve this issue, each MATLAB job should explicitly set a unique location where these files are created. This can be accomplished by the following snippet of code added to your MATLAB script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% create a local cluster object&lt;br /&gt;
pc = parcluster(&#039;local&#039;)&lt;br /&gt;
&lt;br /&gt;
% get the number of dedicated cores from environment&lt;br /&gt;
nprocs = str2num(getenv(&#039;SLURM_NPROCS&#039;))&lt;br /&gt;
&lt;br /&gt;
% you may explicitly set the JobStorageLocation to the tmp directory that is unique to each cluster job (and is on local, fast scratch)&lt;br /&gt;
parpool_tmpdir = [getenv(&#039;TMP&#039;),&#039;/.matlab/local_cluster_jobs/slurm_jobID_&#039;,getenv(&#039;SLURM_JOB_ID&#039;)]&lt;br /&gt;
mkdir(parpool_tmpdir)&lt;br /&gt;
pc.JobStorageLocation = parpool_tmpdir&lt;br /&gt;
&lt;br /&gt;
% start the parallel pool&lt;br /&gt;
parpool(pc, nprocs)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If a large number of MATLAB-jobs are run in parallel, they can also conflict when writing generic information to &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;~/.matlab&amp;lt;/syntaxhighlight&amp;gt;. This can be circumvented by setting &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;$MATLAB_PREFDIR&amp;lt;/syntaxhighlight&amp;gt; to different directories in your Batch-script, e.g.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export MATLAB_PREFDIR=$TMP&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using a different implementation of BLAS/LAPACK ==&lt;br /&gt;
&lt;br /&gt;
By default, Matlab uses a version of Intel MKL as its BLAS/LAPACK library. It is possible to manually change this to different libraries by setting the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;BLAS_VERSION&amp;lt;/syntaxhighlight&amp;gt; and &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;LAPACK_VERSION&amp;lt;/syntaxhighlight&amp;gt; environment variables. The following lines can be added to the batch-script to change it, in this example to BLIS and Flame, which are optimized for AMD processors: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load numlib/aocl/3.2.0&lt;br /&gt;
&lt;br /&gt;
export BLAS_VERSION=$AOCL_LIB_DIR/libblis-mt.so&lt;br /&gt;
export LAPACK_VERSION=$AOCL_LIB_DIR/libflame.so&lt;br /&gt;
&lt;br /&gt;
export BLIS_NUM_THREADS=$SLURM_NTASKS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can increase performance depending on the task, for example large matrix multiplications, but caution is advised.&lt;br /&gt;
&lt;br /&gt;
= General Performance Tips for MATLAB =&lt;br /&gt;
&lt;br /&gt;
MATLAB data structures (arrays or matrices) are dynamic in size, i.e. MATLAB will automatically resize the structure on demand. Although this seems to be convenient, MATLAB continually needs to allocate a new chunk of memory and copy over the data to the new block of memory as the array or matrix grows in a loop. This may take a significant amount of extra time during execution of the program.&lt;br /&gt;
&lt;br /&gt;
Code performance can often be drastically improved by pre-allocating memory for the final expected size of the array or matrix before actually starting the processing loop. In order to pre-allocate an array of strings, you can use MATLAB&#039;s build-in cell function. In order to pre-allocate an array or matrix of numbers, you can use MATLAB&#039;s build-in zeros function.&lt;br /&gt;
&lt;br /&gt;
The performance benefit of pre-allocation is illustrated with the following example code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% prealloc.m&lt;br /&gt;
&lt;br /&gt;
clear all;&lt;br /&gt;
&lt;br /&gt;
num=10000000;&lt;br /&gt;
&lt;br /&gt;
disp(&#039;Without pre-allocation:&#039;)&lt;br /&gt;
tic&lt;br /&gt;
for i=1:num&lt;br /&gt;
    a(i)=i;&lt;br /&gt;
end&lt;br /&gt;
toc&lt;br /&gt;
&lt;br /&gt;
disp(&#039;With pre-allocation:&#039;)&lt;br /&gt;
tic&lt;br /&gt;
b=zeros(1,num);&lt;br /&gt;
for i=1:num&lt;br /&gt;
    b(i)=i;&lt;br /&gt;
end&lt;br /&gt;
toc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a compute node, the result may look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Without pre-allocation:&lt;br /&gt;
Elapsed time is 2.879446 seconds.&lt;br /&gt;
With pre-allocation:&lt;br /&gt;
Elapsed time is 0.097557 seconds.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please recognize that the code runs almost 30 times faster with pre-allocation.&lt;br /&gt;
&lt;br /&gt;
= MATLAB Compiler/Runtime =&lt;br /&gt;
&lt;br /&gt;
If you do not have access to a full MATLAB installation on Helix, you can still run compiled MATLAB applications using the MATLAB Runtime module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; The MATLAB Runtime version must &#039;&#039;&#039;exactly&#039;&#039;&#039; match the MATLAB version used for compilation. For example, code compiled with R2023a requires &amp;lt;code&amp;gt;math/matlab-runtime/R2023a&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Three steps are necessary:&lt;br /&gt;
# Create a binary on your computer with MATLAB Compiler.&lt;br /&gt;
# Transfer the compiled binary to Helix.&lt;br /&gt;
# Load MATLAB Runtime and run compiled binary on Helix.&lt;br /&gt;
&lt;br /&gt;
While the compiler supports the full MATLAB language, not all toolboxes are fully suported. The official documentation provides more details on [https://mathworks.com/products/compiler/compiler_support.html limitations] of the compiler. In addition, the [https://mathworks.com/help/pdf_doc/compiler/compiler.pdf user&#039;s guide] contains examples and a section on troubleshooting.&lt;br /&gt;
&lt;br /&gt;
== Compile MATLAB binaries with mcc ==&lt;br /&gt;
&lt;br /&gt;
If you have a MATLAB license that includes [https://de.mathworks.com/products/compiler.html MATLAB Compiler], e.g. on your local computer, you can use &amp;lt;code&amp;gt;mcc&amp;lt;/code&amp;gt; to create binaries from MATLAB code.&lt;br /&gt;
Stand-alone MATLAB programs compiled with &amp;lt;code&amp;gt;mcc&amp;lt;/code&amp;gt; do not require any license tokens at runtime and you can start jobs in parallel without any risk of running out of licences.&lt;br /&gt;
&lt;br /&gt;
Compile your MATLAB code on a machine where you have a MATLAB license (e.g., your local workstation via an institute license):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mcc -m my_code.m&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running compiled binaries with the MATLAB Runtime ==&lt;br /&gt;
&lt;br /&gt;
Check available versions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module avail math/matlab-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently installed: R2022a, R2023a, R2023b, R2024a, R2024b, R2025a, R2025b.&lt;br /&gt;
&lt;br /&gt;
Load a specific version that matches the version of your compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load math/matlab-runtime/R2025b&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run your binary:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./my_code&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The MATLAB Runtime is [https://de.mathworks.com/products/compiler/matlab-runtime.html freely available from MathWorks] and can also be installed locally if needed.&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=When_to_use_an_HPC_Cluster&amp;diff=16295</id>
		<title>When to use an HPC Cluster</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=When_to_use_an_HPC_Cluster&amp;diff=16295"/>
		<updated>2026-08-25T08:38:49Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: change link to English website&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I have calculations to do - should I try using one of the bwHPC clusters for my tasks?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== When to use HPC computers ==&lt;br /&gt;
&lt;br /&gt;
You can benefit from an HPC-Cluster if:&lt;br /&gt;
&lt;br /&gt;
#  You can run many separate calculations in parallel&lt;br /&gt;
#  Software can efficiently divide your problem into many smaller problems that run in parallel&lt;br /&gt;
#  You need more RAM (memory) than your computer can provide&lt;br /&gt;
#  You need more GPUs and have no other source&lt;br /&gt;
#  You need to process large amounts of data that do not fit on your computer&lt;br /&gt;
&lt;br /&gt;
== When &#039;&#039;&#039;not&#039;&#039;&#039; to use HPC computers ==&lt;br /&gt;
&lt;br /&gt;
You will probably not have a big benefit from using HPC when:&lt;br /&gt;
&lt;br /&gt;
* Your calculation runs in serial (only on one compute core is used, things cannot run in parallel) and you have few calculations&lt;br /&gt;
* Your workflow requires that you run one calculation, then retrieve data to analyze it locally, then run the next calculation&lt;br /&gt;
&lt;br /&gt;
Except 3) or 4) of &amp;quot;when to use a cluster&amp;quot; force you to use the clusters anyway. &lt;br /&gt;
&lt;br /&gt;
== Misconceptions == &lt;br /&gt;
=== &amp;quot;Everything will be faster&amp;quot; ===&lt;br /&gt;
[[File:BwUniCluster_2.0_Feb2020_1024x423.jpg|right|thumb|alt=bwUniCluster2.0 |upright=1| many compute cores: Every &amp;quot;tray&amp;quot; in these racks contains 1-4 computers, every computer typically has 50-200 compute cores. ]]&lt;br /&gt;
&lt;br /&gt;
The performance of a single compute core is not higher than that of your typical desktop computer. The main things we can offer are:&lt;br /&gt;
&lt;br /&gt;
* Many compute cores &lt;br /&gt;
* Much RAM (memory) &lt;br /&gt;
* GPUs&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;It&#039;s just a computer, I know how to use a computer&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
While the clusters are indeed &amp;quot;just&amp;quot; many Linux computers, they are also multi-million Euro instruments. So while they may have many similarities with a Linux desktop, in some respects, it is better to think of them like of other expensive instruments you may use in your research. HPC clusters have hardware components you may have never heard of in the consumer market, they typically have more than one CPU socket (making among other things memory management more complicated), etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;I want to host servers on bwHPC&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
On the bwHPC clusters, you submit jobs to a supercomputer that get scheduled and processed over time. It is not the place for permanent server hosting. If you need self-service virtual machines, check out [https://bwcloud-os.de/en/ bwCloud-OS], which offers an OpenStack-based [https://en.wikipedia.org/wiki/Infrastructure_as_a_service IaaS] platform for research, teaching, and administration in Baden-Württemberg.&lt;br /&gt;
&lt;br /&gt;
== What are the Costs? ==&lt;br /&gt;
&lt;br /&gt;
=== Monetary ===&lt;br /&gt;
&lt;br /&gt;
No cost to you as the end-user&lt;br /&gt;
&lt;br /&gt;
(But of course the HPC systems are bought for millions of Euro and the power cost of running calculations is in the same order of magnitude as buying the systems)  &lt;br /&gt;
&lt;br /&gt;
=== Effort / Time ===&lt;br /&gt;
&lt;br /&gt;
There is quite a learning curve to start calculating. &lt;br /&gt;
&lt;br /&gt;
* Linux shell knowledge is a major part&lt;br /&gt;
* HPC-specific knowledge:&lt;br /&gt;
** Software module system - software supplied by the cluster maintainers (vide infra)&lt;br /&gt;
** How to use the scheduler / write job scripts: how to send calculations to a computer on the cluster (vide infra)&lt;br /&gt;
* Wait times: a good cluster is always busy. Expect a waiting time betwween 1h and 2 days until your calculation(s) start&lt;br /&gt;
&lt;br /&gt;
=== Compute Workflow ===&lt;br /&gt;
&lt;br /&gt;
A short description of the workflow how running calculation works can be found under [[Running Calculations]] and can give you a general idea.&lt;br /&gt;
&lt;br /&gt;
=== Software === &lt;br /&gt;
&lt;br /&gt;
Basic usage is very simple: you run &amp;lt;code&amp;gt; module load module_name &amp;lt;/code&amp;gt; and use the software, but important documentation and examples are also built into the modules. &lt;br /&gt;
&lt;br /&gt;
The usage of the software on the cluster is described in [[Environment Modules]]&lt;br /&gt;
&lt;br /&gt;
== Still With Us? ==&lt;br /&gt;
&lt;br /&gt;
If you feel your calculations meet the requirements and you will save a lot of time despite some learning overhead, proceed to the [[Registration]] page.&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=When_to_use_an_HPC_Cluster&amp;diff=16294</id>
		<title>When to use an HPC Cluster</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=When_to_use_an_HPC_Cluster&amp;diff=16294"/>
		<updated>2026-08-25T08:37:16Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: more details on bwCloud-OS&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I have calculations to do - should I try using one of the bwHPC clusters for my tasks?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== When to use HPC computers ==&lt;br /&gt;
&lt;br /&gt;
You can benefit from an HPC-Cluster if:&lt;br /&gt;
&lt;br /&gt;
#  You can run many separate calculations in parallel&lt;br /&gt;
#  Software can efficiently divide your problem into many smaller problems that run in parallel&lt;br /&gt;
#  You need more RAM (memory) than your computer can provide&lt;br /&gt;
#  You need more GPUs and have no other source&lt;br /&gt;
#  You need to process large amounts of data that do not fit on your computer&lt;br /&gt;
&lt;br /&gt;
== When &#039;&#039;&#039;not&#039;&#039;&#039; to use HPC computers ==&lt;br /&gt;
&lt;br /&gt;
You will probably not have a big benefit from using HPC when:&lt;br /&gt;
&lt;br /&gt;
* Your calculation runs in serial (only on one compute core is used, things cannot run in parallel) and you have few calculations&lt;br /&gt;
* Your workflow requires that you run one calculation, then retrieve data to analyze it locally, then run the next calculation&lt;br /&gt;
&lt;br /&gt;
Except 3) or 4) of &amp;quot;when to use a cluster&amp;quot; force you to use the clusters anyway. &lt;br /&gt;
&lt;br /&gt;
== Misconceptions == &lt;br /&gt;
=== &amp;quot;Everything will be faster&amp;quot; ===&lt;br /&gt;
[[File:BwUniCluster_2.0_Feb2020_1024x423.jpg|right|thumb|alt=bwUniCluster2.0 |upright=1| many compute cores: Every &amp;quot;tray&amp;quot; in these racks contains 1-4 computers, every computer typically has 50-200 compute cores. ]]&lt;br /&gt;
&lt;br /&gt;
The performance of a single compute core is not higher than that of your typical desktop computer. The main things we can offer are:&lt;br /&gt;
&lt;br /&gt;
* Many compute cores &lt;br /&gt;
* Much RAM (memory) &lt;br /&gt;
* GPUs&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;It&#039;s just a computer, I know how to use a computer&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
While the clusters are indeed &amp;quot;just&amp;quot; many Linux computers, they are also multi-million Euro instruments. So while they may have many similarities with a Linux desktop, in some respects, it is better to think of them like of other expensive instruments you may use in your research. HPC clusters have hardware components you may have never heard of in the consumer market, they typically have more than one CPU socket (making among other things memory management more complicated), etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;I want to host servers on bwHPC&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
On the bwHPC clusters, you submit jobs to a supercomputer that get scheduled and processed over time. It is not the place for permanent server hosting. If you need self-service virtual machines, check out [https://bwcloud-os.de/ bwCloud-OS], which offers an OpenStack-based [https://en.wikipedia.org/wiki/Infrastructure_as_a_service IaaS] platform for research, teaching, and administration in Baden-Württemberg.&lt;br /&gt;
&lt;br /&gt;
== What are the Costs? ==&lt;br /&gt;
&lt;br /&gt;
=== Monetary ===&lt;br /&gt;
&lt;br /&gt;
No cost to you as the end-user&lt;br /&gt;
&lt;br /&gt;
(But of course the HPC systems are bought for millions of Euro and the power cost of running calculations is in the same order of magnitude as buying the systems)  &lt;br /&gt;
&lt;br /&gt;
=== Effort / Time ===&lt;br /&gt;
&lt;br /&gt;
There is quite a learning curve to start calculating. &lt;br /&gt;
&lt;br /&gt;
* Linux shell knowledge is a major part&lt;br /&gt;
* HPC-specific knowledge:&lt;br /&gt;
** Software module system - software supplied by the cluster maintainers (vide infra)&lt;br /&gt;
** How to use the scheduler / write job scripts: how to send calculations to a computer on the cluster (vide infra)&lt;br /&gt;
* Wait times: a good cluster is always busy. Expect a waiting time betwween 1h and 2 days until your calculation(s) start&lt;br /&gt;
&lt;br /&gt;
=== Compute Workflow ===&lt;br /&gt;
&lt;br /&gt;
A short description of the workflow how running calculation works can be found under [[Running Calculations]] and can give you a general idea.&lt;br /&gt;
&lt;br /&gt;
=== Software === &lt;br /&gt;
&lt;br /&gt;
Basic usage is very simple: you run &amp;lt;code&amp;gt; module load module_name &amp;lt;/code&amp;gt; and use the software, but important documentation and examples are also built into the modules. &lt;br /&gt;
&lt;br /&gt;
The usage of the software on the cluster is described in [[Environment Modules]]&lt;br /&gt;
&lt;br /&gt;
== Still With Us? ==&lt;br /&gt;
&lt;br /&gt;
If you feel your calculations meet the requirements and you will save a lot of time despite some learning overhead, proceed to the [[Registration]] page.&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=When_to_use_an_HPC_Cluster&amp;diff=16293</id>
		<title>When to use an HPC Cluster</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=When_to_use_an_HPC_Cluster&amp;diff=16293"/>
		<updated>2026-08-25T08:30:17Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: updated link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I have calculations to do - should I try using one of the bwHPC clusters for my tasks?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== When to use HPC computers ==&lt;br /&gt;
&lt;br /&gt;
You can benefit from an HPC-Cluster if:&lt;br /&gt;
&lt;br /&gt;
#  You can run many separate calculations in parallel&lt;br /&gt;
#  Software can efficiently divide your problem into many smaller problems that run in parallel&lt;br /&gt;
#  You need more RAM (memory) than your computer can provide&lt;br /&gt;
#  You need more GPUs and have no other source&lt;br /&gt;
#  You need to process large amounts of data that do not fit on your computer&lt;br /&gt;
&lt;br /&gt;
== When &#039;&#039;&#039;not&#039;&#039;&#039; to use HPC computers ==&lt;br /&gt;
&lt;br /&gt;
You will probably not have a big benefit from using HPC when:&lt;br /&gt;
&lt;br /&gt;
* Your calculation runs in serial (only on one compute core is used, things cannot run in parallel) and you have few calculations&lt;br /&gt;
* Your workflow requires that you run one calculation, then retrieve data to analyze it locally, then run the next calculation&lt;br /&gt;
&lt;br /&gt;
Except 3) or 4) of &amp;quot;when to use a cluster&amp;quot; force you to use the clusters anyway. &lt;br /&gt;
&lt;br /&gt;
== Misconceptions == &lt;br /&gt;
=== &amp;quot;Everything will be faster&amp;quot; ===&lt;br /&gt;
[[File:BwUniCluster_2.0_Feb2020_1024x423.jpg|right|thumb|alt=bwUniCluster2.0 |upright=1| many compute cores: Every &amp;quot;tray&amp;quot; in these racks contains 1-4 computers, every computer typically has 50-200 compute cores. ]]&lt;br /&gt;
&lt;br /&gt;
The performance of a single compute core is not higher than that of your typical desktop computer. The main things we can offer are:&lt;br /&gt;
&lt;br /&gt;
* Many compute cores &lt;br /&gt;
* Much RAM (memory) &lt;br /&gt;
* GPUs&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;It&#039;s just a computer, I know how to use a computer&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
While the clusters are indeed &amp;quot;just&amp;quot; many Linux computers, they are also multi-million Euro instruments. So while they may have many similarities with a Linux desktop, in some respects, it is better to think of them like of other expensive instruments you may use in your research. HPC clusters have hardware components you may have never heard of in the consumer market, they typically have more than one CPU socket (making among other things memory management more complicated), etc. etc. etc.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;I want to host servers on bwHPC&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
On the bwHPC-clusters, you submit jobs to a supercomputer that get scheduled and processed over time. It is not the place for permanent server hosting. If you need self-service virtual machines, check out the [https://bwcloud-os.de/ bwCloud-OS].&lt;br /&gt;
&lt;br /&gt;
== What are the Costs? ==&lt;br /&gt;
&lt;br /&gt;
=== Monetary ===&lt;br /&gt;
&lt;br /&gt;
No cost to you as the end-user&lt;br /&gt;
&lt;br /&gt;
(But of course the HPC systems are bought for millions of Euro and the power cost of running calculations is in the same order of magnitude as buying the systems)  &lt;br /&gt;
&lt;br /&gt;
=== Effort / Time ===&lt;br /&gt;
&lt;br /&gt;
There is quite a learning curve to start calculating. &lt;br /&gt;
&lt;br /&gt;
* Linux shell knowledge is a major part&lt;br /&gt;
* HPC-specific knowledge:&lt;br /&gt;
** Software module system - software supplied by the cluster maintainers (vide infra)&lt;br /&gt;
** How to use the scheduler / write job scripts: how to send calculations to a computer on the cluster (vide infra)&lt;br /&gt;
* Wait times: a good cluster is always busy. Expect a waiting time betwween 1h and 2 days until your calculation(s) start&lt;br /&gt;
&lt;br /&gt;
=== Compute Workflow ===&lt;br /&gt;
&lt;br /&gt;
A short description of the workflow how running calculation works can be found under [[Running Calculations]] and can give you a general idea.&lt;br /&gt;
&lt;br /&gt;
=== Software === &lt;br /&gt;
&lt;br /&gt;
Basic usage is very simple: you run &amp;lt;code&amp;gt; module load module_name &amp;lt;/code&amp;gt; and use the software, but important documentation and examples are also built into the modules. &lt;br /&gt;
&lt;br /&gt;
The usage of the software on the cluster is described in [[Environment Modules]]&lt;br /&gt;
&lt;br /&gt;
== Still With Us? ==&lt;br /&gt;
&lt;br /&gt;
If you feel your calculations meet the requirements and you will save a lot of time despite some learning overhead, proceed to the [[Registration]] page.&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=Helix/Software/Matlab&amp;diff=16286</id>
		<title>Helix/Software/Matlab</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=Helix/Software/Matlab&amp;diff=16286"/>
		<updated>2026-08-24T10:35:09Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: MATLAB Runtime: reorder paragraphs and add more details&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;border: 2px solid #d33; background-color: #fee7e6; padding: 10px; margin-bottom: 1em; width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;⚠ MATLAB modules have been removed on March 31, 2026.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The MathWorks state license (Landeslizenz) has expired on March 31, 2026 and will not be renewed. The MATLAB modules &amp;lt;code&amp;gt;math/matlab&amp;lt;/code&amp;gt; are no longer be available on Helix.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alternatives:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;GNU Octave&#039;&#039;&#039; (&amp;lt;code&amp;gt;module load math/octave&amp;lt;/code&amp;gt;): MATLAB scripts that do not use special features of toolboxes may run with Octave without or with minor changes.&lt;br /&gt;
* &#039;&#039;&#039;Matlab Compiler / Matlab Runtime&#039;&#039;&#039;: Use the [https://de.mathworks.com/products/compiler.html MATLAB Compiler] to build stand-alone binaries on your local computer (with your own license) and run them with the MATLAB Runtime on the cluster — no license required at runtime (see section &amp;quot;Compile MATLAB binaries with mcc&amp;quot; below).&lt;br /&gt;
* &#039;&#039;&#039;Institute license&#039;&#039;&#039;: If your institute has its own MathWorks network license, it may be possible to use it from the cluster. This must be checked on a case-by-case basis — please [https://www.bwhpc.de/supportportal.php submit a ticket].&lt;br /&gt;
* Other alternatives: &amp;lt;code&amp;gt;math/julia&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;math/R&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;devel/python&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Softwarepage|math/matlab}}&lt;br /&gt;
&lt;br /&gt;
{| width=600px class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Content&lt;br /&gt;
|-&lt;br /&gt;
| module load&lt;br /&gt;
| math/matlab&lt;br /&gt;
|-&lt;br /&gt;
| License&lt;br /&gt;
| [https://de.mathworks.com/pricing-licensing/index.html?intendeduse=edu&amp;amp;prodcode=ML Academic License/Commercial]&lt;br /&gt;
|-&lt;br /&gt;
| Citing&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
| Links&lt;br /&gt;
| [https://de.mathworks.com/products/matlab/ MATLAB Homepage] &amp;amp;#124; [https://de.mathworks.com/index.html?s_tid=gn_logo MathWorks Homepage] &amp;amp;#124; [https://de.mathworks.com/support/?s_tid=gn_supp Support and more]&lt;br /&gt;
|-&lt;br /&gt;
| Graphical Interface&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MATLAB&#039;&#039;&#039; (MATrix LABoratory) is a high-level programming language and interactive computing environment for numerical calculation and data visualization.&lt;br /&gt;
&lt;br /&gt;
= Loading MATLAB =&lt;br /&gt;
&lt;br /&gt;
The preferable way is to run the MATLAB command line interface without GUI:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab -nodisplay&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interactive MATLAB session with graphical user interface (GUI) can be started with the command (requires X11 forwarding enabled for your ssh login):&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Do not start a long-duration interactive MATLAB session on a login node of the cluster. Submit an [[Helix/Slurm#Interactive_Jobs | interactive job]] and start MATLAB from within the dedicated compute node assigned to you by the queueing system.&lt;br /&gt;
&lt;br /&gt;
The following generic command will execute a MATLAB script or function named &amp;quot;example&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab -nodisplay -batch example &amp;gt; result.out 2&amp;gt;&amp;amp;1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of this session will be redirected to the file result.out. The option &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;-batch&amp;lt;/syntaxhighlight&amp;gt; executes the MATLAB statement non-interactively.&lt;br /&gt;
&lt;br /&gt;
= Parallel Computing Using MATLAB =&lt;br /&gt;
&lt;br /&gt;
Parallelization of MATLAB jobs is realized via the built-in multi-threading provided by MATLAB&#039;s BLAS and FFT implementation and the parallel computing functionality of MATLAB&#039;s Parallel Computing Toolbox (PCT).&lt;br /&gt;
&lt;br /&gt;
== Implicit Threading ==&lt;br /&gt;
&lt;br /&gt;
A large number of built-in MATLAB functions may utilize multiple cores automatically without any code modifications required. This is referred to as implicit multi-threading and must be strictly distinguished from explicit parallelism provided by the Parallel Computing Toolbox (PCT) which requires specific commands in your code in order to create threads.&lt;br /&gt;
&lt;br /&gt;
Implicit threading particularly takes place for linear algebra operations (such as the solution to a linear system A\b or matrix products A*B) and FFT operations. Many other high-level MATLAB functions do also benefit from multi-threading capabilities of their underlying routines. If multi-threading is not desired, single-threading can be enforced by adding the command line option &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;-singleCompThread&amp;lt;/syntaxhighlight&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Whenever implicit threading takes place, MATLAB will detect the total number of cores that exist on a machine and by default makes use of all of them. This has very important implications for MATLAB jobs in HPC environments with shared-node job scheduling policy (i.e. with multiple users sharing one compute node). Due to this behaviour, a MATLAB job may take over more compute resources than assigned by the queueing system of the cluster (and thereby taking away these resources from all other users with running jobs on the same node - including your own jobs).&lt;br /&gt;
&lt;br /&gt;
Therefore, when running in multi-threaded mode, MATLAB always requires the user&#039;s intervention to not allocate all cores of the machine (unless requested so from the queueing system). The number of threads must be controlled from within the code by means of the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;maxNumCompThreads(N)&amp;lt;/syntaxhighlight&amp;gt; function or, alternatively, with the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;feature(&#039;numThreads&#039;, N)&amp;lt;/syntaxhighlight&amp;gt; function (which is undocumented).&lt;br /&gt;
&lt;br /&gt;
== Using the Parallel Computing Toolbox (PCT) ==&lt;br /&gt;
&lt;br /&gt;
By using the PCT one can make explicit use of several cores on multicore processors to parallelize MATLAB applications without MPI programming. Under MATLAB version 8.4 and earlier, this toolbox provides 12 workers (MATLAB computational engines) to execute applications locally on a single multicore node. Under MATLAB version 8.5 and later, the number of workers available is equal to the number of cores on a single node (up to a maximum of 512).&lt;br /&gt;
&lt;br /&gt;
If multiple PCT jobs are running at the same time, they all write temporary MATLAB job information to the same location. This race condition can cause one or more of the parallel MATLAB jobs fail to use the parallel functionality of the toolbox.&lt;br /&gt;
&lt;br /&gt;
To solve this issue, each MATLAB job should explicitly set a unique location where these files are created. This can be accomplished by the following snippet of code added to your MATLAB script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% create a local cluster object&lt;br /&gt;
pc = parcluster(&#039;local&#039;)&lt;br /&gt;
&lt;br /&gt;
% get the number of dedicated cores from environment&lt;br /&gt;
nprocs = str2num(getenv(&#039;SLURM_NPROCS&#039;))&lt;br /&gt;
&lt;br /&gt;
% you may explicitly set the JobStorageLocation to the tmp directory that is unique to each cluster job (and is on local, fast scratch)&lt;br /&gt;
parpool_tmpdir = [getenv(&#039;TMP&#039;),&#039;/.matlab/local_cluster_jobs/slurm_jobID_&#039;,getenv(&#039;SLURM_JOB_ID&#039;)]&lt;br /&gt;
mkdir(parpool_tmpdir)&lt;br /&gt;
pc.JobStorageLocation = parpool_tmpdir&lt;br /&gt;
&lt;br /&gt;
% start the parallel pool&lt;br /&gt;
parpool(pc, nprocs)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If a large number of MATLAB-jobs are run in parallel, they can also conflict when writing generic information to &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;~/.matlab&amp;lt;/syntaxhighlight&amp;gt;. This can be circumvented by setting &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;$MATLAB_PREFDIR&amp;lt;/syntaxhighlight&amp;gt; to different directories in your Batch-script, e.g.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export MATLAB_PREFDIR=$TMP&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using a different implementation of BLAS/LAPACK ==&lt;br /&gt;
&lt;br /&gt;
By default, Matlab uses a version of Intel MKL as its BLAS/LAPACK library. It is possible to manually change this to different libraries by setting the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;BLAS_VERSION&amp;lt;/syntaxhighlight&amp;gt; and &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;LAPACK_VERSION&amp;lt;/syntaxhighlight&amp;gt; environment variables. The following lines can be added to the batch-script to change it, in this example to BLIS and Flame, which are optimized for AMD processors: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load numlib/aocl/3.2.0&lt;br /&gt;
&lt;br /&gt;
export BLAS_VERSION=$AOCL_LIB_DIR/libblis-mt.so&lt;br /&gt;
export LAPACK_VERSION=$AOCL_LIB_DIR/libflame.so&lt;br /&gt;
&lt;br /&gt;
export BLIS_NUM_THREADS=$SLURM_NTASKS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can increase performance depending on the task, for example large matrix multiplications, but caution is advised.&lt;br /&gt;
&lt;br /&gt;
= General Performance Tips for MATLAB =&lt;br /&gt;
&lt;br /&gt;
MATLAB data structures (arrays or matrices) are dynamic in size, i.e. MATLAB will automatically resize the structure on demand. Although this seems to be convenient, MATLAB continually needs to allocate a new chunk of memory and copy over the data to the new block of memory as the array or matrix grows in a loop. This may take a significant amount of extra time during execution of the program.&lt;br /&gt;
&lt;br /&gt;
Code performance can often be drastically improved by pre-allocating memory for the final expected size of the array or matrix before actually starting the processing loop. In order to pre-allocate an array of strings, you can use MATLAB&#039;s build-in cell function. In order to pre-allocate an array or matrix of numbers, you can use MATLAB&#039;s build-in zeros function.&lt;br /&gt;
&lt;br /&gt;
The performance benefit of pre-allocation is illustrated with the following example code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% prealloc.m&lt;br /&gt;
&lt;br /&gt;
clear all;&lt;br /&gt;
&lt;br /&gt;
num=10000000;&lt;br /&gt;
&lt;br /&gt;
disp(&#039;Without pre-allocation:&#039;)&lt;br /&gt;
tic&lt;br /&gt;
for i=1:num&lt;br /&gt;
    a(i)=i;&lt;br /&gt;
end&lt;br /&gt;
toc&lt;br /&gt;
&lt;br /&gt;
disp(&#039;With pre-allocation:&#039;)&lt;br /&gt;
tic&lt;br /&gt;
b=zeros(1,num);&lt;br /&gt;
for i=1:num&lt;br /&gt;
    b(i)=i;&lt;br /&gt;
end&lt;br /&gt;
toc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a compute node, the result may look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Without pre-allocation:&lt;br /&gt;
Elapsed time is 2.879446 seconds.&lt;br /&gt;
With pre-allocation:&lt;br /&gt;
Elapsed time is 0.097557 seconds.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please recognize that the code runs almost 30 times faster with pre-allocation.&lt;br /&gt;
&lt;br /&gt;
= MATLAB Compiler/Runtime =&lt;br /&gt;
&lt;br /&gt;
If you do not have access to a full MATLAB installation on Helix, you can still run compiled MATLAB applications using the MATLAB Runtime module.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; The MATLAB Runtime version must &#039;&#039;&#039;exactly&#039;&#039;&#039; match the MATLAB version used for compilation. For example, code compiled with R2023a requires &amp;lt;code&amp;gt;math/matlab-runtime/R2023a&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Three steps are necessary:&lt;br /&gt;
# Compile MATLAB binary on your computer.&lt;br /&gt;
# Transfer the compiled binary to Helix.&lt;br /&gt;
# Load MATLAB Runtime and run compiled binary on Helix.&lt;br /&gt;
&lt;br /&gt;
== Compile MATLAB binaries with mcc ==&lt;br /&gt;
&lt;br /&gt;
If you have a MATLAB license that includes [https://de.mathworks.com/products/compiler.html MATLAB Compiler], e.g. on your local computer, you can use &amp;lt;code&amp;gt;mcc&amp;lt;/code&amp;gt; to create binaries from MATLAB code.&lt;br /&gt;
Stand-alone MATLAB programs compiled with &amp;lt;code&amp;gt;mcc&amp;lt;/code&amp;gt; do not require any license tokens at runtime and you can start jobs in parallel without any risk of running out of licences.&lt;br /&gt;
&lt;br /&gt;
Compile your MATLAB code on a machine where you have a MATLAB license (e.g., your local workstation via an institute license):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mcc -m my_code.m&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running compiled binaries with the MATLAB Runtime ==&lt;br /&gt;
&lt;br /&gt;
Check available versions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module avail math/matlab-runtime&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Currently installed: R2022a, R2023a, R2023b, R2024a, R2024b, R2025a, R2025b.&lt;br /&gt;
&lt;br /&gt;
Load a specific version that matches the version of your compiler:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
module load math/matlab-runtime/R2025b&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run your binary:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./my_code&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The MATLAB Runtime is [https://de.mathworks.com/products/compiler/matlab-runtime.html freely available from MathWorks] and can also be installed locally if needed.&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=SDS@hd/Access&amp;diff=16282</id>
		<title>SDS@hd/Access</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=SDS@hd/Access&amp;diff=16282"/>
		<updated>2026-08-24T09:19:08Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: /* Recommended Setup */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page provides an overview on how to access data served by SDS@hd. To get an introduction to data transfer in general, see [[Data_Transfer|data transfer]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Notation:&#039;&#039;&#039; Please replace all placeholder contents within guillemets &amp;lt;code&amp;gt;&amp;lt; &amp;gt;&amp;lt;/code&amp;gt; with the actual value. For example, replace &#039;&#039;&amp;lt;name_of_my_dog&amp;gt;&#039;&#039; with &#039;&#039;Fluffy&#039;&#039; .&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
* You need to be [[SDS@hd/Registration|registered]].&lt;br /&gt;
* You need to be in the belwue-Network. This means you have to use the VPN Service of your HomeOrganization, if you want to access SDS@hd from outside the bwHPC-Clusters (e.g. via eduroam or from your personal notebook).&lt;br /&gt;
&lt;br /&gt;
== Needed Information, independent of the chosen tool ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Username:&#039;&#039;&#039; You can look it up under your user data at [https://bwservices.uni-heidelberg.de/user/index.xhtml bwServices]. The username is &#039;&#039;&amp;lt;localPrimaryGroup&amp;gt;_&amp;lt;eduPersonPrincipalName&amp;gt;&#039;&#039; . (It is the same as for the bwHPC Clusters. Example: &#039;&#039;hd_ab123&#039;&#039;.)&lt;br /&gt;
* &#039;&#039;&#039;Password:&#039;&#039;&#039; The Service Password that you set at bwServices in the [[SDS@hd/Registration#Step_B:_Registration_for_SDS@hd_Service|registration step]].&lt;br /&gt;
* &#039;&#039;&#039;SV-Acronym:&#039;&#039;&#039; Use the lower case version of the acronym for all access options.&lt;br /&gt;
* &#039;&#039;&#039;Hostname:&#039;&#039;&#039; The hostname depends on the chosen network protocol:&lt;br /&gt;
** For [[Data_Transfer/SSHFS|SSHFS]] and [[Data_Transfer/SFTP|SFTP]]: &#039;&#039;lsdf02-sshfs.urz.uni-heidelberg.de&#039;&#039;&lt;br /&gt;
** For [[SDS@hd/Access/SMB|SMB]] and [[SDS@hd/Access/NFS|NFS]]: &#039;&#039;lsdf02.urz.uni-heidelberg.de&#039;&#039;&lt;br /&gt;
** For [[Data_Transfer/WebDAV|WebDAV]] the url is: &#039;&#039;https://lsdf02-webdav.urz.uni-heidelberg.de&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Domain:&#039;&#039;&#039; The domain is &#039;&#039;BWSERVICESAD&#039;&#039; (needed for smb and nfs connections).&lt;br /&gt;
&lt;br /&gt;
== Recommended Setup ==&lt;br /&gt;
The following graphic shows the recommended way for accessing SDS@hd via Windows/Mac/Linux. The table provides an overview of the most important access options and links to the related pages.&amp;lt;br /&amp;gt;&lt;br /&gt;
If you have various use cases, it is recommended to use [[Data_Transfer/Rclone|Rclone]]. You can copy, sync and mount with it. Thanks to its multithreading and checksumming capability Rclone is a good fit for transferring big data.&amp;lt;br /&amp;gt;&lt;br /&gt;
For an overview of all connection possibilities, please have a look at [[Data_Transfer/All_Data_Transfer_Routes|all data transfer routes]].&lt;br /&gt;
&lt;br /&gt;
[[File:Data_transfer_diagram_simple.jpg|center|700px]]&lt;br /&gt;
&amp;lt;p style=&amp;quot;text-align: center; font-size: small; margin-top: 10px&amp;quot;&amp;gt;Figure 1: SDS@hd main transfer routes&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p style=&amp;quot;text-align: center; font-size: small; margin-top: 10px&amp;quot;&amp;gt;*Institutions that allow SMB connections to SDS@hd are for example: Heidelberg University, Karlsruhe Institute of Technology (KIT), Hohenheim University, Freiburg University, Hochschule Rottenburg, Hochschule Biberach. Currently, SMB connections are not possible from Mannheim University.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|- style=&amp;quot;font-weight:bold; text-align:center; vertical-align:middle;&amp;quot;&lt;br /&gt;
! &lt;br /&gt;
! Use Case&lt;br /&gt;
! Windows&lt;br /&gt;
! Mac&lt;br /&gt;
! Linux&lt;br /&gt;
! Possible Bandwith&lt;br /&gt;
! Firewall Ports&lt;br /&gt;
|-&lt;br /&gt;
| [[Data_Transfer/Rclone|Rclone]] + &amp;lt;protocol&amp;gt;&lt;br /&gt;
| copy, sync and mount, multithreading, checksumming for verifying success of up-/download&lt;br /&gt;
| ✓&lt;br /&gt;
| ✓&lt;br /&gt;
| ✓&lt;br /&gt;
| depends on used protocol&lt;br /&gt;
| depends on used protocol&lt;br /&gt;
|-&lt;br /&gt;
| [[SDS@hd/Access/SMB|SMB]]&lt;br /&gt;
| mount as network drive in file explorer or usage via Rclone&lt;br /&gt;
| [[SDS@hd/Access/SMB#Windows|✓]]&lt;br /&gt;
| [[SDS@hd/Access/SMB#Mac|✓]]&lt;br /&gt;
| [[SDS@hd/Access/SMB#Linux|✓]]&lt;br /&gt;
| up to 40 Gbit/sec&lt;br /&gt;
| 139 (netbios), 135 (rpc), 445 (smb)&lt;br /&gt;
|-&lt;br /&gt;
| [[Data_Transfer/WebDAV|WebDAV]]&lt;br /&gt;
| go to solution for restricted networks&lt;br /&gt;
| [✓]&lt;br /&gt;
| ✓&lt;br /&gt;
| ✓&lt;br /&gt;
| up to 100GBit/sec&lt;br /&gt;
| 80 (http), 443 (https)&lt;br /&gt;
|- style=&amp;quot;vertical-align:middle;&amp;quot;&lt;br /&gt;
| [[Data_Transfer/Graphical_Clients#MobaXterm|MobaXterm]]&lt;br /&gt;
| Graphical User Interface (GUI)&lt;br /&gt;
| [[Data_Transfer/Graphical_Clients#MobaXterm|✓]]&lt;br /&gt;
| ☓&lt;br /&gt;
| ☓&lt;br /&gt;
| see sftp&lt;br /&gt;
| see sftp&lt;br /&gt;
|- style=&amp;quot;vertical-align:middle;&amp;quot;&lt;br /&gt;
| [[SDS@hd/Access/NFS|NFS]]&lt;br /&gt;
| mount for multi-user environments&lt;br /&gt;
| ☓&lt;br /&gt;
| ☓&lt;br /&gt;
| [[SDS@hd/Access/NFS|✓]]&lt;br /&gt;
| up to 40 Gbit/sec&lt;br /&gt;
| -&lt;br /&gt;
|- style=&amp;quot;vertical-align:middle;&amp;quot;&lt;br /&gt;
| [[Data_Transfer/SSHFS|SSHFS]]&lt;br /&gt;
| mount, needs stable internet connection&lt;br /&gt;
| ☓&lt;br /&gt;
| [[Data_Transfer/SSHFS#MacOS_&amp;amp;_Linux|✓]]&lt;br /&gt;
| [[Data_Transfer/SSHFS#MacOS_&amp;amp;_Linux|✓]]&lt;br /&gt;
| see sftp&lt;br /&gt;
| see sftp&lt;br /&gt;
|- style=&amp;quot;vertical-align:middle;&amp;quot;&lt;br /&gt;
| [[Data_Transfer/SFTP|SFTP]]&lt;br /&gt;
| interactive shell, better usability when used together with Rclone&lt;br /&gt;
| [[Data_Transfer/SFTP#Windows|✓]]&lt;br /&gt;
| [[Data_Transfer/SFTP#MacOS_&amp;amp;_Linux|✓]]&lt;br /&gt;
| [[Data_Transfer/SFTP#MacOS_&amp;amp;_Linux|✓]]&lt;br /&gt;
| up to 40 Gbit/sec&lt;br /&gt;
| 22 (ssh)&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;p style=&amp;quot;text-align: left; font-size: small; margin-top: 10px&amp;quot;&amp;gt;Table 1: SDS@hd transfer routes&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Access from a bwHPC Cluster ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bwUniCluster&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can&#039;t mount to your $HOME directory but you can create a mount under $TMPDIR by following the instructions for [[Data_Transfer/Rclone#Usage_Rclone_Mount | Rclone mount]]. It is advised to wait a couple of seconds (&amp;lt;code&amp;gt;sleep 5&amp;lt;/code&amp;gt;) before trying to use the mounted directory. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bwForCluster Helix&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can directly access your storage space under &#039;&#039;/mnt/sds-hd/&#039;&#039; on all login and compute nodes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;bwForCluster BinAC 2&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can directly access your storage space under &#039;&#039;/mnt/sds-hd/&#039;&#039; on all login and compute nodes. The prerequisites are: &lt;br /&gt;
* The SV responsible has enabled the SV on BinAC 2 once by writing to [mailto:sds-hd-support@urz.uni-heidelberg.de sds-hd-support@urz.uni-heidelberg.de]&lt;br /&gt;
* You have a valid kerberos ticket, which can be fetched with &amp;lt;code&amp;gt;kinit &amp;lt;userID&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Other&#039;&#039;&#039;&amp;lt;br /&amp;gt;&lt;br /&gt;
You can mount your SDS@hd SV on the cluster yourself by using [[Data_Transfer/Rclone | Rclone]] with the [[Data_Transfer/Rclone#Usage_Rclone_Mount | Rclone mount]] command. As transfer protocol you can use WebDAV or sftp. For a full overview please have a look at [[Data_Transfer/All_Data_Transfer_Routes | All Data Transfer Routes]].&lt;br /&gt;
&lt;br /&gt;
=== Access via Webbrowser (read-only) ===&lt;br /&gt;
&lt;br /&gt;
Visit [https://lsdf02-webdav.urz.uni-heidelberg.de/ lsdf02-webdav.urz.uni-heidelberg.de] and login with your SDS@hd username and service password. Here you can get an overview of the data in your &amp;amp;quot;Speichervorhaben&amp;amp;quot; and download single files. To be able to do more, like moving data, uploading new files, or downloading complete folders, a suitable client is needed as described above.&lt;br /&gt;
&lt;br /&gt;
== Best Practices ==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Managing access rights&#039;&#039;&#039;&lt;br /&gt;
** When the SV is mounted on Windows, access rights can be adjusted in the file/folder properties menu. (Users from Heidelberg without Windows can use the [https://www.urz.uni-heidelberg.de/de/service-katalog/desktop-und-arbeitsplatz/windows-terminalserver Windows terminal server]). &lt;br /&gt;
** bwForCluster Helix users can change the access rights via Helix by using [[Workspace#Regular_Unix_Permissions | unix permissions]] or [[Workspace#ACLs:_Access_Control_Lists | access control lists]]. On non native mounts ACL changes won&#039;t work. &lt;br /&gt;
** Additionally to the already mentioned options, the SVV can take over ownership of files by opening a [[Data_Transfer/SFTP|SFTP]] shell and running &amp;lt;code&amp;gt;chown -R &amp;lt;userID&amp;gt; &amp;lt;path/to/folder&amp;gt;&amp;lt;/code&amp;gt; . &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Multiuser environment&#039;&#039;&#039; &amp;lt;br /&amp;gt; &amp;amp;rarr; Use [[SDS@hd/Access/NFS|NFS]]&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
Maintance windows and known issues are communicated via the email list or the News section at the SDS@hd start page in the wiki. &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Issue:&#039;&#039;&#039; The credentials aren&#039;t accepted &lt;br /&gt;
*: Check if your credentials work in general by trying the access via webbrowser: [https://lsdf02-webdav.urz.uni-heidelberg.de/].&lt;br /&gt;
*: If this doesn&#039;t work: &lt;br /&gt;
*:: &amp;amp;rarr; [[Registration/Login/Username| Check your Username]]&lt;br /&gt;
*:: &amp;amp;rarr; [[Registration/bwForCluster/Helix#Troubleshooting_with_the_Help_of_bwServices | Troubleshooting with bwServices]]&lt;br /&gt;
* &#039;&#039;&#039;Other Issue&#039;&#039;&#039;&lt;br /&gt;
** If available, follow the troubleshooting guide of your specific connection method.&lt;br /&gt;
** Make sure to not use LAN and WLAN at the same time to prevent connection problems.&lt;br /&gt;
** If you have an institutional account, make sure to be a fully active member of your institution.&lt;br /&gt;
If these suggestions didn&#039;t help, write to the [mailto:sds-hd-support@urz.uni-heidelberg.de support]. Provide the following information: &lt;br /&gt;
* Your operating system&lt;br /&gt;
* Does the access via webbrowser work? &lt;br /&gt;
*: If yes, provide us with detailed information on how you tried to access your SV (used access method, username, ...).&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=Helix/bwVisu/JupyterLab&amp;diff=16272</id>
		<title>Helix/bwVisu/JupyterLab</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=Helix/bwVisu/JupyterLab&amp;diff=16272"/>
		<updated>2026-08-18T08:41:23Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: icons looks different now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://jupyter.org/ JupyterLab] is an integrated development environment (IDE) that provides a flexible and scalable interface for the Jupyter Notebook system. It supports interactive data science and scientific computing across over 40 programming languages (including Python, Julia, and R).&lt;br /&gt;
&lt;br /&gt;
== Change Python Version ==&lt;br /&gt;
&lt;br /&gt;
The default python version can be seen by running &amp;lt;code&amp;gt;python --version&amp;lt;/code&amp;gt; in the terminal. &lt;br /&gt;
&lt;br /&gt;
A different python version can be installed into a new virtual environment and then registered as IPython kernel for the usage in JupyterLab. This is explained in the chapter [[#Add_packages_via_conda_environments | add packages via conda environments]].&lt;br /&gt;
&lt;br /&gt;
== Install Python Packages ==&lt;br /&gt;
&lt;br /&gt;
Python packages can be added by installing them into a virtual environment and then creating an IPython kernel from the virtual environment. &amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;Kernels can be shared&amp;lt;/u&amp;gt;. See the notes below. &amp;lt;/br&amp;gt;&lt;br /&gt;
If you want to move a virtual environment, it is adivsed to recreate it in the new place. Otherwise, dependencies based on relative paths will break. &lt;br /&gt;
&lt;br /&gt;
# Create a virtual environment with...&lt;br /&gt;
#* [[#Add_packages_via_venv_virtual_environments | ...venv]] or&lt;br /&gt;
#* [[#Add_packages_via_Conda_virtual_environments | ...conda]] (choose this option if you want to install a different python version) or &lt;br /&gt;
#* ...[https://docs.astral.sh/uv/getting-started/ uv] if you want to install a different python version but don&#039;t want to use conda. &lt;br /&gt;
# [[#Create_an_IPython_Kernel | Create an IPython kernel]] from the virtual environment&lt;br /&gt;
# Use the kernel within JupyterLab&lt;br /&gt;
#* By default new kernels are saved under &amp;lt;code&amp;gt;~/.local/share/jupyter&amp;lt;/code&amp;gt; and this location is automatically detected. Therefore, new kernels are directly available. &lt;br /&gt;
#*:[[File:BwVisu JuypterLab KernelPath.png|In the JupyterLab job configuration form, a custom kernel path can be provided.|right|thumb|x150px]]&lt;br /&gt;
#* If the kernel is saved somewhere else, the path can be provided in the &amp;quot;Kernel path&amp;quot; field when configuring the JupyterLab job (see image). For a kernel placed under &amp;lt;code&amp;gt;path_to_parent_dir/share/jupyter/kernels/my_kernel&amp;lt;/code&amp;gt; the needed &amp;quot;Kernel path&amp;quot; would be &amp;lt;code&amp;gt;path_to_parent_dir/share/jupyter&amp;lt;/code&amp;gt;. &lt;br /&gt;
# When the kernel is used the first time, the file &amp;lt;code&amp;gt;notebook_secrets&amp;lt;/code&amp;gt; is created automatically. It can be found under &amp;quot;Kernel path&amp;quot;. For others to use the kernel, they must have read access to this file. The command &amp;lt;code&amp;gt;chmod 750 notebook_secrets&amp;lt;/code&amp;gt; would for example allow the whole SDS@hd SV read access. For the access management in workspaces, please see [[Workspace#Setting_Permissions_for_Sharing_Files| Workspace Permissions]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Notes regarding the sharing of IPython kernels&amp;lt;/u&amp;gt;&lt;br /&gt;
* The virtual environment and the kernel need to be placed in a shared directory. For example at SDS@hd.&lt;br /&gt;
* There could be a subdirectory for the virtual environments and one for the kernels. &lt;br /&gt;
* The path to the kernels is saved in the environment variable $JUPYTER_DATA_DIR. Jupyter relevant paths can be seen with &amp;lt;code&amp;gt;jupyter --paths&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add packages via &#039;&#039;venv&#039;&#039; virtual environments ===&lt;br /&gt;
More information about venv or other python virtual environments can be found at the [[Development/Python | Python]] page. &lt;br /&gt;
&lt;br /&gt;
Steps for creating a &#039;&#039;&#039;venv&#039;&#039;&#039; virtual environment:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new virtual evironment: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;python3 -m venv &amp;lt;env_parent_dir&amp;gt;/&amp;lt;env_name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;env_parent_dir&amp;lt;/code&amp;gt; is the path to the folder where the virtual environment shall be created. Relative paths can be used.&lt;br /&gt;
* Caution: If you you want to share the environment with others, make sure to already create it in the shared place. &lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Activate the environment:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;source &amp;lt;env_parent_dir&amp;gt;/&amp;lt;env_name&amp;gt;/bin/activate&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Update pip and install packages:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;pip install -U pip --no-user&lt;br /&gt;
# when the environment is installed in home&lt;br /&gt;
pip install &amp;lt;packagename&amp;gt;&lt;br /&gt;
# when the environment is installed somewhere else and shall not have dependencies in home so that others can access it as well&lt;br /&gt;
pip install &amp;lt;packagename&amp;gt; --no-user&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [[#Create_an_IPython_Kernel | Create an IPython kernel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add packages via Conda virtual environments ===&lt;br /&gt;
More information about using conda can be found at the [[Development/Conda | Conda]] page. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Load the miniforge module by clicking first on the double hexagon icon on the left-hand side of Jupyter&#039;s start page and then on the &amp;amp;quot;load&amp;amp;quot; button right of the entry for miniforge in the software module menu. &lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new virtual environment: &lt;br /&gt;
* If you are the only person using the environment, you can install it in your home directory:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda create --name &amp;lt;env_name&amp;gt; python=&amp;lt;python version&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* If you want to install it into a different directory, for example a shared place:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda create --prefix &amp;lt;path_to_shared_directory&amp;gt;/&amp;lt;env_name&amp;gt; python=&amp;lt;python version&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Activate your environment:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda activate &amp;lt;myenv&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install your packages:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda install &amp;lt;mypackage&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [[#Create_an_IPython_Kernel | Create an IPython kernel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create an IPython Kernel ==&lt;br /&gt;
&lt;br /&gt;
Python kernels are implementations of the Jupyter notebook environment for different languages or virtual environments. You can switch between kernels easily, allowing you to use the best tool for a specific task.&lt;br /&gt;
conda_kernels&lt;br /&gt;
&lt;br /&gt;
=== Create a kernel from a virtual environment ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Activate the virtual environment.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install the ipykernel package:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;pip install ipykernel&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Register the virtual environment as custom kernel to Jupyter. &lt;br /&gt;
* If you are the only person using the environment:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;python3 -m ipykernel install --user --name=&amp;lt;kernel_name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The kernel can be found under &amp;lt;code&amp;gt;~/.local/share/jupyter/kernels/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* If you installed the environment in a shared place and want to have the kernel there as well: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;python3 -m ipykernel install --prefix &amp;lt;path_to_kernel_folder&amp;gt; --name=&amp;lt;kernel_name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The kernel can then be found under &amp;lt;code&amp;gt;path_to_kernel_folder/share/jupyter/kernels/&amp;lt;kernel_name&amp;gt;&amp;lt;/code&amp;gt;. As long as the same &amp;lt;code&amp;gt;path_to_kernel_folder&amp;lt;/code&amp;gt; is used, all kernels will be saved next to each other in &amp;quot;kernels&amp;quot;. &lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Multi-Language Support ===&lt;br /&gt;
&lt;br /&gt;
JupyterLab supports over 40 programming languages including Python, R, Julia, and Scala. This is achieved through the use of different kernels.&lt;br /&gt;
&lt;br /&gt;
==== R Kernel ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;On the cluster:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ module load math/R&lt;br /&gt;
$ R&lt;br /&gt;
&amp;amp;gt; install.packages(&#039;IRkernel&#039;)&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;On bwVisu:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start Jupyter App&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In left menu: load math/R&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open Console:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ R&lt;br /&gt;
&amp;amp;gt; IRkernel::installspec(displayname = &#039;R 4.2&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Start kernel &#039;R 4.2&#039; as console or notebook&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Julia Kernel ====&lt;br /&gt;
&lt;br /&gt;
Load the math/julia module. Open the Terminal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
julia&lt;br /&gt;
]&lt;br /&gt;
add IJulia&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that, Julia is available as a kernel.&lt;br /&gt;
&lt;br /&gt;
== Interactive Widgets ==&lt;br /&gt;
&lt;br /&gt;
JupyterLab supports interactive widgets that can create UI controls for interactive data visualization and manipulation within the notebooks. Example of using an interactive widget:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;{.python&amp;quot;&amp;gt;from ipywidgets import IntSlider&lt;br /&gt;
slider = IntSlider()&lt;br /&gt;
display(slider)&amp;lt;/pre&amp;gt;&lt;br /&gt;
These widgets can be sliders, dropdowns, buttons, etc., which can be connected to Python code running in the backend.&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;&#039;&#039;&#039;How can I use bwForCluster Helix software modules?&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
First click on the double hexagon icon on the left-hand side of Jupyter&#039;s start page. Then load a module by clicking on the &amp;quot;load&amp;quot; button next to the corresponding module entry.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;My virtual environment works on Helix but not in the bwVisu JupyterLab job.&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
If the environment uses Helix modules, you have to load the modules in the bwVisu job first. For example, when you used the python 3.13 module for creating the environment, the path to this python version is saved in the environment. When the module is not loadedin bwVisu, the path is not available and you might get an error like &amp;quot;&#039;&#039;[...]/bin/python: error while loading shared libraries: libpython3.13.so.1.0: cannot open shared object file: No such file or directory&#039;&#039;&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;How can I navigate to my SDS@hd folder in the file browser?&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
Please see the instructions at the [[Helix/bwVisu/Usage#Files | Usage]] page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;I prefer VSCode over JupyterLab. Can I start a JupyterLab job and then connect with it via VSCode?&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
This is not possible. Please start the job directly on Helix instead. You can find the instructions at the [[Development/VS_Code#Connect_to_Remote_Jupyter_Kernel | VSCode page]].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;My conda commands are interrupted with message &#039;Killed&#039;.&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
Request more memory when starting Jupyter.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Jupyterlab doesn&#039;t let me in but asks for a password.&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
Try using more memory for the job. If this doesn&#039;t help, try using the inkognito mode of your browser as the browser cache might be the problem.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=Helix/bwVisu/JupyterLab&amp;diff=16271</id>
		<title>Helix/bwVisu/JupyterLab</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=Helix/bwVisu/JupyterLab&amp;diff=16271"/>
		<updated>2026-08-18T08:34:05Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: Typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://jupyter.org/ JupyterLab] is an integrated development environment (IDE) that provides a flexible and scalable interface for the Jupyter Notebook system. It supports interactive data science and scientific computing across over 40 programming languages (including Python, Julia, and R).&lt;br /&gt;
&lt;br /&gt;
== Change Python Version ==&lt;br /&gt;
&lt;br /&gt;
The default python version can be seen by running &amp;lt;code&amp;gt;python --version&amp;lt;/code&amp;gt; in the terminal. &lt;br /&gt;
&lt;br /&gt;
A different python version can be installed into a new virtual environment and then registered as IPython kernel for the usage in JupyterLab. This is explained in the chapter [[#Add_packages_via_conda_environments | add packages via conda environments]].&lt;br /&gt;
&lt;br /&gt;
== Install Python Packages ==&lt;br /&gt;
&lt;br /&gt;
Python packages can be added by installing them into a virtual environment and then creating an IPython kernel from the virtual environment. &amp;lt;/br&amp;gt;&lt;br /&gt;
&amp;lt;u&amp;gt;Kernels can be shared&amp;lt;/u&amp;gt;. See the notes below. &amp;lt;/br&amp;gt;&lt;br /&gt;
If you want to move a virtual environment, it is adivsed to recreate it in the new place. Otherwise, dependencies based on relative paths will break. &lt;br /&gt;
&lt;br /&gt;
# Create a virtual environment with...&lt;br /&gt;
#* [[#Add_packages_via_venv_virtual_environments | ...venv]] or&lt;br /&gt;
#* [[#Add_packages_via_Conda_virtual_environments | ...conda]] (choose this option if you want to install a different python version) or &lt;br /&gt;
#* ...[https://docs.astral.sh/uv/getting-started/ uv] if you want to install a different python version but don&#039;t want to use conda. &lt;br /&gt;
# [[#Create_an_IPython_Kernel | Create an IPython kernel]] from the virtual environment&lt;br /&gt;
# Use the kernel within JupyterLab&lt;br /&gt;
#* By default new kernels are saved under &amp;lt;code&amp;gt;~/.local/share/jupyter&amp;lt;/code&amp;gt; and this location is automatically detected. Therefore, new kernels are directly available. &lt;br /&gt;
#*:[[File:BwVisu JuypterLab KernelPath.png|In the JupyterLab job configuration form, a custom kernel path can be provided.|right|thumb|x150px]]&lt;br /&gt;
#* If the kernel is saved somewhere else, the path can be provided in the &amp;quot;Kernel path&amp;quot; field when configuring the JupyterLab job (see image). For a kernel placed under &amp;lt;code&amp;gt;path_to_parent_dir/share/jupyter/kernels/my_kernel&amp;lt;/code&amp;gt; the needed &amp;quot;Kernel path&amp;quot; would be &amp;lt;code&amp;gt;path_to_parent_dir/share/jupyter&amp;lt;/code&amp;gt;. &lt;br /&gt;
# When the kernel is used the first time, the file &amp;lt;code&amp;gt;notebook_secrets&amp;lt;/code&amp;gt; is created automatically. It can be found under &amp;quot;Kernel path&amp;quot;. For others to use the kernel, they must have read access to this file. The command &amp;lt;code&amp;gt;chmod 750 notebook_secrets&amp;lt;/code&amp;gt; would for example allow the whole SDS@hd SV read access. For the access management in workspaces, please see [[Workspace#Setting_Permissions_for_Sharing_Files| Workspace Permissions]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Notes regarding the sharing of IPython kernels&amp;lt;/u&amp;gt;&lt;br /&gt;
* The virtual environment and the kernel need to be placed in a shared directory. For example at SDS@hd.&lt;br /&gt;
* There could be a subdirectory for the virtual environments and one for the kernels. &lt;br /&gt;
* The path to the kernels is saved in the environment variable $JUPYTER_DATA_DIR. Jupyter relevant paths can be seen with &amp;lt;code&amp;gt;jupyter --paths&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add packages via &#039;&#039;venv&#039;&#039; virtual environments ===&lt;br /&gt;
More information about venv or other python virtual environments can be found at the [[Development/Python | Python]] page. &lt;br /&gt;
&lt;br /&gt;
Steps for creating a &#039;&#039;&#039;venv&#039;&#039;&#039; virtual environment:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new virtual evironment: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;python3 -m venv &amp;lt;env_parent_dir&amp;gt;/&amp;lt;env_name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;env_parent_dir&amp;lt;/code&amp;gt; is the path to the folder where the virtual environment shall be created. Relative paths can be used.&lt;br /&gt;
* Caution: If you you want to share the environment with others, make sure to already create it in the shared place. &lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Activate the environment:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;source &amp;lt;env_parent_dir&amp;gt;/&amp;lt;env_name&amp;gt;/bin/activate&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Update pip and install packages:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;pip install -U pip --no-user&lt;br /&gt;
# when the environment is installed in home&lt;br /&gt;
pip install &amp;lt;packagename&amp;gt;&lt;br /&gt;
# when the environment is installed somewhere else and shall not have dependencies in home so that others can access it as well&lt;br /&gt;
pip install &amp;lt;packagename&amp;gt; --no-user&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [[#Create_an_IPython_Kernel | Create an IPython kernel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Add packages via Conda virtual environments ===&lt;br /&gt;
More information about using conda can be found at the [[Development/Conda | Conda]] page. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Load the miniforge module by clicking first on the blue hexagon icon on the left-hand side of Jupyter&#039;s start page and then on the &amp;amp;quot;load&amp;amp;quot; button right of the entry for miniforge in the software module menu. &lt;br /&gt;
&amp;lt;li&amp;gt;Open a terminal.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Create a new virtual environment: &lt;br /&gt;
* If you are the only person using the environment, you can install it in your home directory:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda create --name &amp;lt;env_name&amp;gt; python=&amp;lt;python version&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* If you want to install it into a different directory, for example a shared place:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda create --prefix &amp;lt;path_to_shared_directory&amp;gt;/&amp;lt;env_name&amp;gt; python=&amp;lt;python version&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Activate your environment:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda activate &amp;lt;myenv&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install your packages:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;conda install &amp;lt;mypackage&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt; [[#Create_an_IPython_Kernel | Create an IPython kernel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Create an IPython Kernel ==&lt;br /&gt;
&lt;br /&gt;
Python kernels are implementations of the Jupyter notebook environment for different languages or virtual environments. You can switch between kernels easily, allowing you to use the best tool for a specific task.&lt;br /&gt;
conda_kernels&lt;br /&gt;
&lt;br /&gt;
=== Create a kernel from a virtual environment ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Activate the virtual environment.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install the ipykernel package:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;pip install ipykernel&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Register the virtual environment as custom kernel to Jupyter. &lt;br /&gt;
* If you are the only person using the environment:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;python3 -m ipykernel install --user --name=&amp;lt;kernel_name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The kernel can be found under &amp;lt;code&amp;gt;~/.local/share/jupyter/kernels/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* If you installed the environment in a shared place and want to have the kernel there as well: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;python3 -m ipykernel install --prefix &amp;lt;path_to_kernel_folder&amp;gt; --name=&amp;lt;kernel_name&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The kernel can then be found under &amp;lt;code&amp;gt;path_to_kernel_folder/share/jupyter/kernels/&amp;lt;kernel_name&amp;gt;&amp;lt;/code&amp;gt;. As long as the same &amp;lt;code&amp;gt;path_to_kernel_folder&amp;lt;/code&amp;gt; is used, all kernels will be saved next to each other in &amp;quot;kernels&amp;quot;. &lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Multi-Language Support ===&lt;br /&gt;
&lt;br /&gt;
JupyterLab supports over 40 programming languages including Python, R, Julia, and Scala. This is achieved through the use of different kernels.&lt;br /&gt;
&lt;br /&gt;
==== R Kernel ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;On the cluster:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ module load math/R&lt;br /&gt;
$ R&lt;br /&gt;
&amp;amp;gt; install.packages(&#039;IRkernel&#039;)&amp;lt;/pre&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;On bwVisu:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;list-style-type: decimal;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start Jupyter App&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;In left menu: load math/R&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open Console:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$ R&lt;br /&gt;
&amp;amp;gt; IRkernel::installspec(displayname = &#039;R 4.2&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Start kernel &#039;R 4.2&#039; as console or notebook&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Julia Kernel ====&lt;br /&gt;
&lt;br /&gt;
Load the math/julia module. Open the Terminal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
julia&lt;br /&gt;
]&lt;br /&gt;
add IJulia&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After that, Julia is available as a kernel.&lt;br /&gt;
&lt;br /&gt;
== Interactive Widgets ==&lt;br /&gt;
&lt;br /&gt;
JupyterLab supports interactive widgets that can create UI controls for interactive data visualization and manipulation within the notebooks. Example of using an interactive widget:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;{.python&amp;quot;&amp;gt;from ipywidgets import IntSlider&lt;br /&gt;
slider = IntSlider()&lt;br /&gt;
display(slider)&amp;lt;/pre&amp;gt;&lt;br /&gt;
These widgets can be sliders, dropdowns, buttons, etc., which can be connected to Python code running in the backend.&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;&#039;&#039;&#039;How can I use bwForCluster Helix software modules?&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
First click on the blue hexagon icon on the left-hand side of Jupyter&#039;s start page. Then load a module by clicking on the &amp;quot;load&amp;quot; button next to the corresponding module entry.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;My virtual environment works on Helix but not in the bwVisu JupyterLab job.&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
If the environment uses Helix modules, you have to load the modules in the bwVisu job first. For example, when you used the python 3.13 module for creating the environment, the path to this python version is saved in the environment. When the module is not loadedin bwVisu, the path is not available and you might get an error like &amp;quot;&#039;&#039;[...]/bin/python: error while loading shared libraries: libpython3.13.so.1.0: cannot open shared object file: No such file or directory&#039;&#039;&amp;quot;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;How can I navigate to my SDS@hd folder in the file browser?&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
Please see the instructions at the [[Helix/bwVisu/Usage#Files | Usage]] page.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;I prefer VSCode over JupyterLab. Can I start a JupyterLab job and then connect with it via VSCode?&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
This is not possible. Please start the job directly on Helix instead. You can find the instructions at the [[Development/VS_Code#Connect_to_Remote_Jupyter_Kernel | VSCode page]].&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;My conda commands are interrupted with message &#039;Killed&#039;.&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
Request more memory when starting Jupyter.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&#039;&#039;&#039;Jupyterlab doesn&#039;t let me in but asks for a password.&#039;&#039;&#039;&amp;lt;/br&amp;gt;&lt;br /&gt;
Try using more memory for the job. If this doesn&#039;t help, try using the inkognito mode of your browser as the browser cache might be the problem.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=Helix/Software/Matlab&amp;diff=16240</id>
		<title>Helix/Software/Matlab</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=Helix/Software/Matlab&amp;diff=16240"/>
		<updated>2026-08-03T10:03:51Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: /* Compile MATLAB binaries with mcc */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;border: 2px solid #d33; background-color: #fee7e6; padding: 10px; margin-bottom: 1em; width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;⚠ MATLAB modules have been removed on March 31, 2026.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The MathWorks state license (Landeslizenz) has expired on March 31, 2026 and will not be renewed. The MATLAB modules &amp;lt;code&amp;gt;math/matlab&amp;lt;/code&amp;gt; are no longer be available on Helix.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Alternatives:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;GNU Octave&#039;&#039;&#039; (&amp;lt;code&amp;gt;module load math/octave&amp;lt;/code&amp;gt;): MATLAB scripts that do not use special features of toolboxes may run with Octave without or with minor changes.&lt;br /&gt;
* &#039;&#039;&#039;Matlab Compiler / Matlab Runtime&#039;&#039;&#039;: Use the [https://de.mathworks.com/products/compiler.html MATLAB Compiler] to build stand-alone binaries on your local computer (with your own license) and run them with the MATLAB Runtime on the cluster — no license required at runtime (see section &amp;quot;Compile MATLAB binaries with mcc&amp;quot; below).&lt;br /&gt;
* &#039;&#039;&#039;Institute license&#039;&#039;&#039;: If your institute has its own MathWorks network license, it may be possible to use it from the cluster. This must be checked on a case-by-case basis — please [https://www.bwhpc.de/supportportal.php submit a ticket].&lt;br /&gt;
* Other alternatives: &amp;lt;code&amp;gt;math/julia&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;math/R&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;devel/python&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Softwarepage|math/matlab}}&lt;br /&gt;
&lt;br /&gt;
{| width=600px class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Description !! Content&lt;br /&gt;
|-&lt;br /&gt;
| module load&lt;br /&gt;
| math/matlab&lt;br /&gt;
|-&lt;br /&gt;
| License&lt;br /&gt;
| [https://de.mathworks.com/pricing-licensing/index.html?intendeduse=edu&amp;amp;prodcode=ML Academic License/Commercial]&lt;br /&gt;
|-&lt;br /&gt;
| Citing&lt;br /&gt;
| n/a&lt;br /&gt;
|-&lt;br /&gt;
| Links&lt;br /&gt;
| [https://de.mathworks.com/products/matlab/ MATLAB Homepage] &amp;amp;#124; [https://de.mathworks.com/index.html?s_tid=gn_logo MathWorks Homepage] &amp;amp;#124; [https://de.mathworks.com/support/?s_tid=gn_supp Support and more]&lt;br /&gt;
|-&lt;br /&gt;
| Graphical Interface&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;MATLAB&#039;&#039;&#039; (MATrix LABoratory) is a high-level programming language and interactive computing environment for numerical calculation and data visualization.&lt;br /&gt;
&lt;br /&gt;
= Loading MATLAB =&lt;br /&gt;
&lt;br /&gt;
The preferable way is to run the MATLAB command line interface without GUI:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab -nodisplay&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interactive MATLAB session with graphical user interface (GUI) can be started with the command (requires X11 forwarding enabled for your ssh login):&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: Do not start a long-duration interactive MATLAB session on a login node of the cluster. Submit an [[Helix/Slurm#Interactive_Jobs | interactive job]] and start MATLAB from within the dedicated compute node assigned to you by the queueing system.&lt;br /&gt;
&lt;br /&gt;
The following generic command will execute a MATLAB script or function named &amp;quot;example&amp;quot;:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ matlab -nodisplay -batch example &amp;gt; result.out 2&amp;gt;&amp;amp;1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output of this session will be redirected to the file result.out. The option &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;-batch&amp;lt;/syntaxhighlight&amp;gt; executes the MATLAB statement non-interactively.&lt;br /&gt;
&lt;br /&gt;
= Parallel Computing Using MATLAB =&lt;br /&gt;
&lt;br /&gt;
Parallelization of MATLAB jobs is realized via the built-in multi-threading provided by MATLAB&#039;s BLAS and FFT implementation and the parallel computing functionality of MATLAB&#039;s Parallel Computing Toolbox (PCT).&lt;br /&gt;
&lt;br /&gt;
== Implicit Threading ==&lt;br /&gt;
&lt;br /&gt;
A large number of built-in MATLAB functions may utilize multiple cores automatically without any code modifications required. This is referred to as implicit multi-threading and must be strictly distinguished from explicit parallelism provided by the Parallel Computing Toolbox (PCT) which requires specific commands in your code in order to create threads.&lt;br /&gt;
&lt;br /&gt;
Implicit threading particularly takes place for linear algebra operations (such as the solution to a linear system A\b or matrix products A*B) and FFT operations. Many other high-level MATLAB functions do also benefit from multi-threading capabilities of their underlying routines. If multi-threading is not desired, single-threading can be enforced by adding the command line option &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;-singleCompThread&amp;lt;/syntaxhighlight&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Whenever implicit threading takes place, MATLAB will detect the total number of cores that exist on a machine and by default makes use of all of them. This has very important implications for MATLAB jobs in HPC environments with shared-node job scheduling policy (i.e. with multiple users sharing one compute node). Due to this behaviour, a MATLAB job may take over more compute resources than assigned by the queueing system of the cluster (and thereby taking away these resources from all other users with running jobs on the same node - including your own jobs).&lt;br /&gt;
&lt;br /&gt;
Therefore, when running in multi-threaded mode, MATLAB always requires the user&#039;s intervention to not allocate all cores of the machine (unless requested so from the queueing system). The number of threads must be controlled from within the code by means of the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;maxNumCompThreads(N)&amp;lt;/syntaxhighlight&amp;gt; function or, alternatively, with the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;feature(&#039;numThreads&#039;, N)&amp;lt;/syntaxhighlight&amp;gt; function (which is undocumented).&lt;br /&gt;
&lt;br /&gt;
== Using the Parallel Computing Toolbox (PCT) ==&lt;br /&gt;
&lt;br /&gt;
By using the PCT one can make explicit use of several cores on multicore processors to parallelize MATLAB applications without MPI programming. Under MATLAB version 8.4 and earlier, this toolbox provides 12 workers (MATLAB computational engines) to execute applications locally on a single multicore node. Under MATLAB version 8.5 and later, the number of workers available is equal to the number of cores on a single node (up to a maximum of 512).&lt;br /&gt;
&lt;br /&gt;
If multiple PCT jobs are running at the same time, they all write temporary MATLAB job information to the same location. This race condition can cause one or more of the parallel MATLAB jobs fail to use the parallel functionality of the toolbox.&lt;br /&gt;
&lt;br /&gt;
To solve this issue, each MATLAB job should explicitly set a unique location where these files are created. This can be accomplished by the following snippet of code added to your MATLAB script.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% create a local cluster object&lt;br /&gt;
pc = parcluster(&#039;local&#039;)&lt;br /&gt;
&lt;br /&gt;
% get the number of dedicated cores from environment&lt;br /&gt;
nprocs = str2num(getenv(&#039;SLURM_NPROCS&#039;))&lt;br /&gt;
&lt;br /&gt;
% you may explicitly set the JobStorageLocation to the tmp directory that is unique to each cluster job (and is on local, fast scratch)&lt;br /&gt;
parpool_tmpdir = [getenv(&#039;TMP&#039;),&#039;/.matlab/local_cluster_jobs/slurm_jobID_&#039;,getenv(&#039;SLURM_JOB_ID&#039;)]&lt;br /&gt;
mkdir(parpool_tmpdir)&lt;br /&gt;
pc.JobStorageLocation = parpool_tmpdir&lt;br /&gt;
&lt;br /&gt;
% start the parallel pool&lt;br /&gt;
parpool(pc, nprocs)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If a large number of MATLAB-jobs are run in parallel, they can also conflict when writing generic information to &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;~/.matlab&amp;lt;/syntaxhighlight&amp;gt;. This can be circumvented by setting &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;$MATLAB_PREFDIR&amp;lt;/syntaxhighlight&amp;gt; to different directories in your Batch-script, e.g.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;export MATLAB_PREFDIR=$TMP&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Using a different implementation of BLAS/LAPACK ==&lt;br /&gt;
&lt;br /&gt;
By default, Matlab uses a version of Intel MKL as its BLAS/LAPACK library. It is possible to manually change this to different libraries by setting the &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;BLAS_VERSION&amp;lt;/syntaxhighlight&amp;gt; and &amp;lt;syntaxhighlight style=&amp;quot;border:0px&amp;quot; inline=1&amp;gt;LAPACK_VERSION&amp;lt;/syntaxhighlight&amp;gt; environment variables. The following lines can be added to the batch-script to change it, in this example to BLIS and Flame, which are optimized for AMD processors: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
module load numlib/aocl/3.2.0&lt;br /&gt;
&lt;br /&gt;
export BLAS_VERSION=$AOCL_LIB_DIR/libblis-mt.so&lt;br /&gt;
export LAPACK_VERSION=$AOCL_LIB_DIR/libflame.so&lt;br /&gt;
&lt;br /&gt;
export BLIS_NUM_THREADS=$SLURM_NTASKS&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This can increase performance depending on the task, for example large matrix multiplications, but caution is advised.&lt;br /&gt;
&lt;br /&gt;
= General Performance Tips for MATLAB =&lt;br /&gt;
&lt;br /&gt;
MATLAB data structures (arrays or matrices) are dynamic in size, i.e. MATLAB will automatically resize the structure on demand. Although this seems to be convenient, MATLAB continually needs to allocate a new chunk of memory and copy over the data to the new block of memory as the array or matrix grows in a loop. This may take a significant amount of extra time during execution of the program.&lt;br /&gt;
&lt;br /&gt;
Code performance can often be drastically improved by pre-allocating memory for the final expected size of the array or matrix before actually starting the processing loop. In order to pre-allocate an array of strings, you can use MATLAB&#039;s build-in cell function. In order to pre-allocate an array or matrix of numbers, you can use MATLAB&#039;s build-in zeros function.&lt;br /&gt;
&lt;br /&gt;
The performance benefit of pre-allocation is illustrated with the following example code.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
% prealloc.m&lt;br /&gt;
&lt;br /&gt;
clear all;&lt;br /&gt;
&lt;br /&gt;
num=10000000;&lt;br /&gt;
&lt;br /&gt;
disp(&#039;Without pre-allocation:&#039;)&lt;br /&gt;
tic&lt;br /&gt;
for i=1:num&lt;br /&gt;
    a(i)=i;&lt;br /&gt;
end&lt;br /&gt;
toc&lt;br /&gt;
&lt;br /&gt;
disp(&#039;With pre-allocation:&#039;)&lt;br /&gt;
tic&lt;br /&gt;
b=zeros(1,num);&lt;br /&gt;
for i=1:num&lt;br /&gt;
    b(i)=i;&lt;br /&gt;
end&lt;br /&gt;
toc&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
On a compute node, the result may look like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Without pre-allocation:&lt;br /&gt;
Elapsed time is 2.879446 seconds.&lt;br /&gt;
With pre-allocation:&lt;br /&gt;
Elapsed time is 0.097557 seconds.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please recognize that the code runs almost 30 times faster with pre-allocation.&lt;br /&gt;
&lt;br /&gt;
== Compile MATLAB binaries with mcc ==&lt;br /&gt;
&lt;br /&gt;
If you have a MATLAB license that includes [https://de.mathworks.com/products/compiler.html MATLAB Compiler], e.g. on your local computer, you can use &amp;lt;code&amp;gt;mcc&amp;lt;/code&amp;gt; to create binaries from MATLAB code.&lt;br /&gt;
Stand-alone MATLAB programs compiled with &amp;lt;code&amp;gt;mcc&amp;lt;/code&amp;gt; do not require any license tokens at runtime and you can start jobs in parallel without any risk of running out of licences.&lt;br /&gt;
&lt;br /&gt;
=== Running compiled binaries with the MATLAB Runtime ===&lt;br /&gt;
&lt;br /&gt;
If you do not have access to a full MATLAB installation on Helix, you can still run compiled MATLAB applications using the MATLAB Runtime module:&lt;br /&gt;
&lt;br /&gt;
 module load math/matlab-runtime&lt;br /&gt;
 ./my_compiled_app&lt;br /&gt;
&lt;br /&gt;
The MATLAB Runtime requires no license. To use it:&lt;br /&gt;
&lt;br /&gt;
# Compile your MATLAB code on a machine where you have a MATLAB license (e.g., your local workstation via an institute license):&lt;br /&gt;
#: &amp;lt;code&amp;gt;mcc -m my_script.m&amp;lt;/code&amp;gt;&lt;br /&gt;
# Transfer the compiled binary to Helix.&lt;br /&gt;
# Load the matching Runtime module and run:&lt;br /&gt;
#: &amp;lt;code&amp;gt;module load math/matlab-runtime/R2025b&amp;lt;/code&amp;gt;&lt;br /&gt;
#: &amp;lt;code&amp;gt;./my_script&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important:&#039;&#039;&#039; The Runtime version must &#039;&#039;&#039;exactly&#039;&#039;&#039; match the MATLAB version used for compilation. For example, code compiled with R2023a requires &amp;lt;code&amp;gt;math/matlab-runtime/R2023a&amp;lt;/code&amp;gt;. Available versions:&lt;br /&gt;
&lt;br /&gt;
 module avail math/matlab-runtime&lt;br /&gt;
&lt;br /&gt;
Currently installed: R2022a, R2023a, R2023b, R2024a, R2024b, R2025a, R2025b.&lt;br /&gt;
&lt;br /&gt;
The MATLAB Runtime is [https://de.mathworks.com/products/compiler/matlab-runtime.html freely available from MathWorks] and can also be installed locally if needed.&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=HPC_Glossary/Batch_system&amp;diff=16122</id>
		<title>HPC Glossary/Batch system</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=HPC_Glossary/Batch_system&amp;diff=16122"/>
		<updated>2026-06-03T14:25:45Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: /* Resource Management Systems on bwHPC Clusters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;← This page is part of the [[HPC Glossary]]&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
When we speak of a &#039;&#039;&#039;batch system&#039;&#039;&#039; on compute clusters, we mean the system that knows which compute nodes are used by whom and when they will become available. It also knows about all waiting jobs and determines which job are going to start next on which node whenever a node bekomes available.&lt;br /&gt;
&lt;br /&gt;
== Why do we need a Resource Management System? ==&lt;br /&gt;
&lt;br /&gt;
An HPC cluster is a multi-user system. Users have compute jobs with different demands on number of processor cores, memory, disk space and run-time. Some users run a program only occasionally for a big task, other users must run many simulations to finish their projects. &lt;br /&gt;
&lt;br /&gt;
The cluster only provides a limited number of compute resources with certain features. Free access for all users to all compute nodes without time limit will not work. Therefore we need a resource management system (batch system) for the scheduling and the distribution of compute jobs on suitable compute resources.&lt;br /&gt;
The use of a resource management system pursues several objectives:&lt;br /&gt;
&lt;br /&gt;
* Fair distribution of resources among users&lt;br /&gt;
* Compute jobs should start as soon as possible&lt;br /&gt;
* Full load and efficient usage of all resources&lt;br /&gt;
[[image:distributing_jobs1.svg]]&lt;br /&gt;
&lt;br /&gt;
== How does a Resource Management System work? ==&lt;br /&gt;
A resource management system or batch system manages the compute nodes, jobs and queues and basically consists of two components:&lt;br /&gt;
&lt;br /&gt;
* A resource manager which is responsible for the node status and for the distribution of jobs over the compute nodes.&lt;br /&gt;
* workload manager (scheduler) which is in charge of job scheduling, job managing, job monitoring and job reporting.&lt;br /&gt;
&lt;br /&gt;
A resource management system works as follows:&lt;br /&gt;
&lt;br /&gt;
* The user creates a job script containing requests for compute resources and submits the script to the resource management system.&lt;br /&gt;
* The scheduler parses the job script for resource requests and determines where to run the job and how to schedule it.&lt;br /&gt;
* The scheduler delegates the job to the resource manager.&lt;br /&gt;
* The resource manager executes the job and communicates the status information to the scheduler.&lt;br /&gt;
&lt;br /&gt;
== How does a Job Scheduler work?== &lt;br /&gt;
&lt;br /&gt;
The job scheduling process is influenced by many and sometimes contrasting parameters which are used as metrics for the scheduling algorithm. The objectives of a resource management system are approached in the following way:&lt;br /&gt;
&lt;br /&gt;
* Fair distribution of resources among users: Ensure that all users get a fair share of processing time for their jobs.&lt;br /&gt;
* Compute jobs should start as soon as possible: Minimize the time jobs have to wait until they start.&lt;br /&gt;
* Full load and efficient usage of all resources: Aim for the highest possible utilization with the available jobs, because cluster resources are very expensive&lt;br /&gt;
&lt;br /&gt;
The following simple example illustrates how a scheduler works.&lt;br /&gt;
Let us consider a system with 4 nodes. Each node has 4 processor cores.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here the cluster is empty. No jobs are scheduled:&lt;br /&gt;
&lt;br /&gt;
[[image:Scheduling-workload0.svg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now jobs with different resource requests are scheduled:&lt;br /&gt;
&lt;br /&gt;
* one job which needs two nodes (blue)&lt;br /&gt;
* one job which needs one node (red)&lt;br /&gt;
* multiple jobs, which need only one core (yellow, orange)&lt;br /&gt;
* some jobs are short running, others are long running (see time axis)&lt;br /&gt;
&lt;br /&gt;
[[image:Scheduling-workload1.svg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up to now enough resources are available so that all jobs can start instantly.&lt;br /&gt;
&lt;br /&gt;
More jobs are submitted. Now not all job can start immediately on the available hardware resources. Some jobs are scheduled to run at a later time. &lt;br /&gt;
&lt;br /&gt;
* Big jobs (in terms of hardware resources) often have to wait longer, because they cannot be scheduled flexibly.&lt;br /&gt;
* Long running jobs can delay the scheduling of big jobs, because they block needed hardware resources.&lt;br /&gt;
* Small and short jobs can be scheduled to fill gaps. &lt;br /&gt;
* If a job stops prematurely, short jobs can be rescheduled to start earlier (back filling).&lt;br /&gt;
&lt;br /&gt;
[[image:Scheduling-workload2.svg]]&lt;br /&gt;
&lt;br /&gt;
In addition to cores and time a scheduler has to consider many more metrics like memory, co-processors, fair share, and priority. Scheduling is a multi-dimensional optimization problem.&lt;br /&gt;
&lt;br /&gt;
== Resource Management Systems on bwHPC Clusters ==&lt;br /&gt;
&lt;br /&gt;
Slurm: complete resource management system with integrated resource manager and scheduler&lt;br /&gt;
&lt;br /&gt;
All bwHPC cluster follow a fairshare policy. The waiting time of jobs depends on:&lt;br /&gt;
&lt;br /&gt;
* your job&#039;s resource requests: Jobs with large resource requests wait longer for free resources.&lt;br /&gt;
* your usage history: High resource usage in a short time leads to a lower job priority.&lt;br /&gt;
* your university&#039;s share (bwUniCluster only): If the usage exceeds the university&#039;s share, the job priority decreases.&lt;br /&gt;
&lt;br /&gt;
bwHPC clusters have specific configurations for the resource management system concerning:&lt;br /&gt;
&lt;br /&gt;
* Job submission and monitoring commands (via Slurm)&lt;br /&gt;
* Queues and limits for the available hardware&lt;br /&gt;
* Node access policy:&lt;br /&gt;
** shared: compute nodes can be shared by jobs of different users&lt;br /&gt;
** single user: compute nodes can be shared by jobs of a single user&lt;br /&gt;
** single job: compute nodes are allocated exclusively for a single job&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
FAQ: How many jobs can run on a single node at the same time?&lt;br /&gt;
&lt;br /&gt;
This depends on the node access policy:&lt;br /&gt;
&lt;br /&gt;
* On &amp;quot;shared nodes&amp;quot;, more than one job can run simultaneously if the requested resources are available, and these jobs may have been submitted by different users.&lt;br /&gt;
* On &amp;quot;single user nodes&amp;quot;, more than one job can run simultaneously, but the jobs have to be submitted by one and the same user&lt;br /&gt;
* On &amp;quot;single job nodes&amp;quot;, the access is exclusive for one job, irrespective of the number of requested cores.&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=Energy_Efficient_Cluster_Usage&amp;diff=16111</id>
		<title>Energy Efficient Cluster Usage</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=Energy_Efficient_Cluster_Usage&amp;diff=16111"/>
		<updated>2026-05-29T09:10:12Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: /* Summary: General Recommendations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Energy consumption of data centers has been increasing continuously throughout the last decade. In 2020, the energy consumption of all data centers in Germany amounted to around  [https://www.bundestag.de/resource/blob/863850/423c11968fcb5c9995e9ef9090edf9e6/WD-8-070-21-pdf-data.pdf 3 percent] of the total electricity produced. Accompanying this large energy consumption are large-scale emissions of CO2 to the atmosphere and thus significant contributions to climate change.&lt;br /&gt;
To illustrate this, an average compute job running on a single node for one day may easily consume 10 kWh or even more. That translates roughly to brewing 700 cups of coffee.&lt;br /&gt;
Assuming that a typical bwHPC cluster has a few hundred compute nodes, this amounts to the energy consumption of a village for each cluster. &lt;br /&gt;
&lt;br /&gt;
Although a large amount of this energy consumption is an intrinsic requirement of running large HPC clusters (even when it&#039;s processors are idle, a cluster uses a lot of energy), efficient use of the available resources is important. Using as many resources as possible does not make a power user. Using them wisely does.&lt;br /&gt;
In the following, a basic introduction to some of the most important aspects of energy-efficient HPC usage from a user perspective is given. &lt;br /&gt;
&lt;br /&gt;
We can generally distinguish three tasks when optimizing for running HPC jobs efficiently.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  What do I want to do and why do I need an HPC Cluster for it?&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  How many and which kind of hardware resources do I require for it?&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  How do I optimize my code to use these resources most efficiently?&lt;br /&gt;
&lt;br /&gt;
= What do I want to do and why do I need an HPC Cluster for it? =&lt;br /&gt;
&lt;br /&gt;
The bwHPC clusters are used to almost full capacity, and running a job on an HPC node consumes a lot of energy, as shown above. &lt;br /&gt;
Therefore, users are requested to run only necessary jobs.&lt;br /&gt;
&lt;br /&gt;
Please consider testing new setups and their output for validity prior to submitting jobs that require lots of resources. This also includes projects where a lot of (smaller) similar jobs are submitted. &lt;br /&gt;
&lt;br /&gt;
Make sure to double-check your jobs prior to the submission, as having to discard the output data of an HPC project due to faulty input files is wasting a lot of computational resources.&lt;br /&gt;
&lt;br /&gt;
Finally, identifying the specific resource requirements for a given job is important to allocate the optimal amount for your compute job, and to decide if an HPC cluster is needed at all.&lt;br /&gt;
&lt;br /&gt;
= How many and which kind of hardware resources do I require for it =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Resource allocation is a crucial part when working on an HPC cluster. &lt;br /&gt;
As this is dependent on both the job as well as the specific cluster hardware and architecture available. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
A small number of jobs and few resources&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  Submit to the scheduler. No extended testing and resource scaling analysis are needed. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&lt;br /&gt;
Medium-sized projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  Run only necessary jobs: Please consider testing new setups and their output for validity prior to submitting a huge amount of similar jobs&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  Start small: Run your problem on a small set of resources first.&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  Use the proper tools for development: If you develop your own code, please use the proper tools for debugging and parallel performance analysis. See: [[Development#Documentation_in_the_Wiki|Development]].&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  A look at the job feedback can help you determine if you are using the cluster efficiently&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Large projects&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  Same approach as for medium-sized projects. &lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  Run a scaling analysis for your project with regard to how many resources work best. See: [[Scaling]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Many short jobs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  Handling via the scheduler is inefficient. &lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  Simple parallelization by hand is advisable. See: A basic introduction to [[Development/Parallel_Programming | Parallel Programming]].&lt;br /&gt;
&lt;br /&gt;
= How do I optimize my code to use these resources most efficiently? =&lt;br /&gt;
&lt;br /&gt;
The above recommendations will help use the cluster resources more efficiently.&lt;br /&gt;
Regarding software development, power efficiency correlates obviously heavily with &#039;&#039;&#039;computing performance&#039;&#039;&#039;, but also with memory usage, i.e. the amount of memory used, but also memory efficiency.&lt;br /&gt;
&lt;br /&gt;
Here, we have gathered a few results based on other research:&lt;br /&gt;
&amp;amp;rarr;  Use an efficient programming language such as Rust, C, and C++ -- well any compiled language. Do not use any interpreted language like Perl or Python. Since Machine Learning is a hot topic, this deserves a few words: Any ML-Python code using Tensorflow or other libraries will make heavy usage of NumPy and other math packages, which will use C-based implementations. Please make sure, you use the provided Python modules, which are optimized to use Intel MKL and other mathematical libraries.&lt;br /&gt;
&lt;br /&gt;
Further reading:&lt;br /&gt;
Rui Pereira, et al: &amp;quot;&#039;&#039;Energy efficiency across programming languages: how do energy, time, and memory relate?&#039;&#039;&amp;quot;, SLE 2017: Proc. of the 10th ACM SIGPLAN Int. Conf. on SW Language Eng., Oct. 2017, pp. 256–267, [https://doi.org/10.1145/3136014.3136031 doi:10.1145/3136014.3136031]&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  Analyse memory access patterns&lt;br /&gt;
&lt;br /&gt;
&amp;amp;rarr;  For small tight loops checking for locks, use the &amp;lt;code&amp;gt;pause&amp;lt;/code&amp;gt; instruction.&lt;br /&gt;
&lt;br /&gt;
= Summary: General Recommendations =&lt;br /&gt;
&lt;br /&gt;
* Choose the most &#039;&#039;&#039;efficient algorithms&#039;&#039;&#039; for the given problem.&lt;br /&gt;
* Run only &#039;&#039;&#039;necessary&#039;&#039;&#039; jobs: Please consider testing new setups and their output for validity prior to submitting a huge amount of similar jobs.&lt;br /&gt;
* Start &#039;&#039;&#039;small&#039;&#039;&#039;: Run your problem on a small number of parallel entities (be it processes or threads) first.&lt;br /&gt;
* &#039;&#039;&#039;Estimate&#039;&#039;&#039; the runtime of the parallel job as &#039;&#039;&#039;exactly&#039;&#039;&#039; as possible to increase the efficiency of the scheduling of the whole system.&lt;br /&gt;
* Use the proper tools for development: If you develop your own code, please use the proper tools for debugging and parallel performance analysis. More information is available on the bwHPC Wiki.&lt;br /&gt;
* A look at the &#039;&#039;&#039;job feedback&#039;&#039;&#039; can help you determine if you are using the cluster efficiently.&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster3.0/Jupyter&amp;diff=16027</id>
		<title>BwUniCluster3.0/Jupyter</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwhpc.de/wiki/index.php?title=BwUniCluster3.0/Jupyter&amp;diff=16027"/>
		<updated>2026-05-04T12:25:13Z</updated>

		<summary type="html">&lt;p&gt;S Fischer: fixed broken links&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Jupyter can be used as an alternative to accessing HPC resources via SSH. For this purpose only a web browser is required. Within the website source code of different programming languages can be edited and executed. Furthermore different user interfaces and terminals are available.&lt;br /&gt;
&lt;br /&gt;
= Short description of Jupyter =&lt;br /&gt;
&lt;br /&gt;
Jupyter is a web application, central component of Jupyter is the &#039;&#039;&#039;Jupyter Notebook&#039;&#039;&#039;. It is a document, which can contain formatted text, executable code sections and (interactive) visualizations (image, sound, video, 3D views).&lt;br /&gt;
&lt;br /&gt;
The Jupyter notebooks are executed in an interactive session on the compute nodes of the respective cluster. Access is via any modern web browser. Data is prepared and visualized on the server and therefore does not have to be transmitted over the network. Only the resulting text, image, sound and video data is transmitted. Starting point of a Jupyter session is the HOME directory of the user on the respective cluster. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;JupyterLab&#039;&#039;&#039; is a modern user interface, within which one or more Jupyter notebooks can be opened, edited and executed. The individual notebooks can be arranged as tabs or tiled. JupyterLab is the standard user interface. Besides JupyterLab the classic notebook user interface is available, in which only one Jupyter notebook per browser tab can be opened at a time.&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;&#039;Jupyter Kernel&#039;&#039;&#039; describes a separate process, in which one Jupyter Notebook is executed at a time. Different kernels are available for different programming languages or language versions.&lt;br /&gt;
&lt;br /&gt;
Before a Jupyter session is started, the access authorization must be checked first. This is done via &#039;&#039;&#039;JupyterHub&#039;&#039;&#039;, where the resources are selected, for example the number of CPU cores, GPUs or the required main memory.&lt;br /&gt;
&lt;br /&gt;
A detailed documentation of the Jupyter project can be found at [https://jupyter.readthedocs.io https://jupyter.readthedocs.io].&lt;br /&gt;
&lt;br /&gt;
= Access requirements =&lt;br /&gt;
&lt;br /&gt;
{|style=&amp;quot;background:#deffee; width:100%;&amp;quot;&lt;br /&gt;
|style=&amp;quot;padding:5px; background:#cef2e0; text-align:left&amp;quot;|&lt;br /&gt;
[[Image:Attention.svg|center|25px]]&lt;br /&gt;
|style=&amp;quot;padding:5px; background:#cef2e0; text-align:left&amp;quot;|&lt;br /&gt;
Access to Jupyter is &#039;&#039;&#039;limited to IP addresses from the BelWü network&#039;&#039;&#039;.&lt;br /&gt;
All home institutions of our current users are connected to BelWü, so if you are on your campus network (e.g. in your office or on the Campus WiFi) you should be able to connect to bwUniCluster 3.0 without restrictions.&lt;br /&gt;
If you are outside one of the BelWü networks (e.g. at home), a VPN connection to the home institution or a connection to an SSH jump host at the home institution must be established first.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To use Jupyter on the HPC resources of SCC, the access requirements for [https://wiki.bwhpc.de/e/Registration/bwUniCluster bwUniCluster 3.0] apply. A [https://wiki.bwhpc.de/e/Registration/bwUniCluster registration] is required. Please note, You should&#039;ve completed registration and tested your login once using [https://wiki.bwhpc.de/e/Registration/SSH Secure Shell (ssh)].&lt;br /&gt;
&lt;br /&gt;
= Login process =&lt;br /&gt;
&lt;br /&gt;
Login takes place at &lt;br /&gt;
* bwUniCluster 3.0: [https://uc3-jupyter.scc.kit.edu uc3-jupyter.scc.kit.edu]&lt;br /&gt;
* SDIL: [https://sdil-jupyter.scc.kit.edu sdil-jupyter.scc.kit.edu]&lt;br /&gt;
* HoreKa: [https://hk-jupyter.scc.kit.edu hk-jupyter.scc.kit.edu]&lt;br /&gt;
* HAICORE: [https://haicore-jupyter.scc.kit.edu haicore-jupyter.scc.kit.edu]&lt;br /&gt;
&lt;br /&gt;
For login, your username, your password and a 2-factor authentication are required.&lt;br /&gt;
&lt;br /&gt;
You will first find yourself on a landing page that also gives more information about the currently installed software versions.&lt;br /&gt;
By pressing the login button you will be redirected to the JupyterHub page. Click on Enter JupyterHub to start the login process. Select the organization (e.g. KIT) that has granted you access to the HPC system and press Continue. In the Login section that appears, enter your username and password (not the service password). &lt;br /&gt;
After pressing the Login button you will be redirected to the second factor query page. Enter the one-time password (e.g. from KIT Token or Google Authenticator App) and press Validate. Now you are done with the login process and can start selecting your computing resources.&lt;br /&gt;
&lt;br /&gt;
[[File:Jupyter_Anmeldung.gif|700px]]&lt;br /&gt;
&lt;br /&gt;
= Selection of the compute resources =&lt;br /&gt;
&lt;br /&gt;
The Jupyter notebooks are executed in an interactive session on the compute nodes of the HPC clusters. Just like accessing an interactive session with SSH, resource allocation is done by the Workload Manager Slurm. The selection of resources for Jupyter is realized via drop-down menus. Only jobs with a maximum of one node are possible.&lt;br /&gt;
&lt;br /&gt;
Available resources for selection are&lt;br /&gt;
&lt;br /&gt;
* Number of CPU cores&lt;br /&gt;
* Number of GPUs&lt;br /&gt;
* Runtime&lt;br /&gt;
* Partition/Queue&lt;br /&gt;
* Amount of main memory&lt;br /&gt;
&lt;br /&gt;
If Auto-Reservation is selected the automatic Jupyter reservation of the cluster is enabled.&lt;br /&gt;
&lt;br /&gt;
In normal mode, the grayed-out fields contain reasonable presets, depending on the number of required CPU cores or GPUs respectively. The presets can be bypassed in advanced mode, where further options are available. &lt;br /&gt;
&lt;br /&gt;
Advanced Mode can be activated by clicking on the checkbox of the same name. The following additional options then become available:&lt;br /&gt;
&lt;br /&gt;
* Specification of a reservation&lt;br /&gt;
* LSDF mount option&lt;br /&gt;
* BEEOND mount option&lt;br /&gt;
&lt;br /&gt;
After the selection is made, the interactive job is started with the spawn button. As when requesting interactive compute resources with the `salloc` command, waiting times may occur. These are usually the longer the larger the requested resources are.&lt;br /&gt;
Even if the chosen resources are available immediately, the spawning process may take up to one minute.&lt;br /&gt;
&lt;br /&gt;
[[File:Ressources_neu.gif|500px]]&lt;br /&gt;
&lt;br /&gt;
Please note that in advanced mode, resource combinations can be selected that are impossible to be met. In this case, an error message will appear when the job is spawned.&lt;br /&gt;
&lt;br /&gt;
[[File:Jupyter_Falsche_ressourcen.gif|500px]]&lt;br /&gt;
&lt;br /&gt;
The spawning timeout is currently set to 10 minutes. With a normal workload of the HPC facility, this time is usually sufficient to get interactive resources.&lt;br /&gt;
&lt;br /&gt;
== Prioritized access to computing resources on bwUniCluster 3.0 ==&lt;br /&gt;
The use of Jupyter requires the immediate availability of computing resources since the JupyterLab server is started within an interactive Slurm session. To improve the availability of CPUs/GPUs for interactive supercomputing with Jupyter, &#039;&#039;&#039;automatic reservation&#039;&#039;&#039; for CPU (cpu_il) and GPU (gpu_a100_il) resources has been set up on &#039;&#039;&#039;bwUniCluster 3.0&#039;&#039;&#039;. It is active &#039;&#039;&#039;between 8am and 8pm&#039;&#039;&#039; every weekday. The reservation is automatically active if&lt;br /&gt;
&lt;br /&gt;
* no other reservation is set manually&lt;br /&gt;
* Auto-Reservation is enabled&lt;br /&gt;
&lt;br /&gt;
To give you a better overview of the currently available resources, a status indicator has been implemented. It appears when selecting the number of required CPUs/GPUs and shows whether a Jupyter job of the selected size can currently be started or not. Green means the selected CPU/GPU resources are available instantly. Yellow means only a single additional job of the selected size can be started. Red means there are no GPU resources left that could satisfy the selected amount of resources.&lt;br /&gt;
&lt;br /&gt;
If there are no more resources available within the reservation, you can try selecting a different amount of CPUs/GPUs or activate Advanced Mode and select a different partition. Availability can be estimated using sinfo_t_idle, which is available when logging in via SSH.&lt;br /&gt;
&lt;br /&gt;
= JupyterLab =&lt;br /&gt;
&lt;br /&gt;
JupyterLab is the standard user interface. In the following only its essential functions are briefly introduced. A detailed documentation is available at &lt;br /&gt;
[https://jupyterlab.readthedocs.io https://jupyterlab.readthedocs.io].&lt;br /&gt;
&lt;br /&gt;
== Menu bar ==&lt;br /&gt;
&lt;br /&gt;
The menu bar at the upper edge of JupyterLab has higher-level menus that display the actions available in JupyterLab along with their shortcut keys. The default menus are:&lt;br /&gt;
&lt;br /&gt;
* File: Actions related to files and directories&lt;br /&gt;
* Edit: Actions related to editing documents and other activities&lt;br /&gt;
* View: actions that change the appearance of JupyterLab&lt;br /&gt;
* Run: Actions to execute code in various activities like notebooks and code consoles&lt;br /&gt;
* Kernel: Actions to manage kernels that are separate processes for executing code&lt;br /&gt;
* Tabs: a list of open documents and activities in the Dock Panel&lt;br /&gt;
* Settings: general settings and an editor for advanced settings&lt;br /&gt;
* Help: a list of help links to JupyterLab and the kernel&lt;br /&gt;
&lt;br /&gt;
== Left sidebar ==&lt;br /&gt;
&lt;br /&gt;
In the left sidebar there are foldable tabs. The most relevant ones are:&lt;br /&gt;
&lt;br /&gt;
* File browser: Switch to directories and open files with left mouse button, context menu with right mouse button&lt;br /&gt;
* Running kernels: Overview of running kernels&lt;br /&gt;
* Command overview&lt;br /&gt;
* Tab Overview&lt;br /&gt;
* Lmod software selection: Search and load/unload Lmod software modules&lt;br /&gt;
&lt;br /&gt;
== Main working area ==&lt;br /&gt;
The main working area in JupyterLab allows to arrange, resize and divide documents (notebooks, text files, etc.) and other activities (terminals, code consoles, etc.) in tabs. By holding down the left mouse button, the tabs can be grabbed and repositioned.&lt;br /&gt;
&lt;br /&gt;
In a new JupyterLab session the Launcher tab is opened first. It contains buttons for starting new notebooks, code consoles and other functions. When a notebook is open, a new Launcher tab can be started by pressing the plus symbol in the file browser tab of the left sidebar, by calling &#039;&#039;File &amp;gt; New Launcher&#039;&#039; in the upper menu bar or by the key combination &#039;&#039;Ctrl+Shift+L&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Classic Notebook ==&lt;br /&gt;
&lt;br /&gt;
The classic Jupyter Notebook user interface offers only one open Jupyter Notebook or terminal per browser tab. From the JupyterLab user interface the classic display can be reached in the menu bar under &#039;&#039;Help &amp;gt; Launch Classic Notebook&#039;&#039;. Clicking on the JupyterHub logo in the upper left corner will take you back to the JupyterLab interface.&lt;br /&gt;
&lt;br /&gt;
= Log out =&lt;br /&gt;
&lt;br /&gt;
You can log out from a running Jupyter session by calling &#039;&#039;File &amp;gt; Log Out&#039;&#039; in the upper menu bar. &lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%; margin:4px 0 0 0; background:none; border-spacing: 0px;&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:100%; border:1px solid #BBBBBB; background:#fff5fa; vertical-align:top; color:#000;&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;width:100%; vertical-align:top; border:0px solid #BBBBBB; padding:4px;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|{{Red}}| Attention&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
Please note that your interactive session will continue in the background!  &lt;br /&gt;
&amp;lt;!--For example, this affects your computing time quota on the ForHLR.--&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
As long as the interactive session is running, you can re-enter it at any time. Depending on the duration of your absence, it may be necessary to re-enter your one-time password and possibly KIT password.&lt;br /&gt;
&lt;br /&gt;
If you want to end the interactive session before it has reached its runtime, you can do so via the Hub Control Panel. Under &#039;&#039;File &amp;gt; Hub Control Panel&#039;&#039; in the upper menu bar, it is opened in a new browser tab. By pressing the &#039;&#039;Stop My Server&#039;&#039; button the session will be terminated. You can now log out using the &#039;&#039;Logout&#039;&#039; button in the upper right corner or start a new session directly using the &#039;&#039;Start My Server&#039;&#039; button, for example with a changed resource selection.&lt;br /&gt;
&lt;br /&gt;
[[File:logout_small.gif|750px]]&lt;br /&gt;
&lt;br /&gt;
= Selection of software =&lt;br /&gt;
&lt;br /&gt;
For the selection of the required Lmod software modules the corresponding tab &#039;&#039;Softwares&#039;&#039; is available in the left sidebar. The list of available modules can be narrowed down by entering the search field. The desired module is loaded by pressing the &#039;&#039;Load&#039;&#039; button. In the list with the loaded modules you can remove them with the &#039;&#039;Unload&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;width: 100%; margin:4px 0 0 0; background:none; border-spacing: 0px;&amp;quot;&lt;br /&gt;
| style=&amp;quot;width:100%; border:1px solid #BBBBBB; background:#f5fffa; vertical-align:top; color:#000;&amp;quot; |&lt;br /&gt;
{| style=&amp;quot;width:100%; vertical-align:top; border:0px solid #BBBBBB; padding:4px;&amp;quot; |&lt;br /&gt;
|-&lt;br /&gt;
|{{Green}}| Note&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
On already opened Jupyter Notebooks, newly loaded software modules become active only after restarting the kernel (&#039;&#039;Kernel &amp;gt; Restart Kernel&#039;&#039; in the upper menu bar). Terminals must be closed and reopened.&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[File:software_small.gif|750px]]&lt;br /&gt;
&lt;br /&gt;
== Software Stacks for Jupyter ==&lt;br /&gt;
Currently 3 special Jupyter software stacks are available via Lmod:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;jupyter/minimal&amp;lt;/code&amp;gt;&lt;br /&gt;
*: Minimal installation of JupyterLab&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;jupyter/base&amp;lt;/code&amp;gt; &lt;br /&gt;
*: Basic installation of JupyterLab.&lt;br /&gt;
*: For a complete list of pre-installed packages, please refer to [https://uc3-jupyter.scc.kit.edu/software-modules/#pre-installed-software-packages this site].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;jupyter/tensorflow&amp;lt;/code&amp;gt; (default at login, will be deprecated with the advent of bwUniCluster 3.0)&lt;br /&gt;
*: Preinstalled software packages for machine learning applications. Includes among others TensorFlow, Keras, Torch, Pandas, Matplotlib, SKLearn.&lt;br /&gt;
*: For a complete list of pre-installed packages and their respective version, please refer to [https://uc3-jupyter.scc.kit.edu/software-modules/#pre-installed-software-packages this site].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;jupyter/ai&amp;lt;/code&amp;gt; (will be the new default at login für bwUniCluster 3.0, contains all latest and greatest software for AI workflows)&lt;br /&gt;
*: Preinstalled software packages for machine learning applications. Includes among others TensorFlow, Keras, Torch, Torchvision, Lighning, Pandas, Matplotlib, SKLearn.&lt;br /&gt;
*: For a complete list of pre-installed packages and their respective version, please refer to [https://uc3-jupyter.scc.kit.edu/software-modules/#pre-installed-software-packages this site].&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;jupyter/extensions&amp;lt;/code&amp;gt;&lt;br /&gt;
*: Same packages as tensorflow + extensions&lt;br /&gt;
&lt;br /&gt;
These software stacks can be used both when accessing the cluster via JupyterHub, as well as for conventional access via SSH via module load.&lt;br /&gt;
&lt;br /&gt;
A continuously updated list with the installed packages can be found on the corresponding subpage of the respective cluster:&lt;br /&gt;
&lt;br /&gt;
* bwUniCluster 3.0: [https://uc3-jupyter.scc.kit.edu/software-modules uc3-jupyter.scc.kit.edu/software-modules]&lt;br /&gt;
* HoreKa: [https://hk-jupyter.scc.kit.edu/software-modules hk-jupyter.scc.kit.edu/software-modules]&lt;br /&gt;
&lt;br /&gt;
= Installation of further software =&lt;br /&gt;
The software provided by the Lmod modules jupyter/minimal, jupyter/base and jupyter/tensorflow can be easily supplemented by additional Python packages. There are 2 procedures for this.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;User-Installation (not recommended)&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;pip install --user &amp;lt;packageName&amp;gt; &amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The additional packages are installed under $HOME/.local/lib/python3.11/site-packages/ which is part of PYTHONPATH.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Virtual environments (recommended)&amp;lt;br&amp;gt;&lt;br /&gt;
The user can create and use virtual environments (cf. Virtual environments). Packages provided by the jupyter Lmod modules remain visible and usable.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Virtual environments ==&lt;br /&gt;
&lt;br /&gt;
Python virtual environments allow to use different versions of a package and to keep your local site-packages (accessible under &amp;lt;code&amp;gt;$PYTHONPATH&amp;lt;/code&amp;gt;) free from conflicts.&lt;br /&gt;
&lt;br /&gt;
=== Creation of virtual environment ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
python -m venv &amp;lt;myEnv&amp;gt;&lt;br /&gt;
source &amp;lt;myEnv&amp;gt;/bin/activate  &lt;br /&gt;
pip install &amp;lt;packageName&amp;gt;  &lt;br /&gt;
deactivate&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The additional packages are installed under &amp;lt;code&amp;gt;&amp;lt;myEnv&amp;gt;/lib/python3.11/site-packages/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Usage of virtual environment ===&lt;br /&gt;
&lt;br /&gt;
In order to use the virtual environment, it has to be activated via &amp;lt;code&amp;gt;source &amp;lt;myEnv&amp;gt;/bin/activate&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;PYTHONPATH&amp;lt;/code&amp;gt; is set accordingly. Deactivation of the venv is done via &amp;lt;code&amp;gt;deactivate&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Usage of virtual environment in JupyterLab ===&lt;br /&gt;
&lt;br /&gt;
To be able to use the virtual environments within JupyterLab, a corresponding kernel has to be installed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
source &amp;lt;myEnv&amp;gt;/bin/activate&lt;br /&gt;
python -m ipykernel install \&lt;br /&gt;
    --user \&lt;br /&gt;
    --name myEnv \&lt;br /&gt;
    --display-name &amp;quot;Python (myEnv)&amp;quot; &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After installing the kernel (and possibly refreshing the browser window), a button named &amp;quot;myEnv&amp;quot; is available in JupyterLab. The kernel can also be selected from the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Attention&#039;&#039;&#039;&lt;br /&gt;
The (Lmod) base module you used in the Creation of virtual environment step must be loaded to use the venv. However, to be on the safe side, you can also use the system Python (&amp;lt;code&amp;gt;/usr/bin/python3.11&amp;lt;/code&amp;gt;) at creation time, which is available even without any &amp;lt;code&amp;gt;jupyter/{base,tensorflow}&amp;lt;/code&amp;gt; module loaded.&lt;br /&gt;
&lt;br /&gt;
== Examples on Data processing, Machine Learning &amp;amp; Visualization ==&lt;br /&gt;
&lt;br /&gt;
In the [https://github.com/hpcraink/workshop-parallel-jupyter/ workshop repository] the usage and best practices on Python in general, and the packages NumPy, Pandas, SciKit and Dask are provided, containing running examples based on open data. It also explains, how Jupyter interacts with pre-installed and your own provided environments.&lt;br /&gt;
&lt;br /&gt;
== R language ==&lt;br /&gt;
&lt;br /&gt;
In order to use R language in JupyterLab, the Lmod module &amp;lt;code&amp;gt;math/R&amp;lt;/code&amp;gt; has to be loaded (blue button in JupyterLab or &amp;lt;code&amp;gt;module add math/R&amp;lt;/code&amp;gt; in terminal) and a corresponding kernel has to be installed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
R&lt;br /&gt;
install.packages(&#039;IRkernel&#039;)&lt;br /&gt;
IRkernel::installspec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After installing the kernel , a button named &amp;quot;R&amp;quot; is available in JupyterLab. The kernel can also be selected from the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Attention:&#039;&#039;&#039;&lt;br /&gt;
Don&#039;t forget to load the &amp;lt;code&amp;gt;math/R&amp;lt;/code&amp;gt; module (blue button) before using the kernel.&lt;br /&gt;
&lt;br /&gt;
== Julia language ==&lt;br /&gt;
&lt;br /&gt;
In order to use Julia language in JupyterLab, the Lmod module &amp;lt;code&amp;gt;math/julia/1.10.8&amp;lt;/code&amp;gt; has to be loaded (blue button in JupyterLab or &amp;lt;code&amp;gt;module math/julia/1.10.8&amp;lt;/code&amp;gt; in terminal). When the module is loaded from the JupytherLab UI, the corresponding kernel will be installed. If you use the terminal, this has to be done manually&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
julia&lt;br /&gt;
]&lt;br /&gt;
add IJulia&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After installing the kernel, a button named &amp;quot;Julia 1.10.8&amp;quot; is available in JupyterLab. The kernel can also be selected from the drop-down menu.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Attention:&#039;&#039;&#039;&lt;br /&gt;
Don&#039;t forget to load the &amp;lt;code&amp;gt;math/julia/1.10.8&amp;lt;/code&amp;gt; module (blue button) before using the kernel.&lt;br /&gt;
&lt;br /&gt;
= Jupyter Container Mode =&lt;br /&gt;
&lt;br /&gt;
The container integration on the jupyterhub is done via pyxis. In order to use it the checkmark for container mode has to be clicked. Available options are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt; --container-image:&amp;lt;/code&amp;gt; The container image to use. Corresponds to the pyxis option --container-image&lt;br /&gt;
* &amp;lt;code&amp;gt; --container-name:&amp;lt;/code&amp;gt; The name of the image to use. Corresponds to the pyxis option --container-name. Already downloaded containers in ~/.local/share/enroot can be startet by simply specifing their name.&lt;br /&gt;
* &amp;lt;code&amp;gt; --container-mount-home:&amp;lt;/code&amp;gt; Corresponds to the pyxis option --container-mount-home. Mounts the home-directory&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Attention:&#039;&#039;&#039;&lt;br /&gt;
Make sure Python3.11 and pip are installed in the Container or the notebook will not spawn. This can be checked via command python3.11 -m pip list inside your container&lt;br /&gt;
&lt;br /&gt;
It is advised to create the container prior via e.G. enroot and install all necessary software. For more information see [https://wiki.bwhpc.de/e/BwUniCluster2.0/Containers#SLURM_Integration here]&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>S Fischer</name></author>
	</entry>
</feed>