wiki:Modules

Version 4 (modified by trac, 12 years ago) ( diff )

Modules

We use modules on the machine grass.pas.rochester.edu. Here is some information on how to use modules:

.bashrc

Start by placing the following line in your .bashrc file. This line will get executed whenever you login to grass:

module load ifort hdf5 openmpi visit fftw3

Other available modules include mpich2 pgplot.

Module commands

Here are the module commands you should know:

module availsee what modules are available
module listsee what modules you have loaded
module load module1load "module1" for this session
module unload module1unload "module1" for this session
module switch [module1] module2replace "module1" with "module2". If module1 is not specified, it will assume you're swapping different versions of a module
module purgeunload all loaded modules
module help module1shows information about module module1

Setting up a new Module

You need to be root in order to setup or modify Modules. On grass, the module files are located in

/opt/modules/Modules/3.2.6/modulefiles/

If there is only a single version of the Module (such as with pgplot), you can place a Modules file here. If there are multiple versions, a subdirectory is necessary.

Within the subdirectory, there should be separate files for each version, as well as a .version file which sets the default version.

Below are examples from the /opt/modules/Modules/3.2.6/modulefiles/hdf5 directory.

root@grass> ls -la
 total 24
 drwxr-xr-x 2 root root 4096 2009-05-05 17:52 .
 drwxr-xr-x 9 root root 4096 2010-03-15 16:11 ..
 -rw-r--r-- 1 root root  286 2009-02-09 14:04 1.6.5b
 -rw-r--r-- 1 root root  283 2009-05-05 17:55 1.8.1
 -rw-r--r-- 1 root root  327 2009-02-09 14:50 gfort
 -rw-r--r-- 1 root root   48 2009-05-05 21:12 .version
root@grass> cat 1.8.1
 #%Module1.0
 #
 # HDF5, Version 1.8.1 module file
 # by Kris Yirak
 #
 #
 proc ModulesHelp { } {
 	puts stderr "\tHDF5 - loads the HDF5 libraries\n"
 }
 
 module-whatis	"loads the hdf5 libraries"
 prepend-path	LD_LIBRARY_PATH		/usr/local/hdf5-1.8.1/lib
 setenv		HDF5PATH		/usr/local/hdf5-1.8.1
root@grass> cat .version
 #%Modules1.0
 #
 #
 #

 set ModulesVersion "1.6.5b"
Note: See TracWiki for help on using the wiki.