...
To access the cluster resources and send commands you need to use an SSH client. On Mac and Linux, from the a terminal simply run:
Code Block |
---|
ssh Your_NetID@loginNetID@hpc2.storrs.hpc.uconn.edu |
(Where 'Your_NetID' is your own NetID consisting of 3 letters and 5 numbers)
...
Windows users can login using PuTTY MobaXTerm.
Once connected, you should see a terminal prompt like:
Code Block |
---|
[Your_NetID@cn01NetID@login4 ~]$ |
To view all available modules run the command:
...
This will list out the applications that you can load into your environment.
To view already loaded programs, run the command:
...
We can also use it list the available versions for a specific program. For example, let’s say I want to load the newest version of python available. I could use the following command to see which versions of python are installed.
Code Block |
---|
module avail python
-------------------------- /cm/shared/modulefiles --------------------------
python/3.7.3 python/3.10.5
|
Now, I need to take note of which python version I want to load. Let’s say I want python/3.10.5. Next we’ll cover how to load a module.
Loading Your Environment
To load a module run:, the command will follow a format like the line below.
Code Block |
---|
module load {MODULE_NAME} |
Where your module name is one from the list of available modules. You’ll just need to replace {MODULE_NAME} with the name and version of the module you want. For example, I could load python/3.10.5 with this command.
Code Block |
---|
module load python/3.10.5 |
Note that tab completion works for the names of modules. So you could type “python/3.1” and then hit tab which would automatically fill in the rest of the version info.
You’ll see that when we ran the module load python/3.10.5 command, there were other prorgams loaded as well. That’s because python depends on other programs being loaded.
Code Block |
---|
module load python/3.10.5
Loading python/3.10.5
Loading requirement: gcc/11.3.0 tcl/8.6.12 sqlite3/3.39.0 |
To view all the loaded programs, you can run the command:
Code Block |
---|
module list |
In this python example, the output looks like this:
Code Block |
---|
module list Currently Loaded Modulefiles: 1) slurm/slurm/21.08.8 2) gcc/11.3.0 3) tcl/8.6.12 4) sqlite3/3. |
...
39.0 5) python/3.10.5 |
It’s worth noting that some modules have conflicts , because different versions of the same program cannot be loaded at the same time. To check for conflicts view your modules list that is loaded. If something conflicts run the . For instance, if I tried to load the older version of python (3.7.3) right now, it would not load because of the conflict.
Code Block |
---|
module load python/3.7.3
Loading python/3.7.3
ERROR: python/3.7.3 cannot be loaded due to a conflict.
HINT: Might try "module unload python" first. |
As the hint suggests, I have to unload python first. To unload a module, use the following command:
Code Block |
---|
module unload {MODULE_NAME} |
You can then load the required module
Loading Modules on Log-in
If you wish for certain modules to be loaded every time you log in, To do this run:
Code Block |
---|
module initadd {module name} |
If you decide that you no longer want a specific module to be loaded every time, simply remove that line from your ~/.bashrc under the "# Load saved modules
" heading.
...
For this specific python example, I can use this command and it will unload python as well as its dependencies.
Code Block |
---|
module unload python
Unloading python/3.10.5
Unloading useless requirement: gcc/11.3.0 tcl/8.6.12 sqlite3/3.39.0 |
Now, we can load the older version of python successfully as shown below.
Code Block |
---|
module load python/3.7.3
Loading python/3.7.3
Loading requirement: gcc/5.4.0-alt tcl/8.6.6.8606 sqlite3/3.18.0 libffi/3.2.1 |
Modules you use together frequently
Sometimes, there are certain modules that you use together frequently. It can be tempting to automatically load those modules in your ~/.bashrc file, but we urge our users to please not do this. This routinely leads to problems for users due to conflicting modules.
We get it though. It’s annoying to remember the versions and load the same modules multiple times a day. So, we suggest that users instead create a file containing those programs and then source that file anytime they need. For example, let’s say I need to load gromacs and all of its dependencies. I would make a file called load_gmx.
Code Block |
---|
touch ~/load_gmx |
Open the file with Vim.
Code Block |
---|
vi ~/load_gmx |
Press the letter i
key on my keyboard so I can edit the document. Copy and paste the following commands into the terminal. These set the shell and load gromacs.
Code Block |
---|
#!/bin/bash
module load gromacs/2022.3/gpu |
Then I would save by pressing the <Esc>
key and typing :wq
. Now whenever I want to load gromacs, I would simply source that file.
Code Block |
---|
source ~/load_gmx |
And as you can see, all the 12 of the modules I need are loaded:
Code Block |
---|
module list
Currently Loaded Modulefiles:
1) slurm/slurm/21.08.8 3) hwloc/1.11.11 5) sqlite3/3.39.0 7) binutils/2.26 9) openmpi/4.1.4 11) cuda/11.6
2) gcc/11.3.0 4) tcl/8.6.12 6) python/3.10.5 8) zlib/1.2.12 10) fftw3/3.3.10 12) gromacs/2022.3/gpu |
To deactivate those modules, I could either use module unload gromacs
or just start a new session on the cluster by logging out and logging back into HPC 2.0.
Making Your Own Module Files
...