- Timestamp:
- Jan 31, 2012, 10:54:12 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/mem_time_tests/hardware/cairns/runcairns.py
r8311 r8326 10 10 11 11 Geoscience Australia, 2004-present 12 13 This has remained unchanged aside from the parallelism added, the resource statistics 14 and the output directories, its also been scaled down so it runs faster 12 15 """ 13 16 … … 19 22 import time 20 23 import sys 24 import anuga 25 from anuga_parallel import distribute, myid, numprocs 26 from anuga.abstract_2d_finite_volumes.util import add_directories 27 from anuga.utilities import log 21 28 22 # Related major packages23 import anuga24 import liststore25 29 26 30 # Application specific imports 27 31 import project # Definition of file names and polygons 28 32 29 from anuga_parallel import distribute, myid, numprocs, finalize, barrier 30 from anuga.abstract_2d_finite_volumes.util import add_directories 31 from anuga.utilities import system_tools, log 33 34 # set up variables for the correct output directories 35 home = os.getenv('INUNDATIONHOME') 36 scenariodir = add_directories(home, ["data", "mem_time_test", "parallel", "cairns"]) 37 h = 'CAIRNS.msh' 38 file_pathh = os.path.join(scenariodir, h) 39 store ='store.txt' 40 file_path_store = os.path.join(scenariodir, store) 41 scenariodirV = add_directories(home, ["data","mem_time_test", "parallel", 42 "cairns", "parrallel-" + str(numprocs) +"-"+str(myid)]) 43 log.log_filename = os.path.join(scenariodirV, "anuga.log") 44 log._setup = False 32 45 33 46 34 home2 = os.getenv('INUNDATIONHOME') 35 36 scenariodir2 = add_directories(home2, ["data", "mem_time_test", "parallel", "cairns"]) 37 38 h = 'CAIRNS.msh' 39 file_pathh = os.path.join(scenariodir2, h) 40 store ='store.txt' 41 file_path_store = os.path.join(scenariodir2, store) 42 43 44 system_tools.MemoryUpdate() 45 47 log.resource_usage_timing(prefix = 'BeforeSimulation')#get memory statistics at this point 46 48 #------------------------------------------------------------------------------ 47 49 # Preparation of topographic data … … 49 51 #------------------------------------------------------------------------------ 50 52 # Create DEM from asc data 51 anuga.asc2dem(os.path.join(scenariodir 2, 'cairns.asc'), use_cache=True, verbose=True)53 anuga.asc2dem(os.path.join(scenariodir, 'cairns.asc'), use_cache=True, verbose=True) 52 54 53 55 # Create pts file for onshore DEM 54 anuga.dem2pts(os.path.join(scenariodir 2,'cairns.dem'), use_cache=True, verbose=True)56 anuga.dem2pts(os.path.join(scenariodir,'cairns.dem'), use_cache=True, verbose=True) 55 57 56 58 #------------------------------------------------------------------------------ … … 58 60 # overall clipping polygon with a tagged 59 61 # boundary and interior regions as defined in project.py 62 # (in serial, so the set up only runs once) 60 63 #------------------------------------------------------------------------------ 61 64 if myid == 0: … … 77 80 else: 78 81 domain = None 82 83 log.resource_usage_timing(prefix = 'AfterMesh')#get memory statistics at this point 79 84 85 #parallel 80 86 domain = distribute(domain) 81 87 … … 84 90 #------------------------------------------------------------------------------ 85 91 domain.set_name('cairns_' + project.scenario) # Name of sww file 86 domain.set_datadir(scenariodir 2) # Store sww output here92 domain.set_datadir(scenariodirV) # Store sww output here 87 93 domain.set_minimum_storable_height(0.01) # Store only depth > 1cm 88 94 … … 95 101 domain.set_quantity('friction', 0.0) 96 102 domain.set_quantity('elevation', 97 filename=os.path.join(scenariodir 2, 'cairns.pts'),103 filename=os.path.join(scenariodir, 'cairns.pts'), 98 104 use_cache=True, 99 105 verbose=True, 100 106 alpha=0.1) 107 log.resource_usage_timing(prefix='afterinitialconditions') #get memory statistics at this point 101 108 102 109 #------------------------------------------------------------------------------ … … 138 145 'onshore': Bd, 139 146 'top': Bd}) 140 147 log.resource_usage_timing(prefix='afterboundary') #get memory statistics at this point 141 148 #------------------------------------------------------------------------------ 142 149 # Evolve system through time … … 175 182 print domain.boundary_statistics(tags='ocean_east') 176 183 184 177 185 print 'That took %.2f seconds' %(time.time()-t0) 178 186 179 liststore.spacelist[myid] = system_tools.MemoryUpdate()[0] 180 a = sum(liststore.spacelist) 181 182 f = open(file_path_store, 'r+') 183 f.write(str(a)) 184 187 log.resource_usage_timing(prefix='aftersimulation') #get memory statistics at this point
Note: See TracChangeset
for help on using the changeset viewer.