Modules

From HPC

(Difference between revisions)
Jump to: navigation, search
(Using modules in scripts)
(Show available modules)
Line 27: Line 27:
  module avail
  module avail
-
This would display something similar to this (Note: not all these are licensed, please see [[Available Software]] for a list)
+
This would display something similar to this  
-
  ------------------------------ /usr/share/modules ------------------------------
+
 
-
3.1.6                                modulefiles/mkl/10.0.3.020/64
+
  -------------------------------------------- /usr/local/modulefiles ---------------------------------------------
-
modulefiles/atlas                    modulefiles/mkl/10.0.3.020/em64t
+
  dot gcc/6.5.gcc/7.4.0 module-git module-info modules null  R/3.4.1  R/3.4.4 R/3.5.2 R/3.5.3 use.own
-
modulefiles/dot                      modulefiles/module-cvs
+
-
modulefiles/intel/compiler101_ia32  modulefiles/module-info
+
-
modulefiles/intel/compiler101_x86_64 modulefiles/modules
+
-
modulefiles/intel/compiler91_ia32    modulefiles/mpich2
+
-
modulefiles/intel/compiler91_x86_64  modulefiles/null
+
-
modulefiles/java/i586/j2sdk1.4.2_17  modulefiles/openmpi/1.2.6-1/gcc
+
-
modulefiles/java/i586/jdk1.5.0_15    modulefiles/openmpi/1.2.6-1/intel
+
-
modulefiles/java/i586/jdk1.6.0_06    modulefiles/openmpi/1.2.6-1/path
+
-
modulefiles/java/x86_64/jdk1.5.0_15  modulefiles/openmpi/1.2.6-1/pgi
+
-
modulefiles/java/x86_64/jdk1.6.0_06  modulefiles/pgi/7.1-4_linux86
+
-
modulefiles/local_libs              modulefiles/pgi/7.1-4_linux86-64
+
-
modulefiles/mkl/10/32                modulefiles/pgi/7.1_linux86
+
-
modulefiles/mkl/10/64                modulefiles/pgi/7.1_linux86-64
+
-
modulefiles/mkl/10/em64t            modulefiles/score
+
-
modulefiles/mkl/10.0.3.020/32        modulefiles/use.own
+
-
+
-
------------------------ /usr/share/modules/modulefiles ------------------------
+
-
  atlas                    local_libs              null
+
-
  dot                      mkl/10/32                openmpi/1.2.6-1/gcc
+
-
intel/compiler101_ia32  mkl/10/64                openmpi/1.2.6-1/intel
+
-
  intel/compiler101_x86_64 mkl/10/em64t            openmpi/1.2.6-1/path
+
-
  intel/compiler91_ia32    mkl/10.0.3.020/32        openmpi/1.2.6-1/pgi
+
-
  intel/compiler91_x86_64 mkl/10.0.3.020/64        pgi/7.1-4_linux86
+
-
  java/i586/j2sdk1.4.2_17 mkl/10.0.3.020/em64t    pgi/7.1-4_linux86-64
+
-
java/i586/jdk1.5.0_15    module-cvs              pgi/7.1_linux86
+
-
  java/i586/jdk1.6.0_06    module-info              pgi/7.1_linux86-64
+
-
java/x86_64/jdk1.5.0_15  modules                  score
+
-
java/x86_64/jdk1.6.0_06 mpich2                  use.own
+
==Load a module==
==Load a module==

Revision as of 16:27, 3 April 2019

Contents

Modules

Modules are a tool to allow you to change the working enviroment to support various application and version of those applications.

It allows use for example to support three versions of java and 32bit and 64 version of each. This equates to 6 different versions, using modules you can load the one you want to use or unload the ones you don't.

Commands

Help

module help

Show currently loaded modules

module list

Example

> module list
Currently Loaded Modulefiles:
 1) openmpi/1.2.6-1/intel      3) mkl/10/em64t
 2) intel/compiler101_x86_64   4) local_libs
>

Show available modules

module avail

This would display something similar to this


-------------------------------------------- /usr/local/modulefiles ---------------------------------------------
dot  gcc/6.5.0  gcc/7.4.0  module-git  module-info  modules  null  R/3.4.1  R/3.4.4  R/3.5.2  R/3.5.3  use.own

Load a module

module load modulename

For example

module load java/x86_64/jdk1.5.0_15

Unload a module

module unload modulename

For example

module unload java/x86_64/jdk1.5.0_15

Using module command in your scripts

To use the module command in you bash scripts you must first intialise it within you script using the following line

. ${MODULESHOME}/init/sh

For example

#!/bin/bash
. ${MODULESHOME}/init/sh
module list
module load java/x86_64/jdk1.6.0_06
module list
Personal tools