You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

For the complete list of options and commands, see the Lmod modules command reference list 

Lmod is a Lua-based implementation of the module system, and generally claimed to be backwards compatible with the original. On the newer ECMWF platforms it is replacing the traditional TCL modules.

It is used to configure and manage your session or job environment with all those tools and libraries required for your workload.

Table of contents

Main features

  • All the shells in use at the centre are supported.
  • Same command and almost identical syntax and options as TCL modules.
  • Graceful failure in case of error. TCL modules sometimes fails and gives a zero exit code which cannot be trapped. Some users have implemented their own functions to workaround this issue in the past.
  • It does the right thing: automatic swap if different version of module is loaded. With TCL modules you need to know if that module is loaded to decide whether to swap or to load. Many times you end up unloading and loading to make it easier.
  • Subcommands like avail or list work on STDOUT so piping the output to other commands such as grep is much more convenient.
  • The ml shortcut.
  • Avail mode also shows those modules which are loaded.
  • Better support for dependencies and conflicts to other modules.
  • Native support to manage different toolchains (different compiler families and versions, and even MPI flavours).

Behaviour change: Lmod does the right thing

Return codes

If the command fails for any reason (i.e. the module does not exist), it will return a non-zero exit code so you can trap it and deal with it appropriately. There is no need to check wether the module has been loaded or not. You may find that some scripts may fail early where they were not failing before because of this new behaviour

Load and swap

Loading a module when there was another version of it loaded is no longer a problem. Lmod will swap them automatically.

Conflict management

If two modules cannot be loaded at the same time due to a conflict, the old one will be swapped out and the new one will be loaded automatically.

Native flavour support

You may feel that some packages or versions are missing when running the classic module avail. Lmod knows about those packages that are flavoured for different environments (compilers or MPI), and will only show as available to load those that have been installed for the currently loaded environment. Use module spider to see the whole picture

The tool basics

If you have used modules before, you will see the commands and options are almost identical. You will be able to load and unload modules, as well as checking which ones are loaded or available to load.

Please have a look at the Lmod modules command reference list for details on the different subcommands.

The ECMWF setup

Note that there are no modules are loaded by default



  • No labels