NERSC logo National Energy Research Scientific Computing Center
  A DOE Office of Science User Facility
  at Lawrence Berkeley National Laboratory
PackagePlatformCategoryVersionModule Install DateDate Made Default
modules franklin applications/programming 3.1.6 modules 2007-06-18 2007-06-18
modules hopper applications/programming 3.1.6 modules 2009-11-01 2009-11-01
modules pdsf applications/programming 3.1.6 not needed

Modules Approach to Software Management

NERSC has implemented and enhanced the modules approach to managing the user environment for different software versions on all production machines. The distinct advantage of the modules approach is that the user is no longer required to explicitly specify paths for different executable versions, and try to keep the MANPATH and related environment variables coordinated. With the modules approach, users simply ``load'' and ``unload'' modules to control their environment.


Module commands

To get a usage list of module options type the following (the listing has been abbreviated to only those commands discussed in this webpage) :

% module help

  Available Commands and Usage:

        +  add|load     modulefile [modulefile ...]
        +  rm|unload    modulefile [modulefile ...]
        +  switch       modulefile1 modulefile2
        +  display      modulefile [modulefile ...]
        +  avail        path [path]
        +  list
        +  help         modulefile [modulefile ...]
module list
This lists all the modules which are currently loaded into the users environment.
module avail
This option lists all the modules which are available to be loaded. Notice that many of them have version numbers associated with them. Modules makes it easy to switch compiler application versions. The module name without a version number is the production default.
module help modulefile
If a module looks interesting, to get more information use this command to display the `help' information contained within the given module file.
% module help GNU

----------- Module Specific Help for 'GNU' ------------------------

        USG/GNU software & application environment


        By including this module in your environment this
        makes the GNU version of any utility to be used
        preferentially over any system tool of the same name.

        Version 1.0

module display modulefile
Use this command to see exactly what a given modulefile will do to your environment, such as what will be added to the PATH, MANPATH, etc. environment variables.
module load modulefile
This adds one or more modulefiles to the user's current environment. It does so silently, unless there is a problem with a modulefile. If there is problem, please notify the NERSC user services consultants. If you load the generic name of a module, you will get the default version. To load a specific version, load the module using its full specification, e.g.:
% module load gcc/3.0.4
module unload modulefile
This removes any listed modules from the user's current environment. The modules can be removed in any order.
% module unload GNU
module switch modulefile_old modulefile_new
This command demonstrates the true advantages of modules. Different versions of entire software packages can be replaced with a single module command.

Loading Modules into Your Default Environment

You can modify your environment so that certain modules are loaded whenever you log in. Put your changes in one of the following files, depending on your shell.

  • .cshrc.ext or .tcshrc.ext
  • .bashrc.ext

Here is an example of a .cshrc.ext file with commands to load modules. Notice that, modules specific to a platform are put inside of if-then blocks.


if ($NERSC_HOST == "franklin") then
# Replace the following line with personal settings for franklin
  module load fftw
endif


LBNL Home
Page last modified: Fri, 09 Apr 2010 23:31:55 GMT
Page URL: http://www.nersc.gov/nusers/resources/software/os/modules.php
Web contact: webmaster@nersc.gov
Computing questions: consult@nersc.gov

Privacy and Security Notice
DOE Office of Science