Cisco Systems ST373307LC Computer Drive User Manual


 
7-6
Cisco SFS InfiniBand Host Drivers User Guide for Linux
OL-12309-01
Chapter 7 MVAPICH MPI
Editing Environment Variables
Setting Environment Variables in System-Wide Startup Files
This method is used to set a system-wide default for which MPI implementation is used. This method is
the easiest for end users; users who log in automatically have MPI implementations set up for them
without executing any special commands to find MPI executables, such as mpirun or mpicc. The
example below describes how to set up MVAPICH in system-wide startup files.
The following example shows how to make two system-wide shell startup files (one for Bourne shell
variants and one for C shell variants) that set up all users to use MVAPICH. These commands must be
run by the superuser on all nodes where MPI is used:
host1# echo ’export PATH=/usr/local/topspin/mpi/mpich/bin:$PATH’ > /etc/profile.d/mpi.sh
host1# echo ’set path = (/usr/local/topspin/mpi/mpich/bin $path)’ > /etc/profile.d/mpi.csh
host1# chmod 755 /etc/profile.d/mpi.sh /etc/profile.d/mpi.csh
Editing Environment Variables in the Users Shell Startup Files
This method allows users to have their own preference of which MPI to use, but it requires that users
manually modify their own shell startup files. Individual users can use this method to override the system
default MPI implementation selection.
All shells have some type of script file that is executed at login time to set environment variables (such
as PATH and LD_LIBRARY_PATH) and perform other environmental setup tasks. While your system
may be different, Table 7-1 lists some common shells and the startup files that might require edits to set
up MPI upon login.
The following example shows how to edit the shell startup files of a user to use MVAPICH. If the user
uses the Bourne or Bash shell, edit the startup file after referring to Table 7-1 on all nodes where the user
uses MPI, and add the following line:
export PATH=/usr/local/topspin/mpi/mpich/bin:$PATH
If the user uses the C or T shell, edit the startup file after referring to Table 7-1, and add the following
line:
set path = (/usr/local/topspin/mpi/mpich/bin $path)
Table 7-1 Common Shells and Startup Files
Shell Startup File to Edit
sh (Bourne shell, or bash named sh) $HOME/.profile
csh $HOME/.cshrc
tcsh $HOME/.tcshrc if it exists, or $HOME/.cshrc if it
does not
bash $HOME/.bashrc if it exists, or
$HOME/.bash_profile if it exists, or
$HOME/.profile if it exists (in that order)