/[escript]/branches/windows_from_1456_trunk_1544_merged_in/autotest-scons
ViewVC logotype

Diff of /branches/windows_from_1456_trunk_1544_merged_in/autotest-scons

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/autotest-scons revision 739 by ksteube, Tue Jun 20 00:52:56 2006 UTC branches/windows_from_1456_trunk_1522_merged_in/autotest-scons revision 1523 by phornby, Tue Apr 22 06:15:31 2008 UTC
# Line 13  Line 13 
13  # be sure to copy it there and commit after modification  # be sure to copy it there and commit after modification
14  #  #
15    
 # TODO: should try using the entire node: scons -j $NCPUS all_tests  
 # I've been told this produces poor results...why?  
   
16  # Which tests should we run?  # Which tests should we run?
17  target='run_tests'  # Default scons target that runs the tests  target='run_tests'  # Default scons target that runs the tests
18  test "x$1" != "x" && target="$1"  test "x$1" != "x" && target="$1"
19    requested_cpus=2
20    test "x$target" = "xall_tests" && requested_cpus=4
21    
22  MAIL_RECIPIENTS="gross@esscc.uq.edu.au elspeth@esscc.uq.edu.au matt@esscc.uq.edu.au robert.woodcock@csiro.au Peter.Hornby@csiro.au k.steube@uq.edu.au"  MAIL_RECIPIENTS="l.gross@uq.edu.au matt@esscc.uq.edu.au robert.woodcock@csiro.au Peter.Hornby@csiro.au k.steube@uq.edu.au"
23  # MAIL_RECIPIENTS="k.steube@uq.edu.au"  # MAIL_RECIPIENTS="k.steube@uq.edu.au"
24    
25    # This time is when the job was submitted. If it waits in the queue it might run on another day.
26    # This date is also used to create the sandbox directory where the tests are run.
27  RunDate=`date '+%Y_%m_%d'`  # Time stamp for log file names  RunDate=`date '+%Y_%m_%d'`  # Time stamp for log file names
28    
29  WorkDir=/raid3/ksteube/AutoTests  WorkDir=/raid3/ksteube/AutoTests
# Line 41  SCRIPT_NAME=$0 Line 42  SCRIPT_NAME=$0
42  cat << EOF > Logs/$RunDate.pbs.script.sh  cat << EOF > Logs/$RunDate.pbs.script.sh
43  #!/bin/bash  #!/bin/bash
44    
45  #PBS -q q1  #PBS -q q80
46  #PBS -l ncpus=2  #PBS -N autotest
47    #PBS -l ncpus=$requested_cpus
48  #PBS -o $RunDate.pbs.stdout  #PBS -o $RunDate.pbs.stdout
49  #PBS -e $RunDate.pbs.stderr  #PBS -e $RunDate.pbs.stderr
50    #PBS -W umask=022
51    
52  echo "PBS_JOBNAME       \$PBS_JOBNAME"  echo "PBS_JOBNAME       \$PBS_JOBNAME"
53  echo "PBS_JOBID         \$PBS_JOBID"  echo "PBS_JOBID         \$PBS_JOBID"
# Line 54  echo "USER              \$USER" Line 57  echo "USER              \$USER"
57  echo "PBS_O_HOST        \$PBS_O_HOST"  echo "PBS_O_HOST        \$PBS_O_HOST"
58  echo "PBS_O_WORKDIR     \$PBS_O_WORKDIR"  echo "PBS_O_WORKDIR     \$PBS_O_WORKDIR"
59  echo "PBS_O_SHELL       \$PBS_O_SHELL"  echo "PBS_O_SHELL       \$PBS_O_SHELL"
60    date
61  echo ""  echo ""
62  echo ""  echo ""
63    
# Line 62  echo "" Line 66  echo ""
66  START=\`date '+%Y/%m/%d %H:%M'\`  START=\`date '+%Y/%m/%d %H:%M'\`
67    
68  finish () {  finish () {
69      # state will be 'FAILURE' or 'SUCCESS'
70      state="\$1"
71      date
72      # Clean up the sandbox
73      cd $WorkDir
74      /bin/rm -rf sandbox.$RunDate
75    END=\`date '+%Y/%m/%d %H:%M'\`    END=\`date '+%Y/%m/%d %H:%M'\`
76    cat << END_MSG | mail -s "ESYS_TESTS $target $RunDate \$1" $MAIL_RECIPIENTS    cat << END_MSG | mail -s "ESYS_TESTS $target $RunDate \$state" $MAIL_RECIPIENTS
77  \$2.  \$2.
78  The tests ran from \$START to \$END.  The tests ran from \$START to \$END on \$NCPUS CPUs
79  See the log files in $WorkDir/Logs for more information.  See the log files in $WorkDir/Logs/$RunDate*
80  This mail was sent by $SCRIPT_NAME  This mail was sent by $SCRIPT_NAME
81  running as \$USER on \`hostname\`.  running as \$USER on \`hostname\`.
82  END_MSG  END_MSG
83    test "x$1" = "FAIL" && exit 1    if [ "x\$state" = "xFAILURE" ]; then
84        touch Logs/$RunDate.FAILURE
85        exit 1
86      fi
87    exit 0    exit 0
88  }  }
89    
90    
91    # set -x
92    
93    
94  cd $WorkDir             || finish FAILURE "Could not cd to WorkDir $WorkDir"  cd $WorkDir             || finish FAILURE "Could not cd to WorkDir $WorkDir"
95    
96  # Create an empty out_file  # Create an empty out_file
# Line 94  svn checkout svn+ssh://shake200.esscc.uq Line 110  svn checkout svn+ssh://shake200.esscc.uq
110  module use /raid2/matt/modules/modulefiles  module use /raid2/matt/modules/modulefiles
111  module use /raid2/toolspp4/modulefiles/gcc-3.3.6  module use /raid2/toolspp4/modulefiles/gcc-3.3.6
112  module use /usr/share/modules/modulefiles  module use /usr/share/modules/modulefiles
113  module load esys/env    # Matt's recommended modules  module load esys/env    # Recommended modules
114  module load doxygen/1.4.6  module load doxygen/1.4.6
 # The next line is to avoid /raid3/ksteube/AutoTests/sandbox.2006_06_17/trunk/build/posix/bruce/test/bruce_UnitTest: error while loading shared libraries: libboost_python-mt-d.so.1.33.0: cannot open shared object file: No such file or directory  
115  module load boost/1.33.0/python-2.4.1  module load boost/1.33.0/python-2.4.1
116    module load gmsh-1.65.0
117    module load epydoc/2.1/python-2.4.3
118    
119    # How many threads? One per CPU.
120  # Had to request 2 CPUs, but only use one for the tests  export OMP_NUM_THREADS=\$NCPUS
 export OMP_NUM_THREADS=1  
121    
122  # Run the tests  # Run the tests
123  echo "Running the tests"  echo "Running the tests $target"
124  cd trunk                || finish FAILURE "Could not cd to trunk"  cd trunk                || finish FAILURE "Could not cd to trunk"
125  scons $target >> $out_file 2>&1     || finish FAILURE "Could not run scons $target"  scons -j \$NCPUS $target >> $out_file 2>&1      || finish FAILURE "Could not run scons $target"
126    
127  # Delete files older than 21 days  # Run epydoc to create the python documentation
128  find $WorkDir -atime +21 -exec rm -f {} \;  echo "Running epydoc"
129    export LD_LIBRARY_PATH="$PWD/lib:$LD_LIBRARY_PATH"
130    mkdir release release/doc release/doc/epydoc
131    scons api_epydoc >> $out_file 2>&1      || finish FAILURE "Could not run scons api_epydoc"
132    cd release/doc/epydoc
133    tar cf - . | ssh shake200 "cd /home/www/esys/esys13/nightly/epydoc; tar xf -"   || finish FAILURE "Could not copy epydoc to shake200"
134    cd ../../..
135    
136  # Clean up the sandbox  echo "Cleaning up after the tests"
 cd $WorkDir             || finish FAILURE "Could not cd to clean up WorkDir $WorkDir"  
 /bin/rm -rf sandbox.$RunDate        || finish FAILURE "Could not delete sandbox"  
137    
138  finish SUCCESS "Successfully ran 'scons $target', see Logs in $WorkDir on ess"  # Delete files older than 60 days
139    find $WorkDir -atime +60 -exec rm -f {} \;
140    
141    finish SUCCESS "Successfully ran 'scons $target' on \`hostname\`"
142    
143  EOF  EOF
144    
# Line 125  cd $WorkDir/Logs Line 148  cd $WorkDir/Logs
148  # Submit the job  # Submit the job
149  . /opt/modules/default/init/sh  . /opt/modules/default/init/sh
150  module load pbspro  module load pbspro
151    
152    # Submit the job
153  qsub -S /bin/bash $RunDate.pbs.script.sh > /dev/null  qsub -S /bin/bash $RunDate.pbs.script.sh > /dev/null
154    

Legend:
Removed from v.739  
changed lines
  Added in v.1523

  ViewVC Help
Powered by ViewVC 1.1.26