module工具使用说明

module工具是一种常用于高性能计算环境的动态环境管理工具。它允许用户通过加载和卸载模块文件来灵活地修改其shell环境,从而方便地管理软件包和依赖。主要功能包括列出可用模块、加载和卸载模块、显示当前加载的模块以及查看模块详细信息。使用module工具,用户可以轻松切换不同的软件版本,确保环境的一致性和灵活性。

1 添加modulefile 路径

module use /cvmfs/slurm.ihep.ac.cn/alma9/modulefiles

2 查找可用的软件及版本

module avail
------------------------------ /cvmfs/slurm.ihep.ac.cn/alma9/modulefiles ------------------------------------
anaconda/24.3.0                              intel_oneapi/compiler-rt32/2024.1.0       intel_oneapi/tbb32/2021.12
cmake/3.18.4                                 intel_oneapi/compiler-rt32/latest         intel_oneapi/tbb32/latest
cmake/3.26.4                                 intel_oneapi/compiler/2024.1.0            intel_oneapi/vtune/2024.1
cmake/3.29.1                                 intel_oneapi/compiler/latest              intel_oneapi/vtune/latest
cp2k/2023.1-gcc11                            intel_oneapi/compiler32/2024.1.0          lammps/2024.02.07
cp2k/2024.1-gcc11                            intel_oneapi/compiler32/latest            lapack/3.11.0-gcc11
cuda/11.0-cvmfs                              intel_oneapi/dal/2024.0.0                 lume-astra/0.6.1
cuda/11.1-cvmfs                              intel_oneapi/dal/latest                   molpro/2015-gcc11
cuda/11.2-cvmfs                              intel_oneapi/debugger/2024.1.0            mpi/mpich/4.1.3
cuda/11.7-cvmfs                              intel_oneapi/debugger/latest              mpi/mpich/4.2.1
cuda/12.2-cvmfs                              intel_oneapi/dev-utilities/2024.0.0       mpi/mvapich/2.3.7
cuda/12.4                                    intel_oneapi/dev-utilities/latest         mpi/mvapich/3.4.3
cuda/12.4-cvmfs                              intel_oneapi/dnnl/3.4.0                   openmpi/4.1.4-gcc11
cuDNN/8.0.5-cuda11.0                         intel_oneapi/dnnl/latest                  orca/5.0.4-gcc11
cuDNN/8.1.1-cuda11                           intel_oneapi/dpct/2024.1.0                python/2.7.18
cuDNN/8.9.7-cuda11                           intel_oneapi/dpct/latest                  python/3.7.16
cuDNN/8.9.7-cuda12                           intel_oneapi/dpl/2022.5                   python/3.8.19
cuDNN/9.0.0-cuda11                           intel_oneapi/dpl/latest                   python/3.9.18
cuDNN/9.0.0-cuda12                           intel_oneapi/ifort/2024.1.0               python/3.10.14
elegant/1.0                                  intel_oneapi/ifort/latest                 python/3.11.8
epics/7.0.7                                  intel_oneapi/ifort32/2024.1.0             python/3.12.2
fftw/3.3.10-gcc11                            intel_oneapi/ifort32/latest               pytorch/2.0.1-cu117-py310
gcc/7.5.0                                    intel_oneapi/intel_ipp_ia32/2021.11       pytorch/2.2.0-cu121-py310
gcc/9.5.0                                    intel_oneapi/intel_ipp_ia32/latest        quickpic/develop
gcc/10.4.0                                   intel_oneapi/intel_ipp_intel64/2021.11    scalapack/2.2.1
gcc/11.4.0                                   intel_oneapi/intel_ipp_intel64/latest     scow/1.0
gcc/12.3.0                                   intel_oneapi/intel_ippcp_ia32/2021.11     tensorflow/2.4.0-cu110-py38
gimic/2.0                                    intel_oneapi/intel_ippcp_ia32/latest      tensorflow/2.11.0-cu112-py310
gromacs/2023.4-gcc11                         intel_oneapi/intel_ippcp_intel64/2021.11  tensorflow/2.15.0-cu122-py310
hdf5/1.10.11                                 intel_oneapi/intel_ippcp_intel64/latest   tensorflow/2.16.1-cu123-py310
intel_oneapi/advisor/2024.1                  intel_oneapi/mkl/2024.1                   TensorRT/7.2.3.4-cuda11.0-cudnn8.1
intel_oneapi/advisor/latest                  intel_oneapi/mkl/latest                   TensorRT/7.2.3.4-cuda11.1-cudnn8.1
intel_oneapi/ccl/2021.12.0                   intel_oneapi/mkl32/2024.1                 TensorRT/8.6.1.6-cuda11.8
intel_oneapi/ccl/latest                      intel_oneapi/mkl32/latest                 TensorRT/8.6.1.6-cuda12.0
intel_oneapi/compiler-intel-llvm/2024.1.0    intel_oneapi/mpi/2021.12                  TensorRT/10.0.1.6-cuda11.8
intel_oneapi/compiler-intel-llvm/latest      intel_oneapi/mpi/latest                   TensorRT/10.0.1.6-cuda12.4
intel_oneapi/compiler-intel-llvm32/2024.1.0  intel_oneapi/oclfpga/2024.1.0             tfpwa/tf2.4.0
intel_oneapi/compiler-intel-llvm32/latest    intel_oneapi/oclfpga/latest               vmd/1.9.4
intel_oneapi/compiler-rt/2024.1.0            intel_oneapi/tbb/2021.12                  warpx/24.02
intel_oneapi/compiler-rt/latest              intel_oneapi/tbb/latest

3 加载软件环境

module load <module_file>
# 例如:
module load cmake/3.18.4
# 查看加载的cmake 路径
which cmake
/cvmfs/slurm.ihep.ac.cn/alma9/anaconda3/envs/cmake-3.18.4/bin/cmake

4 查看已加载软件

module list
Currently Loaded Modulefiles:
 1) cmake/3.18.4

5 卸载软件环境

# 卸载指定的软件环境
module unload <module_file>
# 例如:
module unload cmake/3.18.4

# 卸载所有加载的软件环境
module purge

6 查看module命令帮助

module help
Modules Release 5.3.0 (2023-05-14)
Usage: module [options] [command] [args ...]

Loading / Unloading commands:
  add | load      modulefile [...]  Load modulefile(s)
  try-add | try-load modfile [...]  Load modfile(s), no complain if not found
  add-any | load-any modfile [...]  Load first available modulefile in list
  rm | unload     modulefile [...]  Remove modulefile(s)
  purge                             Unload all loaded modulefiles
  reload                            Unload then load all loaded modulefiles
  switch | swap   [mod1] mod2       Unload mod1 and load mod2
  refresh                           Refresh loaded module volatile components
  reset                             Restore initial environment

Listing / Searching commands:
  list   [-a] [-t|-l|-j] [-S|-C] [mod ...]
                                    List all or matching loaded modules
  avail  [-a] [-t|-l|-j] [-S|-C] [-d|-L] [--indepth|--no-indepth] [mod ...]
                                    List all or matching available modules
  aliases         [-a]              List all module aliases
  whatis [-a] [-j] [modulefile ...] Print whatis information of modulefile(s)
  apropos | keyword | search [-a] [-j] str
                                    Search all name and whatis containing str
  is-loaded       [modulefile ...]  Test if any of the modulefile(s) are loaded
  is-avail        modulefile [...]  Is any of the modulefile(s) available
  info-loaded     modulefile        Get full name of matching loaded module(s)

...

results matching ""

    No results matching ""