source: trunk/anuga_work/development/mem_time_tests/hardware/cairns/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: 2.3 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 csv
12import os
13import time
14import liststore
15from anuga.utilities import system_tools, log
16from anuga.abstract_2d_finite_volumes.util import add_directories
17
18
19#------------------------------------------------------------------------------
20# Setup computational domain
21#------------------------------------------------------------------------------
22a = []
23host = os.getenv('HOST')
24home1 = os.getenv('INUNDATIONHOME')
25scenariodir = add_directories(home1, ["data","mem_time_test", "parallel","cairns"])
26file1 = 'ex1.csv'
27file_path = os.path.join(scenariodir, file1)
28store ='store.txt'
29file_path_store = os.path.join(scenariodir, store)
30
31log.log_filename = os.path.join(scenariodir, 'log.txt')
32
33spamWriter = csv.writer(open(file_path, 'wb'))
34spamWriter.writerow(['Number Of Processors' , 'Space Used MB' , 'Time Taken s'])
35e = open(file_path_store,'a')
36e.close()
37
38maxcpus = 18
39
40for n in range(1,maxcpus,1):
41    z = time.time()
42    y = time.time()
43
44    if (host == 'cyclone.agso.gov.au'):
45        subprocess.call(['mpirun', '-np', str(n), '-hostfile' ,'~/machinefiles/test.machines_cyclone', '-x','PYTHONPATH','-x','INUNDATIONHOME','python2.6', 'runcairns.py']) 
46    if (host == 'tornado.agso.gov.au'):
47        subprocess.call(['mpirun', '-np', str(n), '-hostfile' ,'~/machinefiles/test.machines_tornado', '-x','PYTHONPATH','-x','INUNDATIONHOME','python2.6', 'runcairns.py'])
48    if (host == 'vayu1'):
49        subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py']) 
50    if (host == 'rhe-compute1.ga.gov.au'):
51        subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python2.6', 'runcairns.py']) 
52    if (host == 'xe'):
53        subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py'])
54
55    liststore.spacelist = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
56    f = open(file_path_store,'r+')
57    x = float(f.readline())
58    f.close()
59    spamWriter.writerow([n,x ,(y-z)])
60print a
61
Note: See TracBrowser for help on using the repository browser.