Applications¶
Previous Section: File Storage and Transfer
In this section, we'll talk a little bit about how to use different applications on our clusters.
Introduction to Example Script¶
First, we have an example python script that we will be using just as a test problem for our sessions this week as well as in Week 4.
Please use your favorite command line text editor (probably nano) to add this file to your cluster account and save it as example.py.
Running the Script¶
Next, let's try running it:
Wait, what? Why didn't that work?Answer
The system doesn't know about python yet, we haven't loaded it.
There are too many versions and conflicting software to have every version of every application pre-installed for all users all the time. To get around this problem, we use a module system called Lmod. This module system can load and unload software within your shell environment.
Lmod Module System¶
As an example, run the command module list to list all currently loaded modules:
Module Command Reference¶
| Command | Description |
|---|---|
module list |
List currently loaded modules |
module load |
Load a module by name (and version) |
module unload |
Unload an already loaded module |
module avail |
Search for currently available modules |
module spider |
Recursively search entire module tree |
module purge |
Unload all currently loaded modules |
module reset |
Revert to default module set |
module show |
Show module definition |
module help |
Show help message for module |
Loading Python Module¶
Let's check for available python modules with module avail
conda package manager...
Now let's load conda to get our python loaded in!
Note: which is a nice program that will tell us where the specified program is coming from.
Running the Script Again¶
Now that we have python ready and our script is written, let's run it (it may take a couple minutes to run):
Numpy Error¶
If you get an error that says something like this:
numpy for ourselves.
Run these three lines of code to create the environment, activate it, and then run our example:
Warning
This is a computationally intensive task that we should not run on the login nodes! More on this in the next section.
Next Section: What is a Cluster