source: trunk/anuga_work/development/mem_time_tests/triangles/serial/main.py @ 8320

Last change on this file since 8320 was 8320, checked in by pittj, 12 years ago

adding portability across, tornado, NCI, cyclone and compute 1 to all parrallel scripts

  • Property svn:executable set to *
File size: 1.7 KB
Line 
1"""Simple water flow example using ANUGA
2Water flowing down a channel
3"""
4#------------------------------------------------------------------------------
5# Import necessary modules
6#------------------------------------------------------------------------------
7# Import standard shallow water domain and standard boundaries.
8import anuga
9import random
10import subprocess
11import runcairns
12import csv
13import os
14import time
15from anuga.utilities import system_tools, log
16from anuga.abstract_2d_finite_volumes.util import add_directories
17import logAnalyser
18#------------------------------------------------------------------------------
19# Setup computational domain
20#------------------------------------------------------------------------------
21a = []
22m = 20 
23
24home = os.getenv('INUNDATIONHOME')
25
26
27scenariodir = add_directories(home, ["data","mem_time_test", "triangles",
28                                     "serial"])
29file = 'ex1.csv'
30
31#log.log_filename = os.path.join(scenariodir, 'anuga.log')
32
33file_path = os.path.join(scenariodir, file)
34#print "file_path",file_path
35
36spamWriter = csv.writer(open(file_path, 'wb'))
37spamWriter.writerow(['Number Of Triangles' ,'Max Triangle Area', 'Extent', 'Space Used MB' , 'Time Taken s'])
38outputresource = os.path.join(scenariodir,'test.csv')
39
40
41
42def runlist(r):
43    n = 1 #20
44    while (n > 0):
45        c = 2 #random.random() * 2000 + 1
46        z = time.time()
47        h = runcairns.runex(c,r)
48        y = time.time()
49        n = n -1
50        #subprocess.call(['python','timingScript.py',scenariodir,outputresource])
51        logAnalyser.AnalyseLog()
52        spamWriter.writerow([h,r,(c*c),'x' ,(y-z)])
53
54while (m > 0):
55    m = m -1
56    d = 101 #random.random() * 100 +1
57   
58    runlist(d)
59
60print 'DONE'
61
Note: See TracBrowser for help on using the repository browser.