Environment variables on the shark cluster
As on any UNIX/LINUX platform, you can set environment variables using your regular shell commands such as export. Please note, that setting an environment variable interactively only affects the active shell. Especially, if you launch a parallel job on a PC cluster such as shark, those settings are not necessarily transfered to the other nodes. In order to have environment variables, including PATH and LD_LIBRARY_PATH set properly, you should add them to your batch startup script. In the following, we suggest an approach for you bash startup .
On an interactive login, bash reads either the .bash_profile or the .bash_login script from the users home directory. On a non-interactive job, bash reads the .bashrc file. The latter file is therefore of importance for most MPI libraries using ssh to start the remote processes. To avoid that you have to set every variable twice, we recommend that you set a soft link from your .bashrc file to the .bash_profile file. Please make sure, that your .bashrc file does not source .bash_profile, since this would lead to an infinite loop. In the following, we assume that this soft link has been set and explain therefore all settings only for the .bashrc file
smith@shark:~>ln -s .bashrc .bash_profile
A sample .bashrc file could therefore look as follos:
export SVN_EDITOR=emacs export PATH=/opt/SLURM/bin:$PATH export LD_LIBRARY_PATH=/opt/SLURM/lib:$LD_LIBRARY_PATH export MANPATH=/opt/gcc-4.1/man:/opt/SLURM/man/:$MANPATH #enable gcc-4.1 export PATH=/opt/gcc-4.1/bin/:$PATH export LD_LIBRARY_PATH=/opt/gcc-4.1/lib64:$LD_LIBRARY_PATH #enable Open MPI export PATH=/opt/OpenMPI-1.1/bin:$PATH export LD_LIBRARY_PATH=/opt/OpenMPI-1.1/lib/:$LD_LIBRARY_PATH
