Changeset 5847 for anuga_validation


Ignore:
Timestamp:
Oct 18, 2008, 9:13:18 PM (16 years ago)
Author:
steve
Message:

Changed parallel_api so that global mesh only needs to
be constructed on processor 0

Location:
anuga_validation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/okushiri_2005/run_okushiri_parallel.py

    r4299 r5847  
    3939#-------------------------
    4040# Create Domain from mesh
     41# on processor 0
    4142#-------------------------
    42 domain = Domain(project.mesh_filename, use_cache=use_cache, verbose=True)
    43 print domain.statistics()
     43if myid == 0 :
     44    domain = Domain(project.mesh_filename, use_cache=use_cache, verbose=True)
     45    print domain.statistics()
    4446
    45 
    46 #-------------------------
    47 # Initial Conditions
    48 #-------------------------
    49 domain.set_quantity('friction', 0.0)
    50 domain.set_quantity('stage', 0.0)
    51 domain.set_quantity('elevation',
    52                     filename=project.bathymetry_filename,
    53                     alpha=0.02,                   
    54                     verbose=True,
    55                     use_cache=use_cache)
    56 
     47    #-------------------------
     48    # Initial Conditions
     49    # At present need to do the
     50    # fitting of the bathymetry
     51    # on a global domain, ie before
     52    # distributing the domain
     53    #-------------------------
     54    domain.set_quantity('friction', 0.0)
     55    domain.set_quantity('stage', 0.0)
     56    domain.set_quantity('elevation',
     57                        filename=project.bathymetry_filename,
     58                        alpha=0.02,                   
     59                        verbose=True,
     60                        use_cache=use_cache)
     61else:
     62    domain = None
    5763
    5864#-------------------------
     
    8692domain.set_boundary({'wave': Bts, 'wall': Br})
    8793
     94# Select triangle containing ch5 for diagnostic output
     95# around known gauge
     96# This should get triangle id 32833 with centroid (4.5244, 1.1972) on one processor
     97try:
     98    triangle_id = domain.get_triangle_containing_point([4.521, 1.196])
     99except:
     100    triangle_id = None
     101
    88102
    89103#-------------------------
     
    94108
    95109for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
    96     domain.write_time()
     110    if myid == 0 :
     111        domain.write_time()
     112
     113    if triangle_id is not None :
     114        print domain.timestepping_statistics(track_speeds=False,
     115                                             triangle_id=triangle_id)
    97116
    98117print 'That took %.2f seconds' %(time.time()-t0)
  • anuga_validation/performance_tests/run_profile.py

    r5320 r5847  
    5757s = 'for t in domain.evolve(yieldstep = 0.02, finaltime = 0.2): domain.write_time()'
    5858
     59#for t in domain.evolve(yieldstep = 0.02, finaltime = 0.2): domain.write_time()
     60
    5961
    6062import profile, pstats
Note: See TracChangeset for help on using the changeset viewer.