# .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 [ -n "$BASHRC_LOADED" ] ; then if [[ "$TERM" != "screen" || `groups $USER | grep " sdss"` == "" ]] ; then return fi fi export BASHRC_LOADED=1 if [[ "$GRP" = "arches" || "$GRP" = "bridges" || "$GRP" = "peaks" ]] ; 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/chpc.utah.edu/sys/bin:/uufs/$UUFSCELL/sys/bin:$PATH" if [ -z "${MANPATH}" ] then export MANPATH="/uufs/chpc.utah.edu/sys/bin:/uufs/$UUFSCELL/sys/man:`manpath`" else export MANPATH="/uufs/chpc.utah.edu/sys/bin:/uufs/$UUFSCELL/sys/man:$MANPATH" fi #source PGI defines source /uufs/chpc.utah.edu/sys/pkg/pgi/std/etc/pgi.sh #source Intel compilers environment - includes icc, ifort, mkl, idb, tbb source /uufs/chpc.utah.edu/sys/pkg/intel/ics/bin/compilervars.sh intel64 # Cambridge Structural Database # source /uufs/chpc.utah.edu/sys/pkg/CSD/std/cambridge/etc/csd.bash # Matlab source /uufs/chpc.utah.edu/sys/pkg/matlab/std/etc/matlab.sh # VMD # export PATH="/uufs/chpc.utah.edu/sys/pkg/vmd/vmd-std/bin:$PATH" fi #--------------------------------------------------------------------- # Do Ember specific initializations if [[ "$UUFSCELL" = "ember.arches" ]] ; then # source PGI which is different for RH6 source /uufs/chpc.utah.edu/sys/pkg/pgi/std_rh6/etc/pgi.sh # source mpich2 defines source /uufs/ember.arches/sys/pkg/mvapich2/std/etc/mvapich2.sh # source /uufs/ember.arches/sys/pkg/openmpi/std/etc/openmpi.sh #--------------------------------------------------------------------- # Do Kingspeak specific initializations elif [[ "$UUFSCELL" = "kingspeak.peaks" ]] ; then # source PGI which is different for RH6 source /uufs/chpc.utah.edu/sys/pkg/pgi/std_rh6/etc/pgi.sh # source mpich2 defines source /uufs/kingspeak.peaks/sys/pkg/mvapich2/std/etc/mvapich2.sh # source /uufs/kingspeak.peaks/sys/pkg/openmpi/std/etc/openmpi.sh #--------------------------------------------------------------------- # Do Lonepeak specific initializations elif [[ "$UUFSCELL" = "lonepeak.peaks" ]] ; then # source PGI which is different for RH6 source /uufs/chpc.utah.edu/sys/pkg/pgi/std_rh6/etc/pgi.sh # source mpich2 defines source /uufs/chpc.utah.edu/sys/pkg/mpich2/std/etc/mpich2.sh #--------------------------------------------------------------------- # Do Ash specific initializations elif [[ "$UUFSCELL" = "ash.peaks" ]] ; then # source PGI which is different for RH6 source /uufs/chpc.utah.edu/sys/pkg/pgi/std_rh6/etc/pgi.sh # source mpich2 defines source /uufs/ash.peaks/sys/pkg/mvapich2/std/etc/mvapich2.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" || "$UUFSCELL" = "chpc.utah.edu" ]] ; then met_include=met_include.sh wget -q -T 4 -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 # in case transfer failed (file is there but size 0), get backup file if [[ -e $HOME/$met_include && $fl -eq 0 ]] ; then cp $HOME/$met_include.bak $HOME/$met_include file_length=`wc -l ~/$met_include | cut -f1 -d/` # Count Lines fl=`expr $file_length + 0` # Change Type fi #MC long if section in case we did find linux.ips, if [[ -e $HOME/$met_include && $fl -gt 0 ]] ; then cp $HOME/$met_include $HOME/$met_include.bak source $HOME/$met_include fi # Do Telluride specific initializations elif [[ "$UUFSCELL" = "telluride.arches" ]] ; then export MPI_SHELL="/usr/bin/rsh" #-------------------------------------------------------------------------------------- # Do Apex arch (HIPPA cluster) specific initializations elif [[ "$UUFSCELL" = "apexarch.bridges" ]] ; then : # source MPICH2 defines # this causes problems with FastX connect # source /uufs/chpc.utah.edu/sys/pkg/mpich2/std/etc/mpich2.sh #-------------------------------------------------------------------------------------- # Do astro.utah.edu specific initializations elif [[ "$UUFSCELL" = "astro.utah.edu" ]] ; then # source MPICH2 defines source /uufs/chpc.utah.edu/sys/pkg/mpich2/std/etc/mpich2.sh # source IDL source /uufs/chpc.utah.edu/sys/pkg/idl/7.0/etc/idl.sh source /uufs/astro.utah.edu/sys/pkg/sm/std/etc/sm.sh # Do stats specific initializations elif [[ "$UUFSCELL" = "stats" ]] ; then ulimit -s unlimited # default path addon export PATH="/uufs/chpc.utah.edu/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 4 -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 MYMACHINE specific initializations if [ "$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 if [ -n "$TERM" ] ; then 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 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 return 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 if [[ `groups $USER | grep " sdss"` != "" ]] ; then source /uufs/chpc.utah.edu/sys/pkg/modules/init/bash fi