Ignore:
Timestamp:
Jan 18, 2012, 1:32:53 PM (13 years ago)
Author:
pittj
Message:

adding scripts for the memory and time experiments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/mem_time_tests/triangles/area/runcairns.py

    r8300 r8303  
    1919import time
    2020import sys
    21 import random
     21import main
    2222
    2323# Related major packages
    2424import anuga
     25from anuga_parallel import distribute, myid
     26from anuga.abstract_2d_finite_volumes.util import add_directories
     27from anuga.utilities import system_tools, log
    2528
    26 from anuga_parallel import distribute, myid, numprocs, finalize, barrier
     29spacelist = [0,0,0,0]
    2730
    28 import PyVM
    29 import liststore
     31#home = os.getenv('INUNDATIONHOME')
     32scenariodir2 = add_directories(main.home, ["data", "mem_time_test", "triangles", "area"])
    3033
    31 length = random.random()*2000 + 1
    32 area = random.random()*100 + 1
     34h = 'CAIRNS.msh'
     35file_pathh = os.path.join(scenariodir2, h)
     36store ='store.txt'
     37file_path_store = os.path.join(scenariodir2, store)
     38storen ='storen.txt'
     39file_path_storen = os.path.join(scenariodir2, storen)
     40storel = 'storel.txt'
     41file_path_storel = os.path.join(scenariodir2, store)
     42storea = 'store.txt'
     43file_path_storea = os.path.join(scenariodir2, storea)
    3344
     45f = open(file_path_storel,'r+') # SQRT extent this is set
     46length = float(f.readline())
     47f.close()
    3448
    35 PyVM.MemoryUpdate()
     49f = open(file_path_storea,'r+') #maxarea this is set
     50area = float(f.readline())
     51f.close()
     52
     53system_tools.MemoryUpdate()
    3654#------------------------------------------------------------------------------
    3755# Create the triangular mesh and domain based on
     
    4664                                                   'left': [3]},
    4765                                    maximum_triangle_area=area,
    48                                     mesh_filename='cairnsmesh.msh'
     66                                    mesh_filename=file_pathh
    4967                                    #,interior_regions=INTERIORREGIONS#,
    5068                                    #use_cache=True,
     
    5270                                    )
    5371
    54     number=len(domain)
     72    n = len(domain)
    5573else:
    5674    domain = None
     
    6179# Setup parameters of computational domain
    6280#------------------------------------------------------------------------------
    63 domain.set_name('CAIRNS') # Name of sww file
    64 domain.set_datadir('.')                       # Store sww output here
     81domain.set_name('CAIRNS.sww') # Name of sww file
     82domain.set_datadir(scenariodir2)                       # Store sww output here
    6583
    6684#------------------------------------------------------------------------------
     
    93111                     'top': Br})
    94112
     113
    95114#------------------------------------------------------------------------------
    96115# Evolve system through time
     
    102121   
    103122
    104 liststore.spacelist[myid] = PyVM.MemoryUpdate()[0]
    105 a = sum(liststore.spacelist)
     123spacelist[myid] = system_tools.MemoryUpdate()[0]
     124a = sum(spacelist)
    106125
    107 f = open('store.txt', 'r+')
    108 f.write(str(a))
     126v = open(file_path_store, 'r+')
     127v.write(str(a))
    109128
    110 g = open('storel.txt', 'r+')
    111 g.write(str(length))
    112 h = open('storea.txt', 'r+')
    113 h.write(str(area))
    114 i = open('storen.txt', 'r+')
    115 i.write(str(number))
     129i = open(file_path_storen, 'r+')
     130i.write(str(n))
    116131
     132
Note: See TracChangeset for help on using the changeset viewer.