Software - Modules
Linux Cluster Institute - Intermediate
Alan Chapman�Systems Analyst - Software Specialist�RTO Research Computing�Arizona State University
Copyright © 2024 Arizona Board of Regents
Agenda
What are software modules and why do we use them
Usage of modules in HPC
Lua vs TCL modules
2
Copyright © 2024 Arizona Board of Regents
3
What Are Software Modules?
Software modules are scripts that configure the shell environment to access different versions of software packages and their dependencies. They modify environment variables such as PATH, LD_LIBRARY_PATH, CPATH, and others to ensure the correct software and its dependencies are used.
Modules allow users to load, unload, and switch between software packages easily without affecting the entire system. This is typically done using commands like module load, module unload, and module switch.
Copyright © 2024 Arizona Board of Regents
4
Why Use Software Modules in HPC?
Copyright © 2024 Arizona Board of Regents
5
Environment Modules
Environment Modules is a tool that helps manage and modify users' shell environments dynamically, allowing easy switching between different software versions and configurations in High-Performance Computing (HPC) systems. This tool is essential in HPC environments because it allows users to load, unload, and switch between different software packages and versions without manually adjusting environment variables like PATH, LD_LIBRARY_PATH, and others.
By using software modules, HPC environments can support diverse software needs and ensure that users have access to the right tools for their research and development tasks.
Copyright © 2024 Arizona Board of Regents
6
Types of Modules
Environment Modules:
Lmod Modules:
Copyright © 2024 Arizona Board of Regents
7
Example Workflow
Copyright © 2024 Arizona Board of Regents
8
Comparison and Benefits
Environment Modules
Lmod
Copyright © 2024 Arizona Board of Regents
9
Comparison of module file types
TCL
Lua
Copyright © 2024 Arizona Board of Regents
10
Charliecloud
Copyright © 2024 Arizona Board of Regents
11
Examples
local pkg = pathJoin("/apps",myModuleName(),myModuleVersion())
local bin = pathJoin(pkg,"bin"))
prepend_path("PATH",bin)
whatis("Name: ", myModuleName())
whatis("Version: ", myModuleVersion())
whatis("Description: ", "Git is a fast distributive version control system")
Introspection
Copyright © 2024 Arizona Board of Regents
12
Examples
local fn = myFileName() -- 1
local full = myModuleFullName() -- 2
local loc = fn:find(full,1,true)-2 -- 3
local mdir = fn:sub(1,loc) -- 4
local appsDir = mdir:gsub("(.*)/","%1") -- 5
local pkg = pathJoin(appsDir, full) -- 6
Relative Paths
Copyright © 2024 Arizona Board of Regents
13
Installation
# dnf config-manager --set-enabled powertools
# dnf install Lmod
# . /usr/share/lmod/lmod/init/profile
(The last line is only so you don’t have to reboot to get the module command to work.)
Copyright © 2024 Arizona Board of Regents
14
Resources
Copyright © 2024 Arizona Board of Regents
15
Questions / Discussion
Copyright © 2024 Arizona Board of Regents
Copyright © 2024 Arizona Board of Regents