Changeset 2813
- Timestamp:
- May 5, 2006, 8:47:05 PM (19 years ago)
- Location:
- inundation
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/parallel/parallel_advection.py
r1588 r2813 23 23 pass 24 24 25 from advection import *25 from pyvolution.advection import * 26 26 from Numeric import zeros, Float, Int, ones, allclose, array 27 27 import pypar … … 30 30 class Parallel_Domain(Domain): 31 31 32 def __init__(self, coordinates, vertices, boundary = None, 33 full_send_dict = None, ghost_recv_dict = None, 32 def __init__(self, 33 coordinates, 34 vertices, 35 boundary = None, 36 full_send_dict = None, 37 ghost_recv_dict = None, 34 38 velocity = None): 35 39 36 self.processor = pypar.rank() 37 self.numproc = pypar.size() 38 39 Domain.__init__(self, coordinates, vertices, boundary, 40 velocity = velocity) 40 Domain.__init__(self, 41 coordinates, 42 vertices, 43 boundary, 44 velocity = velocity, 45 full_send_dict=full_send_dict, 46 ghost_recv_dict=ghost_recv_dict, 47 processor=pypar.rank(), 48 numproc=pypar.size() 49 ) 41 50 42 51 N = self.number_of_elements 43 52 44 self.processor = pypar.rank()45 self.numproc = pypar.size()46 47 48 # Setup Communication Buffers49 self.nsys = 150 for key in full_send_dict:51 buffer_shape = full_send_dict[key][0].shape[0]52 full_send_dict[key].append(zeros( (buffer_shape,self.nsys) ,Float))53 54 55 for key in ghost_recv_dict:56 buffer_shape = ghost_recv_dict[key][0].shape[0]57 ghost_recv_dict[key].append(zeros( (buffer_shape,self.nsys) ,Float))58 59 self.full_send_dict = full_send_dict60 self.ghost_recv_dict = ghost_recv_dict61 53 62 54 self.communication_time = 0.0 63 55 self.communication_reduce_time = 0.0 56 57 58 print 'processor',self.processor 59 print 'numproc',self.numproc 64 60 65 61 def check_integrity(self): -
inundation/parallel/parallel_shallow_water.py
r2090 r2813 34 34 full_send_dict = None, ghost_recv_dict = None): 35 35 36 self.processor = pypar.rank() 37 self.numproc = pypar.size() 38 39 Domain.__init__(self, coordinates, vertices, boundary) 36 Domain.__init__(self, 37 coordinates, 38 vertices, 39 boundary, 40 full_send_dict=full_send_dict, 41 ghost_recv_dict=ghost_recv_dict, 42 processor=pypar.rank(), 43 numproc=pypar.size()) 40 44 41 45 N = self.number_of_elements 42 46 43 self.processor = pypar.rank()44 self.numproc = pypar.size()45 46 # Setup Communication Buffers47 self.nsys = 348 for key in full_send_dict:49 buffer_shape = full_send_dict[key][0].shape[0]50 full_send_dict[key].append(zeros( (buffer_shape,self.nsys) ,Float))51 52 53 for key in ghost_recv_dict:54 buffer_shape = ghost_recv_dict[key][0].shape[0]55 ghost_recv_dict[key].append(zeros( (buffer_shape,self.nsys) ,Float))56 57 self.full_send_dict = full_send_dict47 # self.processor = pypar.rank() 48 # self.numproc = pypar.size() 49 # 50 # # Setup Communication Buffers 51 # self.nsys = 3 52 # for key in full_send_dict: 53 # buffer_shape = full_send_dict[key][0].shape[0] 54 # full_send_dict[key].append(zeros( (buffer_shape,self.nsys) ,Float)) 55 # 56 # 57 # for key in ghost_recv_dict: 58 # buffer_shape = ghost_recv_dict[key][0].shape[0] 59 # ghost_recv_dict[key].append(zeros( (buffer_shape,self.nsys) ,Float)) 60 # 61 # self.full_send_dict = full_send_dict 58 62 self.ghost_recv_dict = ghost_recv_dict 59 63 … … 96 100 #print 'P%d calling broadcast from %d' %(self.processor, pid) 97 101 self.local_timestep[0] = self.timestep 98 pypar.broadcast(self.local_timestep, pid, bypass=True) 102 pypar.broadcast(self.local_timestep, pid, bypass=True) 99 103 self.local_timesteps[pid] = self.local_timestep[0] 100 104 -
inundation/parallel/run_parallel_sw_rectangle.py
r2769 r2813 34 34 from parallel_meshes import parallel_rectangle 35 35 36 37 <<<<<<< .mine38 =======39 #from pmesh_divide import pmesh_divide, pmesh_divide_steve40 41 >>>>>>> .r276842 # read in the processor information43 36 44 37 numprocs = pypar.size() … … 80 73 81 74 82 domain.default_order = 275 domain.default_order = 1 83 76 84 77 #Boundaries … … 96 89 """ 97 90 98 def __init__(self, x0=0.25, x1=0. 5, y0=0.0, y1=1.0, h=1.0):91 def __init__(self, x0=0.25, x1=0.75, y0=0.0, y1=1.0, h=5.0): 99 92 self.x0 = x0 100 93 self.x1 = x1 … … 111 104 import time 112 105 t0 = time.time() 106 107 108 # Turn on the visualisation 109 110 rect = [0.0, 0.0, 1.0, 1.0] 111 domain.initialise_visualiser() 113 112 114 113 yieldstep = 0.005 -
inundation/pyvolution/advection.py
r2494 r2813 40 40 class Domain(Generic_domain): 41 41 42 def __init__(self, coordinates, vertices, boundary = None, 43 tagged_elements = None, geo_reference = None, 44 use_inscribed_circle=False, velocity = None): 42 def __init__(self, 43 coordinates, 44 vertices, 45 boundary = None, 46 tagged_elements = None, 47 geo_reference = None, 48 use_inscribed_circle=False, 49 velocity = None, 50 full_send_dict=None, 51 ghost_recv_dict=None, 52 processor=0, 53 numproc=1 54 ): 45 55 46 56 conserved_quantities = ['stage'] 47 57 other_quantities = [] 48 Generic_domain.__init__(self, coordinates, vertices, boundary, 49 conserved_quantities, other_quantities, 50 tagged_elements, geo_reference, 51 use_inscribed_circle) 58 Generic_domain.__init__(self, 59 source=coordinates, 60 triangles=vertices, 61 boundary=boundary, 62 conserved_quantities=conserved_quantities, 63 other_quantities=other_quantities, 64 tagged_elements=tagged_elements, 65 geo_reference=geo_reference, 66 use_inscribed_circle=use_inscribed_circle, 67 full_send_dict=full_send_dict, 68 ghost_recv_dict=ghost_recv_dict, 69 processor=processor, 70 numproc=numproc) 52 71 53 72 … … 343 362 yieldstep = None, 344 363 finaltime = None, 345 duration = None, 364 duration = None, 346 365 skip_initial_step = False): 347 366 348 367 """Specialisation of basic evolve method from parent class 349 368 """ … … 365 384 duration=duration, 366 385 skip_initial_step=skip_initial_step): 367 386 368 387 369 388 -
inundation/pyvolution/domain.py
r2808 r2813 29 29 mesh_filename=None, 30 30 use_cache=False, 31 verbose=False): 31 verbose=False 32 ): 32 33 33 34 """Instantiate generic computational Domain. -
inundation/pyvolution/netherlands.py
r2731 r2813 12 12 #rpdb.set_active() 13 13 14 from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary,\14 from shallow_water_vtk import Domain, Reflective_boundary, Dirichlet_boundary,\ 15 15 Transmissive_boundary, Constant_height, Constant_stage 16 16
Note: See TracChangeset
for help on using the changeset viewer.