Changeset 8331


Ignore:
Timestamp:
Feb 10, 2012, 10:34:08 AM (12 years ago)
Author:
pittj
Message:

update for the new experiments

Location:
trunk/anuga_work/development/mem_time_tests
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/mem_time_tests/hardware/cairns/main.py

    r8328 r8331  
    1919home = os.getenv('INUNDATIONHOME')
    2020scenariodir = add_directories(home, ["data","mem_time_test", "parallel","cairns"])
    21 file1 = 'ex1.csv'
    22 file_path = os.path.join(scenariodir, file1)
    23 
    24 firstex1 = open(file_path, 'wb')
    25 spamWriter = csv.writer(firstex1)
    26 spamWriter.writerow(['Number Of Processors' , 'Space Used MB' , 'Time Taken (s)'])
    27 
     21meta_path = os.path.join(scenariodir, 'metalog.csv')
     22final_path = os.path.join(scenariodir, 'final.csv')
    2823
    2924# main loop that runs macpus - 1 times
     
    3126
    3227for n in range(1,maxcpus,1):
    33     z = time.time() # time it
    34 
    3528    #the necessary ways to run this script in parallel on the different hosts we use
    3629    if (host == 'cyclone.agso.gov.au'):
    3730        subprocess.call(['mpirun', '-np', str(n), '-hostfile' ,'~/machinefiles/test.machines_cyclone', '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py'])
    38     if (host == 'tornado.agso.gov.au'):
     31    elif (host == 'tornado.agso.gov.au'):
    3932        subprocess.call(['mpirun', '-np', str(n), '-hostfile' ,'~/machinefiles/test.machines_tornado', '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py'])
    40     if (host == 'vayu1'):
    41         subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py'])
    42     if (host == 'rhe-compute1.ga.gov.au'):
     33    elif (host == 'rhe-compute1.ga.gov.au'):
    4334        subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python2.6', 'runcairns.py'])
    44     if (host == 'xe'):
     35    else:
    4536        subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py'])
    46 
    47     y = time.time()# time it
    48     spamWriter.writerow([n,'x' ,(y-z)]) # write recorded results
     37     
    4938print 'DONE'
    5039
    51 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     40#get the important data for the experiments from the anuga experiments
     41analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    5242
    53 #close ex1.csv so we can read from it for a different csv reader object
    54 firstex1.close()
    55 
    56 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    57 ex1 = csv.reader(open(file_path,'rb'))
     43#open files to read from and write to
    5844metalog = csv.reader(open(meta_path,'rb'))
    5945final = csv.writer(open(final_path,'wb'))
    6046
     47#list stores the index of the values requird
     48indexlist = []
    6149
    62 for row in ex1:
    63     d = metalog.next()
    64     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     50#read in the first row
     51firstrow = metalog.next()
     52
     53#get the indices of the values we want, so that the data can be condensed
     54indexlist.append(firstrow.index("beforetime"))
     55indexlist.append(firstrow.index("aftertime"))
     56indexlist.append(firstrow.index("beforesimulationmemory"))
     57indexlist.append(firstrow.index("aftermeshmemory"))
     58indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     59indexlist.append(firstrow.index("afterboundarymemory"))
     60indexlist.append(firstrow.index("aftersimulationmemory"))
     61indexlist.append(firstrow.index("variable1"))
     62
     63#not all experiments have 3 variables, but some do
     64try:
     65    indexlist.append(firstrow.index("variable2"))
     66except ValueError:
     67    indexlist.append(firstrow.index("beforetime"))
     68try:
     69    indexlist.append(firstrow.index("variable3"))
     70except ValueError:
     71    indexlist.append(firstrow.index("aftertime"))
     72
     73#write the header for the final csv
     74final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     75                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     76                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     77                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     78                firstrow[(indexlist[9])]])
     79
     80#write the data for each column in the final csv
     81for row in metalog:
     82
     83    #manipulate the beginning and end time to get the time taken
     84    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     85    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     86    taken = time.mktime(end) - time.mktime(begin)
     87
     88    #write to file
     89    final.writerow([str(taken),row[(indexlist[2])],
     90                    row[(indexlist[3])],row[(indexlist[4])],
     91                    row[(indexlist[5])],row[(indexlist[6])],
     92                    row[(indexlist[7])],row[(indexlist[8])],
     93                    row[(indexlist[9])]])
  • trunk/anuga_work/development/mem_time_tests/hardware/cairns/runcairns.py

    r8326 r8331  
    3434# set up variables for the correct output directories
    3535home = os.getenv('INUNDATIONHOME')
    36 scenariodir = add_directories(home, ["data", "mem_time_test", "parallel", "cairns"])
     36scenariodirV = add_directories(home, ["data","mem_time_test", "parallel",
     37                                       "cairns", "parrallel-" + str(numprocs) +"-"+str(myid)])
    3738h = 'CAIRNS.msh'
    3839file_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)])
    4340log.log_filename = os.path.join(scenariodirV, "anuga.log")
    4441log._setup = False
    4542
     43log.timingInfo(msg=('variable1,'+str(numprocs))) #write the variable to be measured to file
     44log.timingInfo(msg=('variable2,'+str(myid))) #write the variable to be measured to file
    4645
    47 log.resource_usage_timing(prefix = 'BeforeSimulation')#get memory statistics at this point
     46log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
     47
     48log.resource_usage_timing(prefix = 'beforesimulation')#get memory statistics at this point
    4849#------------------------------------------------------------------------------
    4950# Preparation of topographic data
     
    8182    domain = None
    8283
    83 log.resource_usage_timing(prefix = 'AfterMesh')#get memory statistics at this point
     84log.resource_usage_timing(prefix = 'aftermesh')#get memory statistics at this point
    8485     
    8586#parallel
     
    186187
    187188log.resource_usage_timing(prefix='aftersimulation') #get memory statistics at this point
     189log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
  • trunk/anuga_work/development/mem_time_tests/hardware/template/main.py

    r8328 r8331  
    66#------------------------------------------------------------------------------
    77import anuga
    8 import random
    98import subprocess
    109import csv
     
    2019home = os.getenv('INUNDATIONHOME')
    2120scenariodir = add_directories(home, ["data","mem_time_test", "parallel","template"])
    22 file1 = 'ex1.csv'
    23 file_path = os.path.join(scenariodir, file1)
    24 
    25 firstex1 = open(file_path, 'wb')
    26 spamWriter = csv.writer(firstex1)
    27 spamWriter.writerow(['Number Of Processors' ,'Time Taken (s)'])
     21meta_path = os.path.join(scenariodir, 'metalog.csv')
     22final_path = os.path.join(scenariodir, 'final.csv')
    2823
    2924
     
    3227
    3328for n in range(1,maxcpus,1):
    34     z = time.time()# time it
    35 
     29 
    3630    #the different ways each HOST requires the parallel script to be run
    3731    if (host == 'cyclone.agso.gov.au'):
    3832        subprocess.call(['mpirun', '-np', str(n), '-hostfile' ,'~/machinefiles/test.machines_cyclone', '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py'])
    39     if (host == 'tornado.agso.gov.au'):
     33    elif (host == 'tornado.agso.gov.au'):
    4034        subprocess.call(['mpirun', '-np', str(n), '-hostfile' ,'~/machinefiles/test.machines_tornado', '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py'])
    41     if (host == 'vayu1'):
    42         subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py'])
    43     if (host == 'rhe-compute1.ga.gov.au'):
     35    elif (host == 'rhe-compute1.ga.gov.au'):
    4436        subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python2.6', 'runcairns.py'])
    45     if (host == 'xe'):
     37    else:
    4638        subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py'])
    4739   
    4840
    49     y = time.time() #time it
    50     spamWriter.writerow([n,(y-z)]) #record it
    51 
    5241print 'Done'
    5342
    54 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     43#get the important data for the experiments from the anuga experiments
     44analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    5545
    56 #close ex1.csv so we can read from it for a different csv reader object
    57 firstex1.close()
    58 
    59 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    60 ex1 = csv.reader(open(file_path,'rb'))
     46#open files to read from and write to
    6147metalog = csv.reader(open(meta_path,'rb'))
    6248final = csv.writer(open(final_path,'wb'))
    6349
     50#list stores the index of the values requird
     51indexlist = []
    6452
    65 for row in ex1:
    66     d = metalog.next()
    67     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     53#read in the first row
     54firstrow = metalog.next()
     55
     56#get the indices of the values we want, so that the data can be condensed
     57indexlist.append(firstrow.index("beforetime"))
     58indexlist.append(firstrow.index("aftertime"))
     59indexlist.append(firstrow.index("beforesimulationmemory"))
     60indexlist.append(firstrow.index("aftermeshmemory"))
     61indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     62indexlist.append(firstrow.index("afterboundarymemory"))
     63indexlist.append(firstrow.index("aftersimulationmemory"))
     64indexlist.append(firstrow.index("variable1"))
     65
     66#not all experiments have 3 variables, but some do
     67try:
     68    indexlist.append(firstrow.index("variable2"))
     69except ValueError:
     70    indexlist.append(firstrow.index("beforetime"))
     71try:
     72    indexlist.append(firstrow.index("variable3"))
     73except ValueError:
     74    indexlist.append(firstrow.index("aftertime"))
     75
     76#write the header for the final csv
     77final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     78                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     79                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     80                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     81                firstrow[(indexlist[9])]])
     82
     83#write the data for each column in the final csv
     84for row in metalog:
     85
     86    #manipulate the beginning and end time to get the time taken
     87    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     88    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     89    taken = time.mktime(end) - time.mktime(begin)
     90
     91    #write to file
     92    final.writerow([str(taken),row[(indexlist[2])],
     93                    row[(indexlist[3])],row[(indexlist[4])],
     94                    row[(indexlist[5])],row[(indexlist[6])],
     95                    row[(indexlist[7])],row[(indexlist[8])],
     96                    row[(indexlist[9])]])
  • trunk/anuga_work/development/mem_time_tests/hardware/template/runcairns.py

    r8326 r8331  
    1919#set up variables for the correct I/O directories for data storage
    2020home = os.getenv('INUNDATIONHOME')
    21 scenariodir = add_directories(home, ["data", "mem_time_test", "parallel", "template"])
    2221scenariodirV = add_directories(home, ["data","mem_time_test", "parallel",
    2322                                       "template", "template-" + str(numprocs) +"-"+ str(myid)])
     
    2726log._setup = False
    2827
    29 log.resource_usage_timing(prefix = 'BeforeSimulation')#get memory statistics here
     28log.timingInfo(msg=('variable1,'+str(numprocs))) #write the variable to be measured to file
     29log.timingInfo(msg=('variable2,'+str(myid))) #write the variable to be measured to file
     30
     31log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
     32
     33log.resource_usage_timing(prefix = 'beforesimulation')#get memory statistics here
    3034#------------------------------------------------------------------------------
    3135#Create the domain and mesh for the resource experiment on only one processor
     
    4751domain.set_name('CAIRNS') # Name of sww file
    4852domain.set_datadir(scenariodirV)# Store sww output here
    49 log.resource_usage_timing(prefix = 'AfterMesh')#get memory statistics here
     53log.resource_usage_timing(prefix = 'aftermesh')#get memory statistics here
    5054
    5155#------------------------------------------------------------------------------
     
    8084    print domain.timestepping_statistics()
    8185
    82 log.resource_usage_timing(prefix='aftersimulation')#get memory statistics here 
     86log.resource_usage_timing(prefix='aftersimulation')#get memory statistics here
     87log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
     88
  • trunk/anuga_work/development/mem_time_tests/parameters/nothing/ex1.py

    r8328 r8331  
    1818log._setup = False
    1919
    20 log.resource_usage_timing(prefix = 'BeforeSimulation') #get memory usage here
     20log.timingInfo(msg=('variable1,'+str(n))) #write the variable to be measured to file
     21log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
     22log.resource_usage_timing(prefix = 'beforesimulation') #get memory usage here
    2123#------------------------------------------------------------------------------
    2224# Setup computational domain
     
    2830domain.set_datadir(scenariodirV)
    2931
    30 log.resource_usage_timing(prefix = 'AfterMesh')  #get memory usage here
     32log.resource_usage_timing(prefix = 'aftermesh')  #get memory usage here
    3133
    3234#------------------------------------------------------------------------------
     
    5557
    5658log.resource_usage_timing(prefix='aftersimulation')  #get memory usage here
     59log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
  • trunk/anuga_work/development/mem_time_tests/parameters/nothing/main.py

    r8328 r8331  
    44import anuga
    55import time
    6 import random
    76import subprocess
    87import csv
     
    1716home = os.getenv('INUNDATIONHOME')
    1817scenariodir = add_directories(home, ["data","mem_time_test", "parameters","nothing"])
    19 file = 'ex1.csv'
    20 file_path = os.path.join(scenariodir, file)
    2118meta = 'metalog.csv'
    2219meta_path = os.path.join(scenariodir, meta)
     
    2421final_path = os.path.join(scenariodir, final)
    2522
    26 #set up needed files
    27 firstex1 = open(file_path, 'wb')
    28 spamWriter = csv.writer(firstex1)
    29 spamWriter.writerow(['Run Number' , 'Time Taken(s)','Space Used'])
    30 
    3123#main loop, that stores the current run number so that unique folders exist for the information
    32 for n in range(0,300,1):
    33  
    34     x = time.time() #time it
     24for n in range(0,100,1):
    3525    subprocess.call(['python2.5', 'ex1.py' ,str(n)]) #run script
    36     y = time.time() #time it
    37 
    38     spamWriter.writerow([n ,(y-x)])
    39 
    4026print "DONE"
    4127
    42 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     28#get the important data for the experiments from the anuga experiments
     29analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    4330
    44 #close ex1.csv so we can read from it for a different csv reader object
    45 firstex1.close()
    46 
    47 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    48 ex1 = csv.reader(open(file_path,'rb'))
     31#open files to read from and write to
    4932metalog = csv.reader(open(meta_path,'rb'))
    5033final = csv.writer(open(final_path,'wb'))
    5134
     35#list stores the index of the values requird
     36indexlist = []
    5237
    53 for row in ex1:
    54     d = metalog.next()
    55     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     38#read in the first row
     39firstrow = metalog.next()
     40
     41#get the indices of the values we want, so that the data can be condensed
     42indexlist.append(firstrow.index("beforetime"))
     43indexlist.append(firstrow.index("aftertime"))
     44indexlist.append(firstrow.index("beforesimulationmemory"))
     45indexlist.append(firstrow.index("aftermeshmemory"))
     46indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     47indexlist.append(firstrow.index("afterboundarymemory"))
     48indexlist.append(firstrow.index("aftersimulationmemory"))
     49indexlist.append(firstrow.index("variable1"))
     50
     51#not all experiments have 3 variables, but some do
     52try:
     53    indexlist.append(firstrow.index("variable2"))
     54except ValueError:
     55    indexlist.append(firstrow.index("beforetime"))
     56try:
     57    indexlist.append(firstrow.index("variable3"))
     58except ValueError:
     59    indexlist.append(firstrow.index("aftertime"))
     60
     61#write the header for the final csv
     62final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     63                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     64                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     65                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     66                firstrow[(indexlist[9])]])
     67
     68#write the data for each column in the final csv
     69for row in metalog:
     70
     71    #manipulate the beginning and end time to get the time taken
     72    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     73    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     74    taken = time.mktime(end) - time.mktime(begin)
     75
     76    #write to file
     77    final.writerow([str(taken),row[(indexlist[2])],
     78                    row[(indexlist[3])],row[(indexlist[4])],
     79                    row[(indexlist[5])],row[(indexlist[6])],
     80                    row[(indexlist[7])],row[(indexlist[8])],
     81                    row[(indexlist[9])]])
     82
  • trunk/anuga_work/development/mem_time_tests/parameters/timelen-over-timestep/ex1.py

    r8328 r8331  
    1818log._setup = False
    1919
    20 log.resource_usage_timing(prefix = 'BeforeSimulation') #get memory usage here
     20
     21log.timingInfo(msg=('variable1,'+str(g))) #write the variable to be measured to file
     22log.timingInfo(msg=('variable2,'+str(h))) #write the variable to be measured to file
     23log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
     24log.resource_usage_timing(prefix = 'beforesimulation') #get memory usage here
    2125
    2226#------------------------------------------------------------------------------
     
    2832domain.set_datadir(scenariodirV)
    2933
    30 log.resource_usage_timing(prefix = 'AfterMesh')  #get memory usage here
     34log.resource_usage_timing(prefix = 'aftermesh')  #get memory usage here
    3135
    3236#------------------------------------------------------------------------------
     
    3438#------------------------------------------------------------------------------
    3539def topography(x, y):
    36     return -x/10 # linear bed slope
     40    return 0 # linear bed slope
    3741
    3842domain.set_quantity('elevation', topography) # Use function for elevation
    3943domain.set_quantity('friction', 0.01) # Constant friction
    40 domain.set_quantity('stage', expression='elevation')
     44domain.set_quantity('stage', 10) #constant depth
    4145log.resource_usage_timing(prefix='afterinitialconditions')  #get memory usage here
    4246
     
    4448# Setup boundary conditions
    4549#------------------------------------------------------------------------------
    46 Bi = anuga.Dirichlet_boundary([0.4, 0, 0]) # Inflow
    4750Br = anuga.Reflective_boundary(domain) # Solid reflective wall
    48 domain.set_boundary({'left': Bi, 'right': Br, 'top': Br, 'bottom': Br})
     51domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    4952log.resource_usage_timing(prefix='afterboundary')  #get memory usage here
    5053#------------------------------------------------------------------------------
     
    5558
    5659log.resource_usage_timing(prefix='aftersimulation')  #get memory usage here
     60log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
  • trunk/anuga_work/development/mem_time_tests/parameters/timelen-over-timestep/main.py

    r8328 r8331  
    55import anuga
    66import time
    7 import random
    87import subprocess
    98import csv
     
    1918scenariodir = add_directories(home, ["data","mem_time_test", "parameters",
    2019                                     "timelen-over-timestep"])
    21 file = 'ex1.csv'
    22 file_path = os.path.join(scenariodir, file)
    2320meta = 'metalog.csv'
    2421meta_path = os.path.join(scenariodir, meta)
     
    2623final_path = os.path.join(scenariodir, final)
    2724
    28 #create each file
    29 firstex1 = open(file_path, 'wb')
    30 spamWriter = csv.writer(firstex1)
    31 spamWriter.writerow(['Time Length(s)','Time Step (s)' , 'Time Taken','Space Used'])
     25# main loops that give the time length (m) and the time step (n)
     26for m in range(10,1000,200):
    3227
    33 # main loops that give the time length (m) and the time step (n)
    34 for m in range(1,1000,50):
    35 
    36     for n in range(1,1000,5):
     28    for n in range(10,1000,100):
    3729        n = n/100.0 #adjust it so its small enough to see the nature of the relationship
    38 
    39         x = time.time()#time it
    4030        subprocess.call(['python2.5', 'ex1.py',str(m),str(n)])#run it
    41         y = time.time()#time it
    42         spamWriter.writerow([m,n ,(y-x),'b'])#write the results
    43 
    4431print 'Done'
    4532
    46 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     33#get the important data for the experiments from the anuga experiments
     34analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    4735
    48 #close ex1.csv so we can read from it for a different csv reader object
    49 firstex1.close()
    50 
    51 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    52 ex1 = csv.reader(open(file_path,'rb'))
     36#open files to read from and write to
    5337metalog = csv.reader(open(meta_path,'rb'))
    5438final = csv.writer(open(final_path,'wb'))
    5539
     40#list stores the index of the values requird
     41indexlist = []
    5642
    57 for row in ex1:
    58     d = metalog.next()
    59     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     43#read in the first row
     44firstrow = metalog.next()
     45
     46#get the indices of the values we want, so that the data can be condensed
     47indexlist.append(firstrow.index("beforetime"))
     48indexlist.append(firstrow.index("aftertime"))
     49indexlist.append(firstrow.index("beforesimulationmemory"))
     50indexlist.append(firstrow.index("aftermeshmemory"))
     51indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     52indexlist.append(firstrow.index("afterboundarymemory"))
     53indexlist.append(firstrow.index("aftersimulationmemory"))
     54indexlist.append(firstrow.index("variable1"))
     55
     56#not all experiments have 3 variables, but some do
     57try:
     58    indexlist.append(firstrow.index("variable2"))
     59except ValueError:
     60    indexlist.append(firstrow.index("beforetime"))
     61try:
     62    indexlist.append(firstrow.index("variable3"))
     63except ValueError:
     64    indexlist.append(firstrow.index("aftertime"))
     65
     66#write the header for the final csv
     67final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     68                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     69                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     70                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     71                firstrow[(indexlist[9])]])
     72
     73#write the data for each column in the final csv
     74for row in metalog:
     75
     76    #manipulate the beginning and end time to get the time taken
     77    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     78    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     79    taken = time.mktime(end) - time.mktime(begin)
     80
     81    #write to file
     82    final.writerow([str(taken),row[(indexlist[2])],
     83                    row[(indexlist[3])],row[(indexlist[4])],
     84                    row[(indexlist[5])],row[(indexlist[6])],
     85                    row[(indexlist[7])],row[(indexlist[8])],
     86                    row[(indexlist[9])]])
     87
     88
  • trunk/anuga_work/development/mem_time_tests/parameters/timelen/ex1.py

    r8328 r8331  
    1111#set up variables to store the results and the log files of each experiment
    1212f = sys.argv[1]
     13g = float(f)/100.0
    1314home = os.getenv('INUNDATIONHOME')
    1415scenariodirV = add_directories(home, ["data","mem_time_test", "parameters",
     
    1718log._setup = False
    1819
    19 log.resource_usage_timing(prefix = 'BeforeSimulation') #get memory usage here
     20log.timingInfo(msg=('variable1,'+str(f))) #write the variable to be measured to file
     21
     22log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
     23
     24log.resource_usage_timing(prefix = 'beforesimulation') #get memory usage here
    2025
    2126#------------------------------------------------------------------------------
     
    2732domain.set_datadir(scenariodirV) 
    2833
    29 log.resource_usage_timing(prefix = 'AfterMesh') #get memory usage here
     34log.resource_usage_timing(prefix = 'aftermesh') #get memory usage here
    3035#------------------------------------------------------------------------------
    3136# Setup initial conditions
    3237#------------------------------------------------------------------------------
    3338def topography(x, y):
    34     return -x/10 # linear bed slope
     39    return 0 # linear bed slope
    3540domain.set_quantity('elevation', topography) # Use function for elevation
    3641domain.set_quantity('friction', 0.01) # Constant friction
    37 domain.set_quantity('stage',expression='elevation')
     42domain.set_quantity('stage', 10)
    3843
    3944log.resource_usage_timing(prefix='afterinitialconditions')#get memory usage here
     
    4247# Setup boundary conditions
    4348#------------------------------------------------------------------------------
    44 Bi = anuga.Dirichlet_boundary([0.4, 0, 0]) # Inflow
    4549Br = anuga.Reflective_boundary(domain) # Solid reflective wall
    46 domain.set_boundary({'left': Bi, 'right': Br, 'top': Br, 'bottom': Br})
     50domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    4751
    4852log.resource_usage_timing(prefix='afterboundary')#get memory usage here
     
    5155# Evolve system through time
    5256#------------------------------------------------------------------------------
    53 for t in domain.evolve(yieldstep=0.2, finaltime=f):
     57for t in domain.evolve(yieldstep=g, finaltime=f):
    5458    print domain.timestepping_statistics()
    5559
    5660
    5761log.resource_usage_timing(prefix='aftersimulation') #get memory usage here
    58 
     62log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
  • trunk/anuga_work/development/mem_time_tests/parameters/timelen/main.py

    r8328 r8331  
    1818scenariodir = add_directories(home, ["data","mem_time_test", "parameters",
    1919                                     "timelength"])
    20 file = 'ex1.csv'
    21 file_path = os.path.join(scenariodir, file)
    2220meta = 'metalog.csv'
    2321meta_path = os.path.join(scenariodir, meta)
     
    2523final_path = os.path.join(scenariodir, final)
    2624
    27 #set up needed files
    28 firstex1 = open(file_path, 'wb')
    29 spamWriter = csv.writer(firstex1)
    30 spamWriter.writerow(['Time Length (s)' , 'Time Taken (s)','Space Used'])
    31 
    3225#main loop that does the same experiment with different time lengths
    33 for n in range(1,1000,100):
    34 
    35     x = time.time() #time it
     26for n in range(1,1000,20):
    3627    subprocess.call(['python2.5', 'ex1.py', str(n)]) #run script
    37     y = time.time() #time it
    38     spamWriter.writerow([n ,(y-x)]) #write results
    39 
    4028print 'Done'
    4129
    42 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     30#get the important data for the experiments from the anuga experiments
     31analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    4332
    44 #close ex1.csv so we can read from it for a different csv reader object
    45 firstex1.close()
    46 
    47 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    48 ex1 = csv.reader(open(file_path,'rb'))
     33#open files to read from and write to
    4934metalog = csv.reader(open(meta_path,'rb'))
    5035final = csv.writer(open(final_path,'wb'))
    5136
     37#list stores the index of the values requird
     38indexlist = []
    5239
    53 for row in ex1:
    54     d = metalog.next()
    55     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     40#read in the first row
     41firstrow = metalog.next()
     42
     43#get the indices of the values we want, so that the data can be condensed
     44indexlist.append(firstrow.index("beforetime"))
     45indexlist.append(firstrow.index("aftertime"))
     46indexlist.append(firstrow.index("beforesimulationmemory"))
     47indexlist.append(firstrow.index("aftermeshmemory"))
     48indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     49indexlist.append(firstrow.index("afterboundarymemory"))
     50indexlist.append(firstrow.index("aftersimulationmemory"))
     51indexlist.append(firstrow.index("variable1"))
     52
     53#not all experiments have 3 variables, but some do
     54try:
     55    indexlist.append(firstrow.index("variable2"))
     56except ValueError:
     57    indexlist.append(firstrow.index("beforetime"))
     58try:
     59    indexlist.append(firstrow.index("variable3"))
     60except ValueError:
     61    indexlist.append(firstrow.index("aftertime"))
     62
     63#write the header for the final csv
     64final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     65                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     66                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     67                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     68                firstrow[(indexlist[9])]])
     69
     70#write the data for each column in the final csv
     71for row in metalog:
     72
     73    #manipulate the beginning and end time to get the time taken
     74    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     75    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     76    taken = time.mktime(end) - time.mktime(begin)
     77
     78    #write to file
     79    final.writerow([str(taken),row[(indexlist[2])],
     80                    row[(indexlist[3])],row[(indexlist[4])],
     81                    row[(indexlist[5])],row[(indexlist[6])],
     82                    row[(indexlist[7])],row[(indexlist[8])],
     83                    row[(indexlist[9])]])
     84
  • trunk/anuga_work/development/mem_time_tests/scenarios/channelflow/ex1.py

    r8328 r8331  
    1919log._setup = False
    2020
    21 log.resource_usage_timing(prefix = 'BeforeSimulation')#get memory usage
     21log.timingInfo(msg=('variable1,'+str(length))) #write the variable to be measured to file
     22log.timingInfo(msg=('variable2,'+str(lower))) #write the variable to be measured to file
     23log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
     24
     25log.resource_usage_timing(prefix = 'beforesimulation')#get memory usage
    2226#------------------------------------------------------------------------------
    2327# Setup computational domain
    2428#------------------------------------------------------------------------------
    25 points, vertices, boundary = anuga.rectangular_cross(50,150,len1=length, len2=length) # Mesh
     29points, vertices, boundary = anuga.rectangular_cross(100,300,len1=length, len2=length) # Mesh
    2630domain = anuga.Domain(points, vertices, boundary) # Create domain
    2731domain.set_datadir(scenariodirV)
    2832domain.set_name('channel1.sww') # Output name
    2933
    30 log.resource_usage_timing(prefix = 'AfterMesh') #get memory usage
     34log.resource_usage_timing(prefix = 'aftermesh') #get memory usage
    3135#--------------------------------------------------------------------------
    3236# Setup Initial Conditions
    3337#--------------------------------------------------------------------------
    3438def topography(x, y):
    35     z = -x/10
     39    z = 0
    3640    N = len(x)
    3741   
     
    5256# Setup boundary conditions
    5357#------------------------------------------------------------------------------
    54 Bi = anuga.Dirichlet_boundary([0.5, 1, 0]) # Inflow
    55 Bo = anuga.Dirichlet_boundary([-100,0,0])
     58Bi = anuga.Dirichlet_boundary([0.5, 10, 0]) # Inflow
     59Bo = anuga.Dirichlet_boundary([-0.5,0,0]) #outflow
    5660Br = anuga.Reflective_boundary(domain) # Solid reflective wall
    5761domain.set_boundary({'left': Bi, 'right': Bo, 'top': Br, 'bottom': Br})
     
    6165# Evolve system through time
    6266#------------------------------------------------------------------------------
    63 for t in domain.evolve(yieldstep=0.2, finaltime=40.0):
     67for t in domain.evolve(yieldstep=120, finaltime=3600):
    6468    domain.write_time()
    6569
    6670log.resource_usage_timing(prefix='aftersimulation') #get memory usage
     71log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
  • trunk/anuga_work/development/mem_time_tests/scenarios/channelflow/main.py

    r8328 r8331  
    33#------------------------------------------------------------------------------
    44import anuga
    5 import random
    65import subprocess
    76import csv
     
    1716scenariodir = add_directories(home, ["data","mem_time_test", "scenarios",
    1817                                     "channelflow"])
    19 file = 'ex1.csv'
    20 file_path = os.path.join(scenariodir, file)
    2118meta = 'metalog.csv'
    2219meta_path = os.path.join(scenariodir, meta)
     
    2421final_path = os.path.join(scenariodir, final)
    2522
    26 #set up needed files
    27 firstex1 = open(file_path, 'wb')
    28 spamWriter = csv.writer(firstex1)
    29 spamWriter.writerow(['Side Lenght(m)','Percentage Of Water Coverage' , 'Time Taken(s)','Space Used'])
    30 
    3123#the main loops that give the length of the inflow boundary (i) and the place to begin the step (n)
    32 for i in range(1,1000,100):
    33     for n in range(0,110,10):
    34        
     24for i in range(900,1000,100):
     25    for n in range(0,110,5):
    3526        #adjust
    3627        n = n*(i/100.0)
    37 
    38         z = time.time() #time it
    3928        subprocess.call(['python2.5', 'ex1.py',str(i),str(n)])#run the script
    40         y = time.time() #time it
    41 
    42         spamWriter.writerow([i,n/(i/100.0),(y-z), 'b'])#record it
    4329print 'DONE'
    4430
    45 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     31#get the important data for the experiments from the anuga experiments
     32analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    4633
    47 #close ex1.csv so we can read from it for a different csv reader object
    48 firstex1.close()
    49 
    50 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    51 ex1 = csv.reader(open(file_path,'rb'))
     34#open files to read from and write to
    5235metalog = csv.reader(open(meta_path,'rb'))
    5336final = csv.writer(open(final_path,'wb'))
    5437
     38#list stores the index of the values requird
     39indexlist = []
    5540
    56 for row in ex1:
    57     d = metalog.next()
    58     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     41#read in the first row
     42firstrow = metalog.next()
     43
     44#get the indices of the values we want, so that the data can be condensed
     45indexlist.append(firstrow.index("beforetime"))
     46indexlist.append(firstrow.index("aftertime"))
     47indexlist.append(firstrow.index("beforesimulationmemory"))
     48indexlist.append(firstrow.index("aftermeshmemory"))
     49indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     50indexlist.append(firstrow.index("afterboundarymemory"))
     51indexlist.append(firstrow.index("aftersimulationmemory"))
     52indexlist.append(firstrow.index("variable1"))
     53
     54#not all experiments have 3 variables, but some do
     55try:
     56    indexlist.append(firstrow.index("variable2"))
     57except ValueError:
     58    indexlist.append(firstrow.index("beforetime"))
     59try:
     60    indexlist.append(firstrow.index("variable3"))
     61except ValueError:
     62    indexlist.append(firstrow.index("aftertime"))
     63
     64#write the header for the final csv
     65final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     66                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     67                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     68                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     69                firstrow[(indexlist[9])]])
     70
     71#write the data for each column in the final csv
     72for row in metalog:
     73
     74    #manipulate the beginning and end time to get the time taken
     75    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     76    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     77    taken = time.mktime(end) - time.mktime(begin)
     78
     79    #write to file
     80    final.writerow([str(taken),row[(indexlist[2])],
     81                    row[(indexlist[3])],row[(indexlist[4])],
     82                    row[(indexlist[5])],row[(indexlist[6])],
     83                    row[(indexlist[7])],row[(indexlist[8])],
     84                    row[(indexlist[9])]])
     85
  • trunk/anuga_work/development/mem_time_tests/scenarios/stage/ex1.py

    r8328 r8331  
    1919log._setup = False
    2020
    21 log.resource_usage_timing(prefix = 'BeforeSimulation')# get memory usage
     21log.timingInfo(msg=('variable1,'+str(l))) #get the variable to be measured and write it to the log file
     22log.timingInfo(msg=('variable2,'+str(tide))) #get the variable to be measured and write it to the log file
     23
     24log.timingInfo(msg=('beforetime,'+str(log.TimeStamp())))#write the begin time to the log file
     25
     26log.resource_usage_timing(prefix = 'beforesimulation')# get memory usage
    2227#------------------------------------------------------------------------------
    2328# Setup computational domain
     
    2934domain.set_name('channel1') # Output name
    3035
    31 log.resource_usage_timing(prefix = 'AfterMesh')# get memory usage
     36log.resource_usage_timing(prefix = 'aftermesh')# get memory usage
    3237
    3338#--------------------------------------------------------------------------
     
    5762
    5863log.resource_usage_timing(prefix='aftersimulation')# get memory usage
     64log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #write the end time to log file
  • trunk/anuga_work/development/mem_time_tests/scenarios/stage/main.py

    r8328 r8331  
    33#------------------------------------------------------------------------------
    44import anuga
    5 import random
    65import subprocess
    76import csv
     
    1716scenariodir = add_directories(home, ["data","mem_time_test", "scenarios",
    1817                                     "stage"])
    19 file = 'ex1.csv'
    20 file_path = os.path.join(scenariodir, file)
    2118meta = 'metalog.csv'
    2219meta_path = os.path.join(scenariodir, meta)
     
    2421final_path = os.path.join(scenariodir, final)
    2522
    26 #create files
    27 firstex1 = open(file_path, 'wb')
    28 spamWriter = csv.writer(firstex1)
    29 spamWriter.writerow(['Depth(m)','Extent(m^2)' , 'Time Taken(s)','Space Used'])
    30 
    3123#these are the main loops that determine the side length of the bounding square(m)
    3224#and the depth of the initial water (n)
    33 for m in range(100,1000,100):
    34     for n in range(1,100,10):
    35 
    36         z = time.time() #time it
     25for m in range(900,1000,100):
     26    for n in range(90,100,10):
    3727        subprocess.call(['python2.5', 'ex1.py',str(m),str(n)]) # run the simulation script
    38         y = time.time() #time it
    39         spamWriter.writerow([n ,((m**2)/2),(y-z),'a']) #record it
    4028print 'DONE'
    4129
    42 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     30#get the important data for the experiments from the anuga experiments
     31analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    4332
    44 #close ex1.csv so we can read from it for a different csv reader object
    45 firstex1.close()
    46 
    47 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    48 ex1 = csv.reader(open(file_path,'rb'))
     33#open files to read from and write to
    4934metalog = csv.reader(open(meta_path,'rb'))
    5035final = csv.writer(open(final_path,'wb'))
    5136
     37#list stores the index of the values required
     38indexlist = []
    5239
    53 for row in ex1:
    54     d = metalog.next()
    55     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     40#read in the first row
     41firstrow = metalog.next()
     42
     43#get the indices of the values we want, so that the data can be condensed
     44indexlist.append(firstrow.index("beforetime"))
     45indexlist.append(firstrow.index("aftertime"))
     46indexlist.append(firstrow.index("beforesimulationmemory"))
     47indexlist.append(firstrow.index("aftermeshmemory"))
     48indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     49indexlist.append(firstrow.index("afterboundarymemory"))
     50indexlist.append(firstrow.index("aftersimulationmemory"))
     51indexlist.append(firstrow.index("variable1"))
     52
     53#not all experiments have 3 variables, but some do
     54try:
     55    indexlist.append(firstrow.index("variable2"))
     56except ValueError:
     57    indexlist.append(firstrow.index("beforetime"))
     58try:
     59    indexlist.append(firstrow.index("variable3"))
     60except ValueError:
     61    indexlist.append(firstrow.index("aftertime"))
     62
     63#write the header for the final csv
     64final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     65                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     66                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     67                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     68                firstrow[(indexlist[9])]])
     69
     70#write the data for each column in the final csv
     71for row in metalog:
     72
     73    #manipulate the beginning and end time to get the time taken
     74    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     75    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     76    taken = time.mktime(end) - time.mktime(begin)
     77
     78    #write to file
     79    final.writerow([str(taken),row[(indexlist[2])],
     80                    row[(indexlist[3])],row[(indexlist[4])],
     81                    row[(indexlist[5])],row[(indexlist[6])],
     82                    row[(indexlist[7])],row[(indexlist[8])],
     83                    row[(indexlist[9])]])
  • trunk/anuga_work/development/mem_time_tests/scenarios/vel2/ex1.py

    r8328 r8331  
    1414
    1515home = os.getenv('INUNDATIONHOME')
    16 scenariodir = add_directories(home, ["data","mem_time_test", "scenarios",
    17                                        "velocity"])
    1816scenariodirV = add_directories(home, ["data","mem_time_test", "scenarios",
    1917                                       "velocity", "velocity-" + str(k) +"-"+ str(l)])
    2018
    21 store = 'store.txt'
    22 store_path = os.path.join(scenariodir, store)
     19log.timingInfo(msg=('variable1,'+str(k))) #write the variable to be measured to file
     20log.timingInfo(msg=('variable2,'+str(l))) #write the variable to be measured to file
     21log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
    2322
    2423log.log_filename = os.path.join(scenariodirV, "anuga.log")
    2524log._setup = False
    2625
    27 log.resource_usage_timing(prefix = 'BeforeSimulation') #get memory usage
     26log.resource_usage_timing(prefix = 'beforesimulation') #get memory usage
    2827#------------------------------------------------------------------------------
    2928# Setup computational domain
     
    3433domain.set_datadir(scenariodirV)
    3534
    36 log.resource_usage_timing(prefix = 'AfterMesh')  #get memory usage
     35log.resource_usage_timing(prefix = 'aftermesh')  #get memory usage
    3736
    3837#get the number of triangles
    3938number = len(domain)
     39log.timingInfo(msg=('variable3,'+str(number))) #write the variable to be measured to file
    4040
    4141#--------------------------------------------------------------------------
     
    6767
    6868log.resource_usage_timing(prefix='aftersimulation')  #get memory usage
    69 
    70 #write the number of triangles to the file
    71 c = open(store_path,'r+')
    72 c.write(str(number))
     69log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
  • trunk/anuga_work/development/mem_time_tests/scenarios/vel2/main.py

    r8328 r8331  
    1616scenariodir = add_directories(home, ["data","mem_time_test", "scenarios",
    1717                                     "velocity"])
    18 file = 'ex1.csv'
    19 file_path = os.path.join(scenariodir, file)
    2018meta = 'metalog.csv'
    2119meta_path = os.path.join(scenariodir, meta)
    2220final = 'final.csv'
    2321final_path = os.path.join(scenariodir, final)
    24 store = 'store.txt'
    25 store_path = os.path.join(scenariodir, store)
    26 
    27 #set up needed files
    28 firstex1 = open(file_path, 'wb')
    29 spamWriter = csv.writer(firstex1)
    30 spamWriter.writerow(['Velocity(m/s)','Number Of Triangles','Extent(m^2)' , 'Time Taken(s)','Space Used'])
    31 storeopen = open(store_path,'a')
    32 storeopen.close
    3322
    3423# these are the main loops that give the velocity of inflow (m) and the map side length(n)
    3524for m in range(0,250,10):
    3625     for n in range(1,2000,300): 
    37        
    38         z = time.time() #time it
    39         subprocess.call(['python2.5', 'ex1.py', str(m), str(n)])#run simulation script
    40         y = time.time() #time it
    41 
    42         # read the number of triangles from this text file
    43         f = open(store_path,'r+')
    44         h = float(f.readline())
    45         f.close()
    46        
    47         spamWriter.writerow([m,h,(n*n),(y-z), 'b'])# record it
     26         subprocess.call(['python2.5', 'ex1.py', str(m), str(n)])#run simulation script
    4827print 'DONE' 
    4928
    50 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     29#get the important data for the experiments from the anuga experiments
     30analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    5131
    52 #close ex1.csv so we can read from it for a different csv reader object
    53 firstex1.close()
    54 
    55 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    56 ex1 = csv.reader(open(file_path,'rb'))
     32#open files to read from and write to
    5733metalog = csv.reader(open(meta_path,'rb'))
    5834final = csv.writer(open(final_path,'wb'))
    5935
     36#list stores the index of the values requird
     37indexlist = []
    6038
    61 for row in ex1:
    62     d = metalog.next()
    63     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     39#read in the first row
     40firstrow = metalog.next()
     41
     42#get the indices of the values we want, so that the data can be condensed
     43indexlist.append(firstrow.index("beforetime"))
     44indexlist.append(firstrow.index("aftertime"))
     45indexlist.append(firstrow.index("beforesimulationmemory"))
     46indexlist.append(firstrow.index("aftermeshmemory"))
     47indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     48indexlist.append(firstrow.index("afterboundarymemory"))
     49indexlist.append(firstrow.index("aftersimulationmemory"))
     50indexlist.append(firstrow.index("variable1"))
     51
     52#not all experiments have 3 variables, but some do
     53try:
     54    indexlist.append(firstrow.index("variable2"))
     55except ValueError:
     56    indexlist.append(firstrow.index("beforetime"))
     57try:
     58    indexlist.append(firstrow.index("variable3"))
     59except ValueError:
     60    indexlist.append(firstrow.index("aftertime"))
     61
     62#write the header for the final csv
     63final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     64                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     65                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     66                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     67                firstrow[(indexlist[9])]])
     68
     69#write the data for each column in the final csv
     70for row in metalog:
     71
     72    #manipulate the beginning and end time to get the time taken
     73    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     74    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     75    taken = time.mktime(end) - time.mktime(begin)
     76
     77    #write to file
     78    final.writerow([str(taken),row[(indexlist[2])],
     79                    row[(indexlist[3])],row[(indexlist[4])],
     80                    row[(indexlist[5])],row[(indexlist[6])],
     81                    row[(indexlist[7])],row[(indexlist[8])],
     82                    row[(indexlist[9])]])
     83
     84
  • trunk/anuga_work/development/mem_time_tests/triangles/area/main.py

    r8328 r8331  
    1717host = os.getenv('HOST')
    1818scenariodir = add_directories(home, ["data","mem_time_test", "triangles","area"])
    19 file1 = 'ex1.csv'
    2019meta = 'metalog.csv'
    2120meta_path = os.path.join(scenariodir, meta)
    2221final = 'final.csv'
    2322final_path = os.path.join(scenariodir, final)
    24 storen ='storen.txt'
    25 file_path_storen = os.path.join(scenariodir, storen)
    26 
    27 #set up needed files
    28 firstex1 = open(file_path, 'wb')
    29 spamWriter = csv.writer(firstex1)
    30 spamWriter.writerow(['Number of Triangles','Max Area(m^2)','Extent(m^2)' , 'Time Taken(s)','Space Used'])
    31 e = open(file_path_storen,'a')
    32 e.close()
    3323
    3424# this is the main loops that assigns the maximum triangle area (m) and the map side length(l)
     
    3727for m in range(90,100,10):
    3828     for l in range(100,2000,100):
    39                
    40         z = time.time()# time it
    41 
    4229        #the different ways each host calls MPI properly
    4330        if (host == 'cyclone.agso.gov.au'):
    4431            subprocess.call(['mpirun', '-np', str(n), '-hostfile' ,'~/machinefiles/test.machines_cyclone', '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py',str(m),str(l)])
    45         if (host == 'tornado.agso.gov.au'):
     32        elif (host == 'tornado.agso.gov.au'):
    4633            subprocess.call(['mpirun', '-np', str(n), '-hostfile' ,'~/machinefiles/test.machines_tornado', '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py',str(m),str(l)])
    47         if (host == 'vayu1'):
    48             subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py',str(m),str(l)])
    49         if (host == 'rhe-compute1.ga.gov.au'):
     34        elif (host == 'rhe-compute1.ga.gov.au'):
    5035            subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python2.6', 'runcairns.py',str(m),str(l)])   
    51         if (host == 'xe'):
     36        else:
    5237            subprocess.call(['mpirun', '-np', str(n), '-x','PYTHONPATH','-x','INUNDATIONHOME','python', 'runcairns.py',str(m),str(l)])
    5338       
    54         y = time.time()# time it
    55 
    56         # read the number of triangles from this file
    57         f = open(file_path_storen,'r+')
    58         i = float(f.readline())
    59         f.close()
    60 
    61         spamWriter.writerow([i,m,(l*l),'x' ,(y-z)])# record it
    62 
    6339print 'Done'
    6440
    65 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     41#get the important data for the experiments from the anuga experiments
     42analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    6643
    67 #close ex1.csv so we can read from it for a different csv reader object
    68 firstex1.close()
    69 
    70 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    71 ex1 = csv.reader(open(file_path,'rb'))
     44#open files to read from and write to
    7245metalog = csv.reader(open(meta_path,'rb'))
    7346final = csv.writer(open(final_path,'wb'))
    7447
     48#list stores the index of the values requird
     49indexlist = []
    7550
    76 for row in ex1:
    77     d = metalog.next()
    78     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     51#read in the first row
     52firstrow = metalog.next()
    7953
     54#get the indices of the values we want, so that the data can be condensed
     55indexlist.append(firstrow.index("beforetime"))
     56indexlist.append(firstrow.index("aftertime"))
     57indexlist.append(firstrow.index("beforesimulationmemory"))
     58indexlist.append(firstrow.index("aftermeshmemory"))
     59indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     60indexlist.append(firstrow.index("afterboundarymemory"))
     61indexlist.append(firstrow.index("aftersimulationmemory"))
     62indexlist.append(firstrow.index("variable1"))
     63
     64#not all experiments have 3 variables, but some do
     65try:
     66    indexlist.append(firstrow.index("variable2"))
     67except ValueError:
     68    indexlist.append(firstrow.index("beforetime"))
     69try:
     70    indexlist.append(firstrow.index("variable3"))
     71except ValueError:
     72    indexlist.append(firstrow.index("aftertime"))
     73
     74#write the header for the final csv
     75final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     76                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     77                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     78                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     79                firstrow[(indexlist[9])]])
     80
     81#write the data for each column in the final csv
     82for row in metalog:
     83
     84    #manipulate the beginning and end time to get the time taken
     85    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     86    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     87    taken = time.mktime(end) - time.mktime(begin)
     88
     89    #write to file
     90    final.writerow([str(taken),row[(indexlist[2])],
     91                    row[(indexlist[3])],row[(indexlist[4])],
     92                    row[(indexlist[5])],row[(indexlist[6])],
     93                    row[(indexlist[7])],row[(indexlist[8])],
     94                    row[(indexlist[9])]])
  • trunk/anuga_work/development/mem_time_tests/triangles/area/runcairns.py

    r8328 r8331  
    1111from anuga.utilities import log
    1212
    13 #set up the variables for the temporary data files
    14 home = os.getenv('INUNDATIONHOME')
    15 scenariodir = add_directories(home, ["data", "mem_time_test", "triangles", "area"])
    16 storen ='storen.txt'
    17 file_path_storen = os.path.join(scenariodir, storen)
    18 
    1913#set up the variables for the output data and the log files
    2014length = sys.argv[2]
     
    2822log._setup = False
    2923
    30 log.resource_usage_timing(prefix = 'BeforeSimulation') #get memory usage
     24log.timingInfo(msg=('variable1,'+str(length))) #write the variable to be measured to file
     25log.timingInfo(msg=('variable2,'+str(area))) #write the variable to be measured to file
     26log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
     27
     28log.resource_usage_timing(prefix = 'beforesimulation') #get memory usage
    3129#------------------------------------------------------------------------------
    3230# Create the triangular mesh and domain on one processor
     
    4644else:
    4745    domain = None
    48  
     46log.timingInfo(msg=('variable3,'+str(n))) #write the variable to be measured to file
     47
    4948#parallel   
    5049domain = distribute(domain)                               
     
    5352domain.set_datadir(scenariodirV)# Store sww output here
    5453
    55 log.resource_usage_timing(prefix = 'AfterMesh') #get memory usage
     54log.resource_usage_timing(prefix = 'aftermesh') #get memory usage
    5655#------------------------------------------------------------------------------
    5756# Setup initial conditions
     
    8685
    8786log.resource_usage_timing(prefix='aftersimulation') #get memory usage
     87log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
    8888
    89 #write the number of triangles to file
    90 i = open(file_path_storen, 'r+')
    91 i.write(str(n))
    92 
    93 
  • trunk/anuga_work/development/mem_time_tests/triangles/fromregions/main.py

    r8328 r8331  
    1616scenariodir = add_directories(home, ["data","mem_time_test", "triangles",
    1717                                     "fromregions"])
    18 storea ='storea.txt'
    19 file_path_storea = os.path.join(scenariodir, storea)
    2018meta = 'metalog.csv'
    2119meta_path = os.path.join(scenariodir, meta)
    2220final = 'final.csv'
    2321final_path = os.path.join(scenariodir, final)
    24 file = 'ex1.csv'
    25 file_path = os.path.join(scenariodir, file)
    26 
    27 #create and set up the files
    28 firstex1 = open(file_path, 'wb')
    29 spamWriter = csv.writer(firstex1)
    30 spamWriter.writerow(['Number Of Triangles','Maximum Area(m^2)','Extent(m^2)' , 'Time Taken(s)','Space Used'])
    31 e = open(file_path_storea,'a')
    32 e.close()
    3322
    3423#these are the main loops that determine the maximum triangle area (m) and the map side length(n)
    3524for m in range(20,1000,50):
    3625    for n in range(1,100000,10000):
    37 
    38         z = time.time() #time it
    3926        subprocess.call(['python2.5', 'runcairns.py',str(m),str(n)])#run simulation
    40         y = time.time() #time it
    41 
    42         #read the number of triangles from this text file
    43         f = open(file_path_storea,'r+')
    44         h = float(f.readline())
    45         f.close()
    46 
    47         spamWriter.writerow([h,m,(n*n),'x' ,(y-z)]) #record it
    4827print 'DONE'
    4928
    50 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     29#get the important data for the experiments from the anuga experiments
     30analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    5131
    52 #close ex1.csv so we can read from it for a different csv reader object
    53 firstex1.close()
    54 
    55 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    56 ex1 = csv.reader(open(file_path,'rb'))
     32#open files to read from and write to
    5733metalog = csv.reader(open(meta_path,'rb'))
    5834final = csv.writer(open(final_path,'wb'))
    5935
     36#list stores the index of the values requird
     37indexlist = []
    6038
    61 for row in ex1:
    62     d = metalog.next()
    63     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     39#read in the first row
     40firstrow = metalog.next()
     41
     42#get the indices of the values we want, so that the data can be condensed
     43indexlist.append(firstrow.index("beforetime"))
     44indexlist.append(firstrow.index("aftertime"))
     45indexlist.append(firstrow.index("beforesimulationmemory"))
     46indexlist.append(firstrow.index("aftermeshmemory"))
     47indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     48indexlist.append(firstrow.index("afterboundarymemory"))
     49indexlist.append(firstrow.index("aftersimulationmemory"))
     50indexlist.append(firstrow.index("variable1"))
     51
     52#not all experiments have 3 variables, but some do
     53try:
     54    indexlist.append(firstrow.index("variable2"))
     55except ValueError:
     56    indexlist.append(firstrow.index("beforetime"))
     57try:
     58    indexlist.append(firstrow.index("variable3"))
     59except ValueError:
     60    indexlist.append(firstrow.index("aftertime"))
     61
     62#write the header for the final csv
     63final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     64                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     65                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     66                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     67                firstrow[(indexlist[9])]])
     68
     69#write the data for each column in the final csv
     70for row in metalog:
     71
     72    #manipulate the beginning and end time to get the time taken
     73    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     74    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     75    taken = time.mktime(end) - time.mktime(begin)
     76
     77    #write to file
     78    final.writerow([str(taken),row[(indexlist[2])],
     79                    row[(indexlist[3])],row[(indexlist[4])],
     80                    row[(indexlist[5])],row[(indexlist[6])],
     81                    row[(indexlist[7])],row[(indexlist[8])],
     82                    row[(indexlist[9])]])
     83
  • trunk/anuga_work/development/mem_time_tests/triangles/fromregions/runcairns.py

    r8328 r8331  
    99from anuga.utilities import log
    1010
    11 # set up the variables for the temporary files
    12 home = os.getenv('INUNDATIONHOME')
    13 scenariodir = add_directories(home, ["data","mem_time_test", "triangles",
    14                                      "fromregions"])
    15 storea = 'storea.txt'
    16 file_path_storea = os.path.join(scenariodir, storea)
    17 
    18 
    1911#set up the variables for the simulation output and the log files
    2012a = sys.argv[1]
    2113l = sys.argv[2]
    2214
     15home = os.getenv('INUNDATIONHOME')
    2316scenariodirV = add_directories(home, ["data","mem_time_test", "triangles",
    2417                                       "fromregions", "triangles-" + str(a) +"-"+ str(l)])
     
    2821log.log_filename = os.path.join(scenariodirV, "anuga.log")
    2922
    30 log.resource_usage_timing(prefix = 'BeforeSimulation') #get memory usage
     23log.timingInfo(msg=('variable1,'+str(a))) #write the variable to be measured to file
     24log.timingInfo(msg=('variable2,'+str(l))) #write the variable to be measured to file
     25
     26log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
     27
     28log.resource_usage_timing(prefix = 'beforesimulation') #get memory usage
    3129#------------------------------------------------------------------------------
    3230# Create the triangular mesh and domain
     
    4240domain.set_name('CAIRNS.sww') # Name of sww file
    4341domain.set_datadir(scenariodirV)# Store sww output here
    44 log.resource_usage_timing(prefix = 'AfterMesh') #get memory usage
     42log.resource_usage_timing(prefix = 'aftermesh') #get memory usage
    4543#------------------------------------------------------------------------------
    4644# Setup initial conditions
     
    4947#get the number of triangles
    5048number=len(domain)
     49log.timingInfo(msg=('variable3,'+str(number))) #write the variable to be measured to file
    5150
    5251def topography(x,y):
     
    7877 
    7978log.resource_usage_timing(prefix='aftersimulation')#get memory usage
    80  
    81 #write the number of triangles to file
    82 i = open(file_path_storea, 'r+')
    83 i.write(str(number))
     79log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
  • trunk/anuga_work/development/mem_time_tests/triangles/rectanglecross/main.py

    r8328 r8331  
    1616scenariodir = add_directories(home, ["data","mem_time_test", "triangles",
    1717                                     "rectanglecross"])
    18 storea ='storea.txt'
    19 file_path_storea = os.path.join(scenariodir, storea)
    2018meta = 'metalog.csv'
    2119meta_path = os.path.join(scenariodir, meta)
    2220final = 'final.csv'
    2321final_path = os.path.join(scenariodir, final)
    24 file = 'ex1.csv'
    25 file_path = os.path.join(scenariodir, file)
    26 
    27 #set up needed files
    28 firstex1 = open(file_path, 'wb')
    29 spamWriter = csv.writer(firstex1)
    30 spamWriter.writerow(['Number of Triangles','Matrix Size','Extent(m^2)' , 'Time Taken(s)','Space Used'])
    31 e = open(file_path_storea,'a')
    32 e.close()
    3322
    3423#these main loops assign the matrix size[number of triangles] (m) and the map side length(n)
    3524for m in range(1,300,30):
    3625    for n in range(1,1000,100):
    37 
    38         z = time.time() #time it
    3926        subprocess.call(['python2.5', 'runcairns.py',str(m),str(n)]) #run the simulation
    40         y = time.time() #time it
    41 
    42         #read the number of triangles from this file
    43         f = open(file_path_storea,'r+')
    44         h = float(f.readline())
    45         f.close()
    46 
    47         spamWriter.writerow([h,m,(n*n),'x' ,(y-z)]) #record it
    4827print 'DONE'
    4928
    50 analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv')) #get the memory usage from the log files
     29#get the important data for the experiments from the anuga experiments
     30analyse_log(scenariodir, os.path.join(scenariodir,'metalog.csv'))
    5131
    52 #close ex1.csv so we can read from it for a different csv reader object
    53 firstex1.close()
    54 
    55 #merge the metalog useful memory info and the ex1 recorded info into one csv file named final
    56 ex1 = csv.reader(open(file_path,'rb'))
     32#open files to read from and write to
    5733metalog = csv.reader(open(meta_path,'rb'))
    5834final = csv.writer(open(final_path,'wb'))
    5935
     36#list stores the index of the values requird
     37indexlist = []
    6038
    61 for row in ex1:
    62     d = metalog.next()
    63     final.writerow([row[0],row[1],d[0],d[3],d[6],d[9],d[12]])#,d[15],d[18]])
     39#read in the first row
     40firstrow = metalog.next()
    6441
     42#get the indices of the values we want, so that the data can be condensed
     43indexlist.append(firstrow.index("beforetime"))
     44indexlist.append(firstrow.index("aftertime"))
     45indexlist.append(firstrow.index("beforesimulationmemory"))
     46indexlist.append(firstrow.index("aftermeshmemory"))
     47indexlist.append(firstrow.index("afterinitialconditionsmemory"))
     48indexlist.append(firstrow.index("afterboundarymemory"))
     49indexlist.append(firstrow.index("aftersimulationmemory"))
     50indexlist.append(firstrow.index("variable1"))
     51
     52#not all experiments have 3 variables, but some do
     53try:
     54    indexlist.append(firstrow.index("variable2"))
     55except ValueError:
     56    indexlist.append(firstrow.index("beforetime"))
     57try:
     58    indexlist.append(firstrow.index("variable3"))
     59except ValueError:
     60    indexlist.append(firstrow.index("aftertime"))
     61
     62#write the header for the final csv
     63final.writerow(["TimeTaken(s)",firstrow[(indexlist[2])],
     64                firstrow[(indexlist[3])],firstrow[(indexlist[4])],
     65                firstrow[(indexlist[5])],firstrow[(indexlist[6])],
     66                firstrow[(indexlist[7])],firstrow[(indexlist[8])],
     67                firstrow[(indexlist[9])]])
     68
     69#write the data for each column in the final csv
     70for row in metalog:
     71
     72    #manipulate the beginning and end time to get the time taken
     73    begin = time.strptime(row[(indexlist[0])],'%Y%m%d_%H%M%S')
     74    end = time.strptime(row[(indexlist[1])],'%Y%m%d_%H%M%S')
     75    taken = time.mktime(end) - time.mktime(begin)
     76
     77    #write to file
     78    final.writerow([str(taken),row[(indexlist[2])],
     79                    row[(indexlist[3])],row[(indexlist[4])],
     80                    row[(indexlist[5])],row[(indexlist[6])],
     81                    row[(indexlist[7])],row[(indexlist[8])],
     82                    row[(indexlist[9])]])
     83
     84
     85
  • trunk/anuga_work/development/mem_time_tests/triangles/rectanglecross/runcairns.py

    r8328 r8331  
    99from anuga.utilities import log
    1010
    11 #set up the variables for the temporary data files
    12 home = os.getenv('INUNDATIONHOME')
    13 scenariodir = add_directories(home, ["data","mem_time_test", "triangles",
    14                                      "rectanglecross"])
    15 storea = 'storea.txt'
    16 file_path_storea = os.path.join(scenariodir, storea)
    17 
    1811#set up the variables for the simulation out put and log files
    1912a = int(sys.argv[1])
    2013l = float(sys.argv[2])
    2114
     15home = os.getenv('INUNDATIONHOME')
    2216scenariodirV = add_directories(home, ["data","mem_time_test", "triangles",
    2317                                       "rectanglecross", "triangles-" + str(a) +"-"+ str(l)])
     
    2519log._setup = False
    2620
    27 log.resource_usage_timing(prefix = 'BeforeSimulation')#get memory usage
     21log.timingInfo(msg=('variable1,'+str(a))) #write the variable to be measured to file
     22log.timingInfo(msg=('variable2,'+str(l))) #write the variable to be measured to file
     23
     24log.timingInfo(msg=('beforetime,'+str(log.TimeStamp()))) #get the time at the beginning of the simulation
     25
     26log.resource_usage_timing(prefix = 'beforesimulation')#get memory usage
    2827#------------------------------------------------------------------------------
    2928# Create the triangular mesh and domain
     
    3332domain.set_name('CAIRNS.sww') # Name of sww file
    3433domain.set_datadir(scenariodirV)# Store sww output here
    35 log.resource_usage_timing(prefix = 'AfterMesh') #get memory usage
     34log.resource_usage_timing(prefix = 'aftermesh') #get memory usage
    3635#------------------------------------------------------------------------------
    3736# Setup initial conditions
     
    4039#get the number of triangles
    4140number=len(domain)
     41log.timingInfo(msg=('variable3,'+str(number))) #write the variable to be measured to file
    4242
    4343def topography(x,y):
     
    6767
    6868log.resource_usage_timing(prefix='aftersimulation')#get memory usage
    69    
    70 #write the number of triangles to the text file
    71 v = open(file_path_storea, 'r+')
    72 v.write(str(number))
     69log.timingInfo(msg=('aftertime,'+str(log.TimeStamp()))) #get the time at the end of the simulation
Note: See TracChangeset for help on using the changeset viewer.