# .bashrc for host-specific initialization # user can turn on/off package initializations for specific hosts # this is useful for example in case of MPI, where we have 2-3 distributions per cluster # and user can select the one that he preferes as a default # please send comments/suggestions to mcuma@chpc.utah.edu # currently works on all CHPC based clusters (Linux and OSF) and on Linux desktops # First we test if UUFSCELL variable is defined on the machine level, and if it # is, use it for initialization #set -nv # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi #MC if UUFSCELL is not defined, try to source it #if [ -z "$TERM" ] ; then if [ -z "$UUFSCELL" ] ; then if [ -e /etc/profile.d/uufs.sh ] ; then . /etc/profile.d/uufs.sh fi fi if [ -n "$UUFSCELL" ] ; then GRP=`echo $UUFSCELL | cut -d . -f 2` if [[ "$GRP" = "arches" ]] ; then # Commenting/uncommenting source lines below will disable/enable specified packages # Packages not specified do not require shell modifications, but you may have to point # to /uufs/landscape.arches/sys/bin, lib or include in order to use them # stacksize by default is very small, which causes programs with large static data to segfault ulimit -s unlimited # echo On $UUFSCELL # create .pbs_spool if not created already if [ ! -d $HOME/.pbs_spool ] ; then mkdir $HOME/.pbs_spool fi # default path addon export PATH="/uufs/arches/sys/bin:/uufs/$UUFSCELL/sys/bin:$PATH" if [ -z "${MANPATH}" ] then export MANPATH="/uufs/arches/sys/bin:/uufs/$UUFSCELL/sys/man:`manpath`" else export MANPATH="/uufs/arches/sys/bin:/uufs/$UUFSCELL/sys/man:$MANPATH" fi #source PGI defines source /uufs/arches/sys/pkg/pgi/std/etc/pgi.sh #source Pathscale defines source /uufs/arches/sys/pkg/pscale/std/etc/pscale.sh # Cambridge Structural Database # source /uufs/arches/sys/pkg/CSD/std/cambridge/etc/csd.bash # Matlab source /uufs/arches/sys/pkg/matlab/std/etc/matlab.sh # VMD # export PATH="/uufs/arches/sys/pkg/vmd/vmd-std:$PATH" fi #--------------------------------------------------------------------- # do Landscape specific initializations if [[ "$UUFSCELL" = "landscapearch.arches" ]] ; then # source MPICH2 defines source /uufs/arches/sys/pkg/mpich2/std/etc/mpich2.sh export LD_LIBRARY_PATH="/uufs/landscapearch.arches/sys/pkg/mx-2g/std/lib64:$LD_LIBRARY_PATH" # additional user customizations below here #----------------------------------------------------------------------------- # Do Tunnelarch specific initializations elif [[ "$UUFSCELL" = "tunnelarch.arches" ]] ; then # source MPICH2 defines source /uufs/arches/sys/pkg/mpich2/std/etc/mpich2.sh # additional user customizations below here #----------------------------------------------------------------------------------- # Do Delicatearch specific initializations elif [[ "$UUFSCELL" = "delicatearch.arches" ]] ; then # set path for MPICH-MX export PATH="/uufs/delicatearch.arches/sys/pkg/mpich-mx/std/bin:$PATH" # additional user customizations below here export LD_LIBRARY_PATH="/uufs/delicatearch.arches/sys/pkg/mx-2g/std/lib64:$LD_LIBRARY_PATH" #-------------------------------------------------------------------------------------- # Do Marchingmen specific initializations elif [[ "$UUFSCELL" = "marchingmen.arches" ]] ; then # source MPICH2 defines source /uufs/arches/sys/pkg/mpich2/std/etc/mpich2.sh #-------------------------------------------------------------------------------------- # Do Sanddunearch specific initializations elif [[ "$UUFSCELL" = "sanddunearch.arches" ]] ; then # source mpich2 defines source /uufs/sanddunearch.arches/sys/pkg/mvapich/std/etc/mvapich.sh # source /uufs/sanddunearch.arches/sys/pkg/mvapich2/std/etc/mvapich2.sh # source /uufs/sanddunearch.arches/sys/pkg/openmpi/std/etc/openmpi.sh # Do Turretarch specific initializations elif [[ "$UUFSCELL" = "turretarch.arches" ]] ; then export SSIHLM=/uufs/turretarch.arches/sys/pkg/hlm/std # Do Hiddenarch specific initializations elif [[ "$UUFSCELL" = "hiddenarch.arches" ]] ; then met_include=met_include.sh wget -q -t 1 -O ~/$met_include http://www.chpc.utah.edu/docs/manuals/getting_started/code/$met_include # file length no matter what - in the worst case the file is not there, fl=0 and no init file_length=`wc -l ~/$met_include | cut -f1 -d/` # Count Lines fl=`expr $file_length + 0` # Change Type #MC long if section in case we did find linux.ips, if [[ -e $HOME/$met_include && $fl -gt 0 ]] ; then source $HOME/$met_include fi source /uufs/arches/sys/pkg/intel/ifort/std/bin/ifortvars.sh source /uufs/arches/sys/pkg/intel/icc/std/bin/iccvars.sh # Do Telluride specific initializations elif [[ "$UUFSCELL" = "telluride.arches" ]] ; then source /uufs/arches/sys/pkg/mkl/std/tools/environment/mklvarsem64t.sh source /uufs/arches/sys/pkg/intel/ifort/std/bin/ifortvars.sh source /uufs/arches/sys/pkg/intel/icc/std/bin/iccvars.sh export MPI_SHELL="/usr/bin/rsh" # Do stats specific initializations elif [[ "$UUFSCELL" = "stats" ]] ; then ulimit -s unlimited # default path addon export PATH="/uufs/arches/sys/bin:/uufs/$UUFSCELL/sys/bin:$PATH" fi # End of initializations when UUFSCELL is defined else # below define your own machine(s), in case they mount your home on the same fileserver # as the CHPC machines MYMACHINE="" # find out what OS we are running, inits are specific for those because # hostname uses different flags to return useful data based on the OS MYOS=`uname` ###################################################################### # Start machine specific initializations ###################################################################### #--------------------------------------------------------------------- # Do Linux specific initializations #--------------------------------------------------------------------- if [ "$MYOS" = "Linux" ] ; then # Find host-specific string. It is first 3 numbers of the host's IP MYHOST=`hostname -i | cut -f 1-3 -d .` # Problem with Arches is, that all login nodes are on 172.17.10 net # we also save full IP and test if it's not one of the 6 login nodes # This is also used for user specified machine (e.g. desktop mounting # file server as a home) MYIP=`hostname -i | awk '{print $1}'` # echo On other host, $MYHOST # define hosts # for other (Linux) hosts, define a string with IP range here # we are getting the IP host list from CHPC's webserver # this enables us to change the IPs of the machines if necessary without # breaking this script # Myrinet's mpirun complains about unknown vars. ICEBOX1,... - probably # does not source the file, but, direct ssh works OK # when disable wget and linuxips.sh is there, all is good ips_file=linuxips.sh if [ -n "$TERM" ] ; then # wget -t 1 -N -q http://www.chpc.utah.edu/for_users/scripts/linuxips.sh wget -q -O ~/$ips_file http://www.chpc.utah.edu/for_users/scripts/$ips_file fi # file length no matter what - in the worst case the file is not there, fl=0 and no init file_length=`wc -l ~/$ips_file | cut -f1 -d/` # Count Lines fl=`expr $file_length + 0` # Change Type #MC a long if section in case we did find linux.ips, if [[ -e $HOME/linuxips.sh && $fl -gt 0 ]] ; then source $HOME/linuxips.sh #--------------------------------------------------------------------- # Do Slickrock specific initializations if [ "$MYHOST" = "$SROCK1" ] ; then # additional user customizations below here : #-------------------------------------------------------------------------------------- # Do MYMACHINE specific initializations elif [ "$MYIP" = "$MYMACHINE" ] ; then # additional user customizations below here # any echo breaks the non-interactive terminal (scp) if [ -n "$TERM" ] ; then : fi else if [ -n "$TERM" ] ; then echo Dont know this computer fi fi # if the IP file list was not found, we skipped all host specific init else echo "No IP alias file found, most likely due to CHPC webserver being down" echo "No host-specific environment is defined in this session" fi #--------------------------------------------------------------------- # Do OSF (Sierra) specific initializations #--------------------------------------------------------------------- elif [ "$MYOS" = "OSF1" ] ; then set SIERRA sierra # Find host-specific string. It is first 6 characters of the host name for OSF set MYHOST = `hostname | cut -c 1-6` #--------------------------------------------------------------------- # Do Sierra specific initializations if [ "$MYHOST" ="$SIERRA" ] ; then # echo I am on Sierra export PATH="/uufs/sierra/sys/pkg/tv/std/bin:$PATH" fi fi # from UUFSCELL fi # User defined global terminal customizations valid also for non-interactive # terminals (PBS, MPI) # Get out if terminal is not interactive #if [ -n "$USER" || -n "$TERM" ] ; then #- this does not work if [ ! -n "$TERM" ] ; then exit fi # User defined global terminal customizations valid only on interactive terminals #set prompt = "[$USER@%m:%b%c2]%b " #PS1="[\$(date +%H%M)][\u@\h:\w]\$" PS1="[\u@\h:\W]\$ " set autolist # list completions when the tab key is hit #load aliases #source ~/.aliases