User customization with module

Example of environment configuration for Octave application installed on the example Example of a User application Installation page.

Login on the submit node

Login on the cluster submition node, check the page How to Access for more information:

$ ssh -l <username> hpc7.ncg.ingrid.pt
[username@hpc7 ~]$ _
Select a directory to store your modules environments

In this example we will use ~/.module on the user Home directory:

[username@hpc7 ~]$ mkdir .module
Create a modules resource file

Create a file named ~/.modulerc with the following content:

[username@hpc7 ~]$ cat .modulerc
#%Module1.0#####################################################################
##
## User prefer modules at session startup
##
module use $env(HOME)/.module
Create a configuration file for Octave application

Lets create a simple configution file for the Octave application installed on the Home directory:

[username@hpc7 ~]$ mkdir .module/octave
[username@hpc7 ~]$ cat .module/octave/5.1.0
#%Module1.0
##
## octave/5.1.0 modulefile
##

proc ModulesHelp { } {
        global version
        puts stderr "\tSets up Octave"
        puts stderr "\n\tVersion $version\n"
}

module-whatis "Sets up Octave"

set version	5.1.0
set modroot	/home/hpc/jmartins/soft/octave/$version

setenv 			OCTAVE_HOME		$modroot
prepend-path	PATH			$modroot/bin
prepend-path	CPATH			$modroot/include
prepend-path	LD_LIBRARY_PATH	$modroot/lib
prepend-path	PKG_CONFIG_PATH	$modroot/lib/pkgconfig
Check the new modules environment

The next time you login on server you will find your environment profile available for normal usage:

[username@hpc7 ~]$ module avail
------------------- /home/hpc/jmartins/.module -------------------
octave/5.1.0

------------------- /cvmfs/sw.el7/modules/soft -------------------
aster-13.1.0                 gromacs-4.6.7
blat-36.2                    hdf5-1.8.16
....
Manage your new modules environment
[username@hpc7 ~]$ module load octave/5.1.0

[username@hpc7 ~]$ which octave
/home/mygroup/username/soft/octave/5.1.0

[username@hpc7 ~]$ octave
octave:1> grid		# a GRID plot will popup
octave:2> exit

[username@hpc7 ~]$ module unload octave/5.1.0

[username@hpc7 ~]$ which octave
<empty>