/[escript]/trunk-mpi-branch/scons/scons_extensions.py
ViewVC logotype

Contents of /trunk-mpi-branch/scons/scons_extensions.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1275 - (show annotations)
Fri Aug 24 04:34:52 2007 UTC (12 years, 1 month ago) by ksteube
File MIME type: text/x-python
File size: 1549 byte(s)
Tests now launched by mpirun if useMPI
Copy $HOME to env for use by mpirun
Compiler flag -pedantic-errors now only used with gcc, not with icc

1
2 # Copyright 2006 by ACcESS MNRF
3 #
4 # http://www.access.edu.au
5 # Primary Business: Queensland, Australia
6 # Licensed under the Open Software License version 3.0
7 # http://www.opensource.org/licenses/osl-3.0.php
8 #
9
10
11 # Extensions to Scons
12
13 import py_compile
14 import sys
15 import os
16 import time
17
18 # Code to build .pyc from .py
19 def build_py(target, source, env):
20 py_compile.compile(str(source[0]), str(target[0]))
21 return None
22
23 # Code to run unit_test executables
24 def runUnitTest(target, source, env):
25 time_start = time.time()
26 app = str(source[0].abspath)
27 if env['useMPI']: app = 'mpirun -np 1 ' + app
28 print "Executing test: " + app
29 if not env.Execute(app):
30 open(str(target[0]),'w').write("PASSED\n")
31 else:
32 return 1
33 print "Test execution time: ", round(time.time() - time_start, 1), " seconds wall time for " + str(source[0].abspath)
34 return None
35
36 def runPyUnitTest(target, source, env):
37 time_start = time.time()
38 app = str(source[0].abspath)
39 if env['useMPI']:
40 app = 'mpirun -np 1 lib/pythonMPI ' + app
41 else:
42 app = 'python ' + app
43 print "Executing test: " + app
44 if not env.Execute(app):
45 open(str(target[0]),'w').write("PASSED\n")
46 else:
47 return 1
48 print "Test execution time: ", round(time.time() - time_start, 1), " seconds wall time for " + str(source[0].abspath)
49 return None

  ViewVC Help
Powered by ViewVC 1.1.26