Moduły
Basic information
The standard method used to manage the user environment on clusters is modules. The operate approach on modules means that the user does not have to specify paths for different versions of the application and take care of setting dependent environment variables. It is sufficient for the user to 'load' a module associated with the application so that all required environment variables (PATH, LD_LIBRARY_PATH, INCLUDE etc.) are set in the user environment. If the user wants to use a different version of the application it is enough to 'unload' the module associated with the old application and 'load' the module associated with the new version.
Basics of use
Display list of loaded modules
Use the following command to display a list of loaded modules.
module list
A sample result of this command is shown below.
[username@hostname ~]$ module list Currently Loaded Modulefiles: 1) open64-4.2.5.2
Display a list of available modules
Use the following command to display a list of all available modules for a given user.
module avail
A sample result of this command is shown below.
[username@hostname ~]$ module avail ----------- /usr/share/Modules/PSNC/Development/Languages ----------- open64-4.2.5.2 ----------- /usr/share/Modules/PSNC/Development/Libraries ----------- openmpi-gcc-x86_64 openmpi-opencc-x86_64
Wyświetlenie dodatkowych informacji na temat modułu
Aby wyświetlić dodatkowe informacje na temat danego modułu należy użyć następującego polecenia.
module help <name_modul>
Below is an example of a command invocation for a module 'open64-4.2.5.2'.
[username@hostname ~]$ module help open64-4.2.5.2 ----------- Module Specific Help for 'open64-4.2.5.2' --------------------------- Name: AMD x86 Open64 Compiler Suite Version: 4.2.5.2 Platform: x86_64 Category: Development/Languages URL http://developer.amd.com Provides: opencc, openCC, openf90, openf95 Description: The x86 Open64 compiler system is a high performance, production quality code generation tool designed for high performance parallel computing workloads. The x86 Open64 environment provides the developer the essential choices when building and optimizing C, C++, and Fortran applications targeting 32-bit and 64-bit Linux platforms. The x86 Open64 compiler system offers a high level of advanced optimizations, multi-threading, and processor support that includes global optimization, vectorization, interprocedural analysis, feedback directed optimizations, loop transformations, and code generation which extracts the optimal performance from each x86 processor core. man pages: no Restrictions: none -------------------------------------------------------------------------------
Loading the module
The following command is used to load a new module.
module load <nazwa_modulu>
Unloading the module
The module is unloaded using the following command.
module unload <name_modul>
Checking which environmental variables are modified by a given module
The following command can be used to find out which environmental variables are modified by a given module.
module show <name_modul>
An example of the command result is shown below.
[username@hostname ~]$ module show open64-4.2.5.2 ------------------------------------------------------------------- /usr/share/Modules/PSNC/Development/Languages/open64-4.2.5.2: module-whatis AMD x86 Open64 Compiler Suite, 4.2.5.2 setenv open64_root /opt/x86_open64-4.2.5.2 prepend-path PATH /opt/x86_open64-4.2.5.2/bin prepend-path LD_LIBRARY_PATH /opt/x86_open64-4.2.5.2/lib prepend-path INCLUDE /opt/x86_open64-4.2.5.2/include -------------------------------------------------------------------
Personalisation of settings
In an environment where modules are used, the user can decide which modules will be loaded after logging into the system. To do so, edit the file ~/.bashrc or ~/.bash_profile and add the appropriate lines. Below is an example, in which to the MODULEPATH variable was added a path to the directory, where user modules are located and the open64 compiler module is loaded in version 4.2.5.2.
[username@hostname ~]$ cat ~/.bash_profile ... # Environment Modules # Prepend directory to the MODULEPATH environment variable. module use --append $HOME/.modules/my_modules # Modules loaded at login time. module load open64-4.2.5.2 ...
Additional information
For additional information on using the modules, refer to the system manual by issuing one of the following commands.
# Information on the use of modules man module # Information on writing your own modules man modulefile