Changeset 5763
- Timestamp:
- Sep 15, 2008, 2:04:22 PM (16 years ago)
- Location:
- anuga_core/source/anuga_parallel
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga_parallel/parallel_advection.py
r5242 r5763 79 79 # hence we need to create some dummy arrays for communication 80 80 ltimestep = ones( 1, Float ) 81 ltimestep[0] = self. timestep81 ltimestep[0] = self.flux_timestep 82 82 gtimestep = zeros( 1, Float) # Buffer for results 83 83 … … 85 85 pypar.broadcast(gtimestep,0) 86 86 87 self. timestep = gtimestep[0]87 self.flux_timestep = gtimestep[0] 88 88 89 89 self.communication_reduce_time += time.time()-t0 -
anuga_core/source/anuga_parallel/parallel_shallow_water.py
r4884 r5763 118 118 for pid in range(self.numproc): 119 119 #print 'P%d calling broadcast from %d' %(self.processor, pid) 120 self.local_timestep[0] = self. timestep120 self.local_timestep[0] = self.flux_timestep 121 121 pypar.broadcast(self.local_timestep, pid, bypass=True) 122 122 self.local_timesteps[pid] = self.local_timestep[0] 123 123 124 self.timestep = min(self.local_timesteps) 124 self.flux_timestep = min(self.local_timesteps) 125 126 #print 'Flux Timestep %d P%d_%d' %(self.flux_timestep, self.processor, self.numproc) 125 127 126 128 pypar.barrier() … … 147 149 import time 148 150 #Compute minimal timestep across all processes 149 self.local_timestep[0] = self. timestep151 self.local_timestep[0] = self.flux_timestep 150 152 use_reduce_broadcast = True 151 153 if use_reduce_broadcast: … … 158 160 #Alternative: Try using straight send and receives 159 161 t0 = time.time() 160 self.global_timestep[0] = self. timestep162 self.global_timestep[0] = self.flux_timestep 161 163 162 164 if self.processor == 0: … … 183 185 self.communication_broadcast_time += time.time()-t0 184 186 185 186 self.timestep = self.global_timestep[0] 187 #old_timestep = self.flux_timestep 188 self.flux_timestep = self.global_timestep[0] 189 #print 'Flux Timestep %15.5e %15.5e P%d_%d' %(self.flux_timestep, old_timestep, self.processor, self.numproc) 187 190 188 191 # LINDA: -
anuga_core/source/anuga_parallel/run_parallel_advection.py
r5762 r5763 50 50 processor_name = pypar.Get_processor_name() 51 51 52 N = 8053 M = 8052 N = 100 53 M = 100 54 54 55 55 ####################### … … 76 76 full_send_dict, ghost_recv_dict, velocity=[1.0, 0.0]) 77 77 78 # Turn on the visualisation 78 # Boundaries 79 80 T = Transmissive_boundary(domain) 79 81 80 82 81 83 82 84 83 # rect = [0.0, 0.0, 1.0, 1.0]84 # domain.initialise_visualiser(rect=rect)85 86 # Boundaries87 88 T = Transmissive_boundary(domain)89 domain.default_order = 290 85 domain.set_boundary( {'left': T, 'right': T, 'bottom': T, 'top': T, \ 91 86 'ghost': None} ) 87 88 89 # Set Evolve parameters 90 domain.set_default_order(2) 91 domain.set_timestepping_method('rk2') 92 93 print domain.get_timestepping_method() 94 95 #domain.use_edge_limiter = True 96 #domain.tight_slope_limiters = True 97 #domain.use_centroid_velocities = False 98 99 domain.CFL = 1.0 100 101 domain.set_beta(0.8) 102 92 103 93 104 # Ensure that the domain definitions make sense … … 105 116 from anuga.visualiser import RealtimeVisualiser 106 117 vis = RealtimeVisualiser(domain) 107 vis.render_quantity_height("elevation", offset=0.01, dynamic=False)118 #vis.render_quantity_height("elevation", offset=0.01, dynamic=False) 108 119 vis.render_quantity_height("stage", dynamic=True) 109 120 vis.colour_height_quantity('stage', (0.2, 0.2, 0.8)) … … 140 151 141 152 142 vis.join() 153 if visualise: vis.join() -
anuga_core/source/anuga_parallel/run_parallel_sw_rectangle.py
r3876 r5763 30 30 from parallel_meshes import parallel_rectangle 31 31 32 32 ############################### 33 # Read in processor information 34 ############################### 33 35 numprocs = pypar.size() 34 36 myid = pypar.rank() … … 38 40 N = M*numprocs 39 41 42 40 43 if myid == 0: 41 44 print 'N == %d' %N … … 44 47 parallel_rectangle(N, M, len1_g=1.0*numprocs, len2_g = 1.0) 45 48 49 print "Myid = ", myid, "no points = ", len(points), \ 50 "no vertices = ", len(vertices), "no boundaries = ", len(boundary) 46 51 52 ########################################### 53 # Start the computations on each subpartion 54 ########################################### 47 55 48 56 domain = Parallel_Domain(points, vertices, boundary, 49 57 full_send_dict = full_send_dict, 50 58 ghost_recv_dict = ghost_recv_dict) 51 52 # Make a notes of which triangles are full and which are ghost53 54 tri_full_flag = build_full_flag(domain, ghost_recv_dict)55 56 print 'number of triangles = ', domain.number_of_elements57 58 59 rect = [ 0.0, 0.0, 1.0*numprocs, 1.0]60 ## try:61 ## domain.initialise_visualiser(rect=rect)62 ## domain.visualiser.qcolor['stage'] = (0.0, 0.0, 0.8)63 ## domain.visualiser.scale_z['stage'] = 1.064 ## domain.visualiser.scale_z['elevation'] = 0.0565 ## except:66 ## print 'No visualiser'67 68 69 70 71 72 59 73 60 … … 80 67 81 68 domain.set_boundary( {'left': R, 'right': R, 'bottom': R, 'top': R, 'ghost': None} ) 69 70 71 72 82 73 domain.check_integrity() 83 74 … … 99 90 domain.set_quantity('stage', Set_Stage(0.2, 0.4, 0.25, 0.75, 1.0, 0.00)) 100 91 92 93 # Set Evolve parameters 94 domain.set_default_order(2) 95 domain.set_timestepping_method('rk2') 96 97 print domain.get_timestepping_method() 98 99 #domain.use_edge_limiter = True 100 #domain.tight_slope_limiters = True 101 #domain.use_centroid_velocities = False 102 103 domain.CFL = 1.0 104 105 domain.set_beta(0.8) 106 107 108 101 109 if myid == 0: 102 110 import time … … 105 113 106 114 # Turn on the visualisation 115 visualise = True 116 if visualise: 117 from anuga.visualiser import RealtimeVisualiser 118 vis = RealtimeVisualiser(domain) 119 vis.render_quantity_height("elevation", offset=0.001, dynamic=False) 120 vis.render_quantity_height("stage", dynamic=True) 121 vis.colour_height_quantity('stage', (0.2, 0.2, 0.8)) 122 vis.start() 123 import time 124 time.sleep(2.0) 107 125 108 rect = [0.0, 0.0, 1.0, 1.0]109 domain.initialise_visualiser()110 126 111 domain.default_order = 2112 domain.beta_w = 1.0113 domain.beta_w_dry = 0.2114 domain.beta_uh = 1.0115 domain.beta_uh_dry = 0.2116 domain.beta_vh = 1.0117 domain.beta_vh_dry = 0.2118 127 119 #domain.beta_w = 0.9 120 #domain.beta_w_dry = 0.9 121 #domain.beta_uh = 0.9 122 #domain.beta_uh_dry = 0.9 123 #domain.beta_vh = 0.9 124 #domain.beta_vh_dry = 0.9 125 126 yieldstep = 0.005 128 yieldstep = 0.01 127 129 finaltime = 1.0 128 130 … … 132 134 domain.write_time() 133 135 #print_test_stats(domain, tri_full_flag) 136 if visualise: 137 vis.update() 138 139 140 141 if visualise: vis.evolveFinished() 134 142 135 143 if myid == 0: … … 140 148 141 149 150 if visualise: vis.join() 142 151 pypar.finalize()
Note: See TracChangeset
for help on using the changeset viewer.