Customizing Your Computing Environment with Modules

6. Configuring Your Software Environment

The following steps outline a basic process you can use to configure your software environment using the module command and pre-written modulefiles:

  1. Determine if the modulefile you want has already been loaded into your environment or not. Even if you have not loaded it yourself, it might have been loaded automatically when you logged into your resource.
  2. If it isn't already loaded, find the modulefile(s) you want to use from those available on your resource.
  3. Load the modulefile(s) into your environment.

The following example shows how to configure your shell environment using this process and the commands you learned in the previous section.

Example

Let's say you want to use the Matlab software on your HPC Cluster.

Step 1:

First, check to see if the Matlab modulefile has already been loaded or not. To do this, enter the module list command to display the modulefiles currently loaded in your shell environment. A sample session is shown below:

$ module list
Currently Loaded Modulefiles:
  1) torque/6.1.2   2) moab/9.1.2     3) env/ncsa       4) env/taub

From the output, we see that there are four modulefiles currently loaded, with none of them being Matlab.

Step 2:

Next, we'll use the module avail command to see if it is available and, if so, find its pathname. We could do this by displaying a list of all available modules using the module avail command with no search argument. However, the list may be long, so we'll use a search term to shorten it. For our example, we'll use the module avail command with the search term 'matlab.'

$ module avail matlab

---------------------------------------- /usr/local/modulefiles --------------------------------------
matlab/9.4 matlab/9.5 matlab/9.7

From the output, we see there are three versions of Matlab installed.

Step 3:

Finally, we'll load version 9.7 of Matlab into our environment by entering the module load command and the modulefile's pathname. 

$ module load matlab/9.7

To be sure everything loaded alright, we enter the module list command. From the output, we see that matlab/9.7 was loaded.

$ module list
Currently Loaded Modulefiles:
  1) torque/6.1.2   2) moab/9.1.2     3) env/ncsa       4) env/taub       5) matlab/9.7

Icon indicating an exerciseExercise

Complete the following exercise by entering the appropriate module command on your system's command line:

Load a modulefile of your choice into your shell environment and show that it was indeed loaded.