Using source command

The /softs/environments directory contains the whole files you can use with source command in order to compile your program according to compilers and MPI libraries you want to use :

[user@cicada1 ~]$ ls -l /softs/environments/
total 20
-rw-r--r-- 1 root root 150 Sep 27 22:04 env_intel-12.1.csh
-rw-r--r-- 1 root root 146 Sep 27 22:03 env_intel-12.1.sh
-rw-r--r-- 1 root root 150 Sep 27 22:05 env_intelmpi-4.0.sh
-rw-r--r-- 1 root root 346 Sep 27 22:09 env_openmpi-1.6.2_intel-12.1.csh
-rw-r--r-- 1 root root 230 Sep 27 22:08 env_openmpi-1.6.2_intel-12.1.sh

You must use the command source to change environment variables :

[user@cicada1 ~]$ source /softs/environments/env_intel-12.1.sh

For instance, you want to use Intel compilers installed on the cluster and your default shell is Bash (by default) :

[user@cicada2 ~]$ source /softs/environments/env_intel-12.1.sh

To verify :

[user@cicada2 ~]$ which icc
/usr/bin/which: no icc in (/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/lpp/mmfs/bin:/home/user/bin)
[user@cicada2 ~]$ source /softs/environments/env_intel-12.1.sh
[user@cicada2 ~]$ which icc
/softs/intel/composer_xe_2011_sp1.6.233/bin/intel64/icc

Files explanation :

  • /softs/environments/env_intel-12.1.* : loads the Intel compilers and libraries
  • /softs/environments/env_intelmpi-4.0.sh : loads the Intel MPI parallel environment with associated Intel compilers
  • /softs/environments/env_openmpi-1.6.2_intel-12.1.* : loads the OpenMPI parallel environment with associated Intel compilers

 

Using environment modules

For practical reasons, we recommend to use environment modules via the module command.

For more details :

This command allows to modify dynamically your environment variables (essentially PATH, LD_LIBRARY_PATH ou encore MAN_PATH) depending on the module you loaded.

Commands to know for environment modules

List of installed modules : module avail

[user@node070 ~](3305-->119mn)$ module avail

------------------------------------------------------------------------ /usr/share/Modules/modulefiles -------------------------------------------------------------------------
dot         module-cvs  module-info modules     null        use.own

------------------------------------------------------------------------------- /etc/modulefiles --------------------------------------------------------------------------------
cmake/2.8.9         intel/12.1          intelmpi/4.0        openmpi/1.4.3       openmpi/1.6.2       openmpi/intel/1.6.2

List of loaded modules : module list

[user@node070 ~](3305-->118mn)$ module list
Currently Loaded Modulefiles:
  1) cmake/2.8.9

To load a module : module load <module_name>

[user@node070 ~](3305-->118mn)$ module load cmake/2.8.9

To unload a module : module unload <module_name>

[user@node070 ~](3305-->116mn)$ module unload cmake/2.8.9

To purge the whole loaded modules : module purge

[user@node070 ~](3305-->115mn)$ module purge

To have some help about the module command : module --help

The modules naming is the following : <package name>/<package version>, for instance the module intelmpi/4.0 is for the Intel MPI version 4.0.

 

Address

Université de Nice Sophia-Antipolis
D.S.I.
28 Avenue de Valrose
B.P. 2135
06103 NICE Cedex 02