source: /cluster/svnroot/bccd-ng/branches/sam-test_fw/packages/etc/skel/.bash_profile @ 3072

Last change on this file since 3072 was 3072, checked in by leemasa, 10 years ago

re #524:
Added support for automatic shutdown w/o password, added code to automatically shut down after test suite
Made a file, /bccd_boot_flags that populates with boot flags from the NIC on startup. Now accessing boot flags is as simple as source /bccd_boot_flags.

File size: 1.8 KB
Line 
1# ~/.BASH_profile: executed by bash(1) for login shells.
2# see /usr/share/doc/bash/examples/startup-files for examples.
3# the files are located in the bash-doc package.
4
5# the default umask is set in /etc/login.defs
6#umask 022
7
8# include .bashrc if it exists
9#if [ -f ~/.bashrc ]; then
10#    . ~/.bashrc
11#fi
12
13if [ -f /bccd_boot_flags ]; then
14    source /bccd_boot_flags
15fi
16
17# set PATH so it includes user's private bin if it exists
18if [ -d ~/bin ] ; then
19    PATH=~/bin:"${PATH}"
20fi
21
22if [ -f $HOME/.firstlogin ]; then
23        $HOME/.firstlogin
24        mv $HOME/.firstlogin{,.moved}
25fi
26
27# Set MANPATH correctly
28export MANPATH=`/bin/bccd-getman`
29
30. /usr/local/Modules/3.2.6/init/bash
31#module load modules/remote-bccd
32module load modules
33module load PSC_DX cuda dreamm fftw openmpi jre mcell mpe xmpi c3
34
35# Alias some MPI commands to get X-forwarding working properly.
36alias mpirun='runmpi'
37alias mpiexec='runmpi'
38
39function runmpi () {
40        module list 2>&1 | egrep -q '[[:space:]]openmpi\/'
41        OMPI=$?
42        module list 2>&1 | egrep -q '[[:space:]]mpich2\/'
43        MPICH=$?
44
45        if [ $OMPI -eq 0 ]; then
46                OPTS="-x DISPLAY=`hostname -s`:0.0"
47        elif [ $MPICH -eq 0 ]; then
48                OPTS="-genv DISPLAY `hostname -s`:0.0"
49        fi
50
51        `which mpirun` $OPTS $@
52        return $?
53}
54
55if [ $DISPLAY ]; then
56        xhost + > /dev/null 2>&1
57fi
58
59if [ -f /testmode -a -z "$DISPLAY" ]; then
60        startx
61fi
62
63if [ `tty` == "/dev/pts/0" -a $HOSTNAME == "node000.bccd.net" ]; then
64if [ $BUILD_CONTROL == '1' ]; then
65echo "initiating automatic control generation
66some tests may take a little while"
67
68perl $HOME/tests/bccd_test_suite.pl -c --verbose --messy --mail
69echo "Please email developers@bccd.net
70and state that you have run the iso.
71Control generation complete."
72else
73echo "initiating test suite"
74perl $HOME/tests/bccd_test_suite.pl --verbose --messy --mail
75echo "test suite completed"
76fi
77echo "Ctrl-C to cancel automatic shutdown"
78sudo shutdown -h 1
79fi
80
Note: See TracBrowser for help on using the repository browser.