/[escript]/trunk/scripts/prepare.py
ViewVC logotype

Diff of /trunk/scripts/prepare.py

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

revision 2266 by jfenwick, Thu Feb 12 03:42:56 2009 UTC revision 2270 by jfenwick, Mon Feb 16 04:43:28 2009 UTC
# Line 1  Line 1 
1    #!/sw/apps/python/x86_64/gcc-4.1.2/python-2.4.4/bin/python
2  import shutil, os, datetime, sys, os.path, time  import shutil, os, datetime, sys, os.path, time
3    
4  #This script does not use the python, platform independent path manipulation stuff.  #This script does not use the python, platform independent path manipulation stuff.
# Line 9  NUMJs=4 Line 9  NUMJs=4
9  TOPDIR=str(datetime.date.today())  TOPDIR=str(datetime.date.today())
10  ERRMAIL="j.fenwick1@uq.edu.au"  ERRMAIL="j.fenwick1@uq.edu.au"
11  EXECUTELOCATION="/scratch/jfenwick/AUTOTESTS"  EXECUTELOCATION="/scratch/jfenwick/AUTOTESTS"
12  OUTSIDEDIR=os.getcwd()  OUTSIDEDIR='/data1/jfenwick/EscriptDev'
13  TESTSLEEP=30*60  TESTSLEEP=30*60
14    
15  SRCMSG="This message was sent by prepare.py running as "+str(os.environ['USER'])+" on "+str(os.environ['HOSTNAME']+"\n")  SRCMSG="This message was sent by prepare.py running as "+str(os.environ['USER'])+" on "+str(os.environ['HOSTNAME']+"\n")
# Line 66  class TestConfiguration(object): Line 66  class TestConfiguration(object):
66      res=res+"TOP=`pwd`\nLOGDIR=$TOP/Logs\nPROGRESSFILE=$LOGDIR/progress\nOLDPYTH=$PYTHONPATH\nOLDLD=$LD_LIBRARY_PATH\n"      res=res+"TOP=`pwd`\nLOGDIR=$TOP/Logs\nPROGRESSFILE=$LOGDIR/progress\nOLDPYTH=$PYTHONPATH\nOLDLD=$LD_LIBRARY_PATH\n"
67      res=res+". /usr/share/modules/init/sh       #So the module command works\n"      res=res+". /usr/share/modules/init/sh       #So the module command works\n"
68      res=res+"module load subversion-1.3.1\nmodule load escript/current\nmodule load pbs\nmodule load mayavi/gcc-4.1.2/mayavi-1.5\n"      res=res+"module load subversion-1.3.1\nmodule load escript/current\nmodule load pbs\nmodule load mayavi/gcc-4.1.2/mayavi-1.5\n"
69        res=res+"module load netpbm\n"
70      res=res+"module load mplayer/gcc-4.1.2/mplayer-1.0rc2\n\n"      res=res+"module load mplayer/gcc-4.1.2/mplayer-1.0rc2\n\n"
71      res=res+"SCRIPTNAME=$0\n"      res=res+"SCRIPTNAME=$0\n"
72      res=res+"START=`date '+%Y/%m/%d %H:%M'`\n"      res=res+"START=`date '+%Y/%m/%d %H:%M'`\n"
73      res=res+"TESTLOGDIR=$LOGDIR\n"      res=res+"TESTLOGDIR=$LOGDIR\n"
74      res=res+"FINALLOGDIR="+OUTSIDEDIR+"/"+TOPDIR+"_Logs\n"      res=res+"FINALLOGDIR="+OUTSIDEDIR+"/"+TOPDIR+"_Logs\n"
75        res=res+"MPICOM='mpirun -np '   # Use this one for non-pbs jobs\n"
76        res=res+"MPICOM='mpiexec -n '\n"
77      return res      return res
78    
79      def toString(self):      def toString(self):
# Line 81  class TestConfiguration(object): Line 84  class TestConfiguration(object):
84          print "o="+str(o)          print "o="+str(o)
85          for m in self.mpi:          for m in self.mpi:
86          print "   m="+str(m)                  print "   m="+str(m)        
87          cmd="bash utest.sh 'mpiexec -np"+str(m)+"' $TESTROOT/lib/pythonMPI  >$TESTLOGDIR/output 2>&1"          cmd="bash utest.sh \"$MPICOM "+str(m)+"\" $TESTROOT/lib/pythonMPI  >$TESTLOGDIR/output 2>&1"
88          res=res+"cp -r "+self.name+"_src "+self.name+"_test"+str(runcount)+"\n"          res=res+"cp -r "+self.name+"_src "+self.name+"_test"+str(runcount)+"\n"
89          res=res+"cd "+self.name+"_test"+str(runcount)+"\n"          res=res+"cd "+self.name+"_test"+str(runcount)+"\n"
90          res=res+"TESTROOT=`pwd`\n"          res=res+"TESTROOT=`pwd`\n"
# Line 140  testconfs=[] Line 143  testconfs=[]
143  testconfs.append(TestConfiguration("OMPNoMPI","",omp=(1,8),mpi=(),binexec="",pythonexec="python"))  testconfs.append(TestConfiguration("OMPNoMPI","",omp=(1,8),mpi=(),binexec="",pythonexec="python"))
144  testconfs.append(TestConfiguration("MPI","usempi=yes",omp=(1,),mpi=(1,8),binexec="mpiexec -np ",pythonexec="lib/pythonMPI"))  testconfs.append(TestConfiguration("MPI","usempi=yes",omp=(1,),mpi=(1,8),binexec="mpiexec -np ",pythonexec="lib/pythonMPI"))
145    
146    
147    os.chdir(OUTSIDEDIR)
148  LOGDIR=OUTSIDEDIR+"/"+TOPDIR+"_Logs"  LOGDIR=OUTSIDEDIR+"/"+TOPDIR+"_Logs"
149    
150  if os.path.exists(LOGDIR):  if os.path.exists(LOGDIR):
# Line 205  except IOError: Line 210  except IOError:
210  progress("Building test file complete")  progress("Building test file complete")
211  progress("Copying files to exec area")  progress("Copying files to exec area")
212  os.chdir(OUTSIDEDIR)  os.chdir(OUTSIDEDIR)
213  try:  #try:
214      shutil.copytree(TOPDIR,EXECUTELOCATION+"/"+TOPDIR)      #shutil.copytree(TOPDIR,EXECUTELOCATION+"/"+TOPDIR)
215  except Error:  #except OSError:
216      failure("copying to work area")  #   failure("copying to work area")
217    res=os.system("cp -r "+TOPDIR+" "+EXECUTELOCATION+"/"+TOPDIR)
218    if res!=0:
219        failure("copying work area")
220  progress("Copy to exec area complete")  progress("Copy to exec area complete")
221    
222  print "Submitting test"  print "Submitting test"
# Line 231  print "Sleeping for "+str(TESTSLEEP)+" s Line 239  print "Sleeping for "+str(TESTSLEEP)+" s
239  time.sleep(TESTSLEEP)  time.sleep(TESTSLEEP)
240  print "Waking up."  print "Waking up."
241    
242  ########################  ######### end test section
243    
244  try:  try:
245      shutil.copytree(EXECUTELOCATION+"/"+TOPDIR+"/Logs",OUTSIDEDIR+"/"+TOPDIR+"_Logs")      shutil.copytree(EXECUTELOCATION+"/"+TOPDIR+"/Logs",OUTSIDEDIR+"/"+TOPDIR+"_Logs")

Legend:
Removed from v.2266  
changed lines
  Added in v.2270

  ViewVC Help
Powered by ViewVC 1.1.26