You are here

Environment Settings by "module" Command

Maintenance: August 2 9:00-19:00
Login to frontend node and update of user information (login shell, publickey) may be disabled during the period.

Last update: Mar 1, 2021

Introduction

We will show some examples about usage for "module" command of Environment Modules in this page. It is possible to make settings without "module" command by directly modifying the environment variables. Job script samples not depending on "module" command are also available.

You can find another basic usage of module command in this page.
 

Show Default Environment

Some of modules are already loaded when you logged in to RCCS. Current module list can be shown by executing "module list".

Last login: Mon Mar  1 12:27:12 2021 from ********.**.**
[user@ccfep3 ~]$ module list
Currently Loaded Modulefiles:
  1) intel_parallelstudio/2018update4   4) allinea/7.1
  2) pgilic                             5) cuda/9.1
  3) pgi/18.1

[user@ccfep3 ~]$

PATH and other environment settings are already set accordingly.

[user@ccfep3 ~]$ icc -v
icc version 18.0.5 (gcc version 4.8.5 compatibility)
[user@ccfep3 ~]$

 

Available Modules (module avail)

You can see the list of available modules by "module avail".

[user@ccfep2 ~]$ module avail

-------------------------------- /local/apl/lx/modules/suite --------------------------------
intel_parallelstudio/2015update1          intel_parallelstudio/2020update2
intel_parallelstudio/2017update4          scl/devtoolset-3
intel_parallelstudio/2017update8          scl/devtoolset-4
intel_parallelstudio/2018update2          scl/devtoolset-6
intel_parallelstudio/2018update4(default) scl/devtoolset-7
intel_parallelstudio/2019update1          scl/devtoolset-8
intel_parallelstudio/2019update5          scl/devtoolset-9

-------------------------------- /local/apl/lx/modules/comp ---------------------------------
cuda/10.1             intel/15.0.1          intel/19.0.1          pgi/16.5
cuda/11.1             intel/17.0.4          intel/19.0.5          pgi/17.5
cuda/7.5              intel/17.0.8          intel/19.1.2          pgi/18.1(default)
cuda/8.0              intel/18.0.2          julia/1.3.1           pgi/20.4
cuda/9.1(default)     intel/18.0.5(default) julia/1.5.3

--------------------------------- /local/apl/lx/modules/apl ---------------------------------
mpi/intelmpi/2017.3.196   mpi/openmpi/2.1.3/intel19 mpi/openmpi/4.0.0/gnu8.3
mpi/intelmpi/2017.4.262   mpi/openmpi/3.1.0/gnu4.8  mpi/openmpi/4.0.0/intel15
(以下省略)

You can see the list of applications in this page. Generally, packages excluding OS standard ones are installed under /local/apl/lx. You can directly check the contents of that directory.

  • Non-system-standard GCCs are installed under scl/devtoolset-* directories. (Software Collections)
  • Some of default modules are corresponding to the system libraries installed under /usr (e.g. cmake and boost).
  • You may omit version number. In this case, the version marked with (default) will be loaded.

 

Loading and Switching Modules (load, switch, unload, purge)

You can load modules by "module load" command. Please note that you usually cannot load multiple versions of single software/library. Please use "module switch" to change the version.

[user@ccfep2 ~]$ module list
  1) intel_parallelstudio/2018update4   4) allinea/7.1
  2) pgilic                             5) cuda/9.1
  3) pgi/18.1

cuda/9.1 is already loaded. You cannot load cuda/10.1 in this situation.

[user@ccfep2 ~]$ module load cuda/10.1

ERROR: You cannot load multiple versions of "cuda".

Currently Loaded Modulefiles:
  1) intel_parallelstudio/2018update4   4) allinea/7.1
  2) pgilic                             5) cuda/9.1(default)
  3) pgi/18.1

In this case, you need to switch version by "switch" ("swap" is also OK). Or, you can unload (aliases: rm ,remove) the current one first and then load (alias: add) the version you need.

[user@ccfep2 ~]$ module switch cuda/10.1
[user@ccfep2 ~]$ module list
Currently Loaded Modulefiles:
  1) intel_parallelstudio/2018update4   4) allinea/7.1
  2) pgilic                             5) cuda/10.1
  3) pgi/18.1

[user@ccfep2 ~]$ module unload cuda
[user@ccfep2 ~]$ module load cuda/10.1
[user@ccfep2 ~]$ module list
Currently Loaded Modulefiles:
  1) intel_parallelstudio/2018update4   4) allinea/7.1
  2) pgilic                             5) cuda/10.1
  3) pgi/18.1

You can omit version when unloading. In case you want to unload all the modules, please try "module purge".

[user@ccfep2 ~]$ module list
Currently Loaded Modulefiles:
  1) intel_parallelstudio/2018update4   4) allinea/7.1
  2) pgilic                             5) cuda/10.1
  3) pgi/18.1
[user@ccfep2 ~]$ module purge
[user@ccfep2 ~]$ module list
No Modulefiles Currently Loaded.

 

Load Applications

You can load not only the compilers and libraries but also the applications such as Gaussian and Amber. In case you need command such as "formchk" or "ambpdb", those application modules might be useful.

[user@ccfep2 ~]$ formchk
bash: formchk: command not found...
[user@ccfep2 ~]$ ambpdb
bash: ambpdb: command not found...
[user@ccfep2 ~]$ module load gaussian/g16/c01
[user@ccfep2 ~]$ module load amber/20/update9
info: switching version of cuda to 11.1
[user@ccfep2 ~]$ ambpdb
Error: 'prmtop': No such file or directory

Usage: ambpdb -p 'Top' -c 'Coords' [Additional Options]
       ambpdb -p 'Top' < 'AmberRestart' [Additional Options]
    -p 'Top'       Topology file (default: prmtop).
    -c 'Coords'    Coordinate file.
    'AmberRestart' Amber restart file from STDIN.
  PDB is written to STDOUT.
  Use '-h' or '--help' to see additional options.

[user@ccfep2 ~]$ formchk
 Checkpoint file?

 

Notes

  • If your login shell is /bin/csh and you want to use "module" in job script, you need run "source /etc/profile.d/modules.csh" before invoking "module" command.
    • This preparation is not necessary on forntend nodes.
  • You cannot load both of Intel Parallel Studio (e.g. intel_parallelstudio/2018update4) and Intel Compilers (e.g. intel/18.0.5).
    • Please unload module of parallel studio first, and then load intel compiler module.
    • The same happens for MKL, Intel MPI, and other components of Intel Parallel Studio.
  • You cannot load multiple versions of application/library.
  • When loading modules, some of other modules might be loaded automatically.
    • For example, in the previous section, switching of cuda version to 11.1 happens when loading amber/20/update9.
  • Module command is not yet available for software/library which need definition of shell functions.
    • (Newer version of environment modules is required.)