Physnodes - 2) Modules

Modules and the user environment 

 Introduction

This section contains details about the user environment and how it can be controlled via  the module command. The modules

Module structure

Modules are organised by categories such as applications, compilers and libraries, with a number of applications and software packages in each category. 

Working with modules

module avail

Use the command module avail to list available modules.

List available modules

-bash-4.1$ module avail

----------------------- /opt/yarcc/Modules/applications ------------------------
gaussian/G09  Matlab/R2014a R/2.15.3      R/3.1.0

------------------------- /opt/yarcc/Modules/compilers -------------------------
python/2.7.6 python/3.4.0

------------------------- /opt/yarcc/Modules/libraries -------------------------
fftw/2.1.5 fftw/3.3.3

---------------------- /opt/yarcc/Modules/infrastructure -----------------------
sge/8.1.6 SGE/8.1.6

module load

To load a module type module load <module name>. You can append a version number to load a specific instance of a package. Note the <tab> key can be used to complete the command.

Load a module

-bash-4.1$ module load sge
-bash-4.1$ module load R/3.1.0

module list

To list currently loaded modules type module list

List currently loaded modules

-bash-4.1$ module list
Currently Loaded Modulefiles:
  1) sge/8.1.6   2) R/3.1.0

module unload

To unload a module use the unload command

Unload a module

-bash-4.1$ module list
Currently Loaded Modulefiles:
  1) sge/8.1.6   2) R/3.1.0
-bash-4.1$ module unload R/3.1.0
-bash-4.1$ module list
Currently Loaded Modulefiles:
  1) sge/8.1.6

 

other useful commands

Command

Description

module whatis

Gives a one-line description of all available modules

module show <module>

Shows what environment variables a module will modify

module help <module>

Gives more information about the package (e.g. website, license)

module purge

Unload all modules from environment

module find <module>

Searches institutional modules as well as central modules

Module help

  Modules Release 3.2.10 2012-12-21 (Copyright GNU GPL v2 1991):

  Usage: module [ switches ] [ subcommand ] [subcommand-args ]

Switches:
    -H|--help        this usage info
    -V|--version        modules version & configuration options
    -f|--force        force active dependency resolution
    -t|--terse        terse    format avail and list format
    -l|--long        long     format avail and list format
    -h|--human        readable format avail and list format
    -v|--verbose        enable  verbose messages
    -s|--silent        disable verbose messages
    -c|--create        create caches for avail and apropos
    -i|--icase        case insensitive
    -u|--userlvl <lvl>    set user level to (nov[ice],exp[ert],adv[anced])

  Available SubCommands and Args:
    + add|load        modulefile [modulefile ...]
    + rm|unload        modulefile [modulefile ...]
    + switch|swap        [modulefile1] modulefile2
    + display|show        modulefile [modulefile ...]
    + avail            [modulefile [modulefile ...]]
    + use [-a|--append]    dir [dir ...]
    + unuse            dir [dir ...]
    + update
    + refresh
    + purge
    + list
    + clear
    + help            [modulefile [modulefile ...]]
    + whatis        [modulefile [modulefile ...]]
    + apropos|keyword    string
    + initadd        modulefile [modulefile ...]
    + initprepend        modulefile [modulefile ...]
    + initrm        modulefile [modulefile ...]
    + initswitch        modulefile1 modulefile2
    + initlist
    + initclear

.modulerc - automatically loading modules

You can create a ".modulerc" file in your home directory, ${HOME}/.modulerc, to automatically load modules when you login.

.modulerc file format
#%Module1.0
module load openmpi/1.8.3
module load jruby/3.2.

 

Â