User Environment

An introduction to the user environment on the Linux hosts at the department as well as the module framework for software offered.

 

Home Directories, Shells and Modules

Home directories ($HOME) are accessible from any of the computers belonging to the department of Mathematics, except on HPC. An environment variable called $HOME is defined and contains the absolute path of a user home directory: use this environment variable whenever possible.

The default shell at the Department of Mathematics is bash.

 

Using Modules to Manage Access to Software

On europa and other machines running Red Hat Enterprise Linux 7, users should not have to modify their path directly.  Instead, the module utility is used to set environment variables for software and libraries, including a lot of software that is loaded by default.  Simply ``load'' and ``unload'' modules to control your environment. 

Modules environment management package provides support for dynamic modification of the user environment via modulefiles. Each modulefile contains all the information needed to configure the shell for a particular application. Typically, a modulefile modifies environment variables like PATH, MANPATH, LD_LIBRARY_PATH and XXXX_HOME (where XXX is the name of a software/library in capital letter) to give access to an application or library. 

Command Description
module list Lists modules currently loaded in a user’s environment
module avail Lists all available modules on a system in condensed format
module avail -l Lists all available modules on a system in long format
module display Shows environment changes that will be made by loading a given module
module load Loads a module
module unload Unloads a module
module help Shows help for a module
module swap Swaps a currently loaded module for an unloaded module

What is loaded now?

[europa ~]$  module list

Currently Loaded Modulefiles:
  1) matinst   2) use.own

 

What is available?

To see which modulefiles are available on your system, enter this command:

 

[europa ~]$  module avail [string]

 

The module avail command produces an alphabetical listing of every modulefile in your module use path and has no option for "grepping." Therefore, it is usually more useful to use the command with an string argument:

 

[europa ~]$  module avail python

----------------------------------------------------------------- /opt/uio/modules/software ------------------------------------------------------------------
python/anaconda(default) python/canopy

 

Loading and Unloading Modules

If a modulefile is not already loaded, use the module load command to load:

 

[europa ~]$  module load netcdf

 

This command loads the currently defined default version of the module, unless you specify otherwise:

 

[europa ~]$  module load netcdf/4.2.0_intel

 

This will load the netcdf library compiled with intel compilers.

 

If you want to remove a software/library from your user environment you may unload it:

 

europa ~]$  module unload netcdf/4.2.0_intel

 

You need to unload the same version you previously loaded.

 

Module Swapping

Alternatively, you can use the module swap or module switch command to unload one module and load the comparable module:

europa ~]$  module load netcdf
europa ~]$  module list

Currently Loaded Modulefiles:
  1) matinst        2) use.own            3) netcdf/4.2.0_gnu
europa ~]$  module switch netcdf netcdf/4.2.0_intel
europa ~]$  module list

Currently Loaded Modulefiles:
  1) matinst        2) use.own            3) netcdf/4.2.0_intel

 

Loading modules automatically

By default, one module is loaded at login (matinst). However, you may want to customize your environment and load modules that you use often at login. It is recommended that you do this by creating a ~/.modulerc file. This file must contain the special modulefile token "#%Module1.0" on the first line followed by one or more module commands:

#%Module1.0

set version 1.0
module load netcdf

 

This will cause the default version of netcdf to be automatically loaded when you log in.  Some people have reported that the module isn't available until they call a module command (such as module list), if that happens to you a solution may be to add "module list 2> /dev/null" in an appropriate startup file, such as ~/.bash_profile.

 

Adding your our modulefile

Create a directory called privatemodules in your home directory. Then type the command:

module load use.own

and any personal module files in this directory will become available for you to list, load or unload. As previously explained, you can add it to ~/.modulerc to load it automatically at login.

Our modulefiles are in /opt/uio/modules/ and they can be copied to use as templates.  Note that the directory /opt/uio/modules/pacakages contains the built software.

 

 

For more information see Modules Software Environment.

 

Troubleshooting

No UIO modulefiles available

module avail should list all available modulefiles in the current MODULEPATH but if MODULEPATH is not set properly in your environment it may only display a few modulefiles. If it happens:

  module use --append /opt/uio/modules/compilers
  module use --append /opt/uio/modules/environment 
  module use --append /opt/uio/modules/software 
  module use --append /opt/uio/modules/libraries

 

Cannot find the module command

If you get the message

module: command not found

 

contact drift[at]math.uio.no

 

Missing software

If you have a need for software not available in the current module installation, let us know and we'll see what we can do.  An email to drift[at]math.uio.no is the easiest way to let us know.

 

Thanks

The vast majority of this work, and indeed this document, would not be possible without the gracious assistance from the department of Geophysics and Anne Claire Fouilloux in particular.  

Published Sep. 1, 2014 6:45 PM - Last modified Mar. 8, 2017 1:49 PM