/[escript]/branches/lapack2681/scons/grouptest.py
ViewVC logotype

Diff of /branches/lapack2681/scons/grouptest.py

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

revision 2502 by gross, Tue Jun 30 05:49:22 2009 UTC revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC
# Line 1  Line 1 
1  ########################################################  ########################################################
2  #  #
3  # Copyright (c) 2003-2008 by University of Queensland  # Copyright (c) 2003-2009 by University of Queensland
4  # Earth Systems Science Computational Center (ESSCC)  # Earth Systems Science Computational Center (ESSCC)
5  # http://www.uq.edu.au/esscc  # http://www.uq.edu.au/esscc
6  #  #
# Line 40  class GroupTest: Line 40  class GroupTest:
40      res=res+"# It will be regenerated each time scons is run\n"      res=res+"# It will be regenerated each time scons is run\n"
41      res=res+"#############################################\n\n"      res=res+"#############################################\n\n"
42      res=res+"function failed()\n{\n  echo ""Execution failed for $@""\n  exit 1\n}\n"      res=res+"function failed()\n{\n  echo ""Execution failed for $@""\n  exit 1\n}\n"
43        res=res+"if [ $# -ne 1 ]\nthen\n echo Usage: $0 wrapper_options\necho Runs all unit tests. Options must be a single string.\nexit 2\nfi\n"
44        res=res+'CMDSTR="getopt -uq -o p:n: -- $1"\nSTR=`$CMDSTR`\nNUMPROCS=1\n'
45        res=res+'NUMNODES=1\n#This little complication is required because set --\n'
46        res=res+'#does not seem to like -n as the first positional parameter\n'
47        res=res+'STATE=0\nfor name in $STR\ndo \n'
48        res=res+'case $STATE in\n'
49        res=res+'     0) case $name in\n'
50        res=res+'     -n) STATE=1;;\n'
51        res=res+'     -p) STATE=2;;\n'
52        res=res+'     --) break 2;;\n'
53        res=res+'        esac;;\n'
54        res=res+'     1) if [ $name == "--" ];then break; fi; NUMNODES=$name; STATE=0;;\n'
55        res=res+'     2) if [ $name == "--" ];then break; fi; NUMPROCS=$name; STATE=0;;\n'
56        res=res+'   esac\n'
57        res=res+'done\n'
58        res=res+'let MPIPROD="$NUMPROCS * $NUMNODES"\n'
59      res=res+"\nexport LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH\n"      res=res+"\nexport LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH\n"
60      if build_platform=='darwin':      if build_platform=='darwin':
61          res=res+"export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH\n"          res=res+"export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DYLD_LIBRARY_PATH\n"
62      res=res+"\nexport OLD_PYTHON=`pwd`:$PYTHONPATH\nBINRUNNER=\"`pwd`/bin/escript -b $1\"\nPYTHONRUNNER=\"`pwd`/bin/escript $1\"\nBATCH_ROOT=`pwd`\n"      res=res+"\nexport OLD_PYTHON=`pwd`:$PYTHONPATH\nBINRUNNER=\"`pwd`/bin/escript -b $1\"\nPYTHONRUNNER=\"`pwd`/bin/escript $1\"\nBATCH_ROOT=`pwd`\n"
63      res=res+"BUILD_DIR=$BATCH_ROOT/build/"+build_platform      res=res+"BUILD_DIR=$BATCH_ROOT/build/"+build_platform
64      res=res+"\nif [ ! -d $BUILD_DIR ]\nthen\n echo Can not find build directory $BUILD_DIR\n exit 2\nfi\n"      res=res+"\nif [ ! -d $BUILD_DIR ]\nthen\n echo Can not find build directory $BUILD_DIR\n exit 2\nfi\n"
     res=res+"if [ $# -ne 1 ]\nthen\n echo Usage: $0 wrapper_options\necho Runs all unit tests. Options must be a single string.\nexit 2\nfi\n"  
65      #res=res+"if [ $# -lt 2 ]\nthen\n echo Usage: $0 bin_run_cmd python_run_cmd\n exit 2\nfi\n"      #res=res+"if [ $# -lt 2 ]\nthen\n echo Usage: $0 bin_run_cmd python_run_cmd\n exit 2\nfi\n"
66      return res      return res
67      makeHeader=staticmethod(makeHeader)      makeHeader=staticmethod(makeHeader)
# Line 54  class GroupTest: Line 69  class GroupTest:
69      def makeString(self):      def makeString(self):
70      res=""      res=""
71          if self.single_processor_only:          if self.single_processor_only:
72              res+="if [ ( $ESCRIPT_NUM_NODES * $ESCRIPT_NUM_PROCS  ) -le 1 ]; then\n"              res+="if [ $MPIPROD -le 1 ]; then\n"
73              tt="\t"              tt="\t"
74          else:          else:
75              tt=""              tt=""

Legend:
Removed from v.2502  
changed lines
  Added in v.2548

  ViewVC Help
Powered by ViewVC 1.1.26