Changeset 3926 for anuga_core
- Timestamp:
- Nov 7, 2006, 10:57:58 AM (18 years ago)
- Location:
- anuga_core/source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/abstract_2d_finite_volumes/domain.py
r3850 r3926 46 46 ghost_recv_dict=None, 47 47 processor=0, 48 numproc=1): 48 numproc=1, 49 number_of_full_nodes=0, 50 number_of_full_triangles=0): 49 51 50 52 … … 126 128 127 129 # List of other quantity names 128 if ghost_recv_dict 129 self.ghost_recv_dict 130 if ghost_recv_dict is None: 131 self.ghost_recv_dict = {} 130 132 else: 131 self.ghost_recv_dict 133 self.ghost_recv_dict = ghost_recv_dict 132 134 133 135 self.processor = processor 134 self.numproc = numproc 136 self.numproc = numproc 137 138 self.number_of_full_nodes=number_of_full_nodes 139 self.number_of_full_triangles=number_of_full_triangles 140 135 141 136 142 # Setup Communication Buffers 137 138 143 if verbose: print 'Domain: Set up communication buffers (parallel)' 139 144 self.nsys = len(self.conserved_quantities) -
anuga_core/source/anuga/shallow_water/data_manager.py
r3846 r3926 356 356 Q = domain.quantities['elevation'] 357 357 X,Y,Z,V = Q.get_vertex_values(xy=True, 358 precision =self.precision)358 precision=self.precision) 359 359 360 360 -
anuga_core/source/anuga/shallow_water/shallow_water_domain.py
r3876 r3926 111 111 ghost_recv_dict=None, 112 112 processor=0, 113 numproc=1): 113 numproc=1, 114 number_of_full_nodes=0, 115 number_of_full_triangles=0): 114 116 115 117 … … 131 133 ghost_recv_dict, 132 134 processor, 133 numproc) 134 135 numproc, 136 number_of_full_nodes=number_of_full_nodes, 137 number_of_full_triangles=number_of_full_triangles) 135 138 136 139 self.minimum_allowed_height = minimum_allowed_height -
anuga_core/source/anuga_parallel/build_commun.py
r3460 r3926 270 270 submesh_cell["ghost_quan"][qkeys[i]][:] = tmp[:] 271 271 272 return submesh_cell, triangles_per_proc 272 return submesh_cell, triangles_per_proc,\ 273 no_full_nodes, no_full_triangles 273 274 274 275 … … 296 297 myid = pypar.rank() 297 298 298 [submesh_cell, triangles_per_proc] = rec_submesh_flat(p) 299 [submesh_cell, triangles_per_proc,\ 300 number_of_full_nodes, number_of_full_triangles] = rec_submesh_flat(p) 299 301 300 302 # find the full triangles assigned to this processor … … 312 314 numproc) 313 315 314 return GAnodes, GAtriangles, boundary, quantities, ghost_rec, full_send 316 return GAnodes, GAtriangles, boundary, quantities,\ 317 ghost_rec, full_send,\ 318 number_of_full_nodes, number_of_full_triangles 319 315 320 316 321 ######################################################### -
anuga_core/source/anuga_parallel/parallel_api.py
r3904 r3926 4 4 """ 5 5 6 # Parallelism 6 from Numeric import zeros 7 7 8 8 # The abstract Python-MPI interface … … 21 21 # Mesh partitioning using Metis 22 22 from anuga_parallel.build_submesh import build_submesh 23 from anuga_parallel.build_local import build_local_mesh24 23 from anuga_parallel.pmesh_divide import pmesh_divide_metis 25 24 … … 97 96 points, vertices, boundary, quantities,\ 98 97 ghost_recv_dict, full_send_dict,\ 99 = distribute_mesh(domain) 98 number_of_full_nodes, number_of_full_triangles =\ 99 distribute_mesh(domain) 100 100 101 101 102 if verbose: print 'Communication done' … … 107 108 points, vertices, boundary, quantities,\ 108 109 ghost_recv_dict, full_send_dict,\ 109 = rec_submesh(0) 110 number_of_full_nodes, number_of_full_triangles =\ 111 rec_submesh(0) 110 112 111 113 … … 113 115 # Build the domain for this processor using partion structures 114 116 #------------------------------------------------------------------------ 117 115 118 domain = Parallel_Domain(points, vertices, boundary, 116 full_send_dict = full_send_dict, 117 ghost_recv_dict = ghost_recv_dict) 119 full_send_dict=full_send_dict, 120 ghost_recv_dict=ghost_recv_dict, 121 number_of_full_nodes=number_of_full_nodes, 122 number_of_full_triangles=number_of_full_triangles) 118 123 119 124 #------------------------------------------------------------------------ … … 142 147 #------------------------------------------------------------------------ 143 148 return domain 144 145 149 146 150 … … 166 170 quantities, triangles_per_proc) 167 171 172 for p in range(numprocs): 173 M = len(submesh['ghost_triangles'][p]) 174 print 'There are %d ghost triangles on proc %d' %(M, p) 175 N = len(submesh['ghost_nodes'][p]) 176 print 'There are %d ghost nodes on proc %d' %(N, p) 177 178 168 179 # Send the mesh partition to the appropriate processor 169 180 print 'Distribute submeshes' … … 172 183 173 184 # Build the local mesh for processor 0 174 points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict = 185 points, vertices, boundary, quantities, ghost_recv_dict, full_send_dict =\ 175 186 extract_hostmesh(submesh, triangles_per_proc) 176 187 188 # Keep track of the number full nodes and triangles. 189 # This is useful later if one needs access to a ghost-free domain 190 # Here, we do it for process 0. The others are done in rec_submesh. 191 number_of_full_nodes = len(submesh['full_nodes'][0]) 192 number_of_full_triangles = len(submesh['full_triangles'][0]) 193 194 #print 195 #for p in range(numprocs): 196 # print 'Process %d:' %(p) 197 # 198 # print 'full_triangles:' 199 # print submesh['full_triangles'][p] 200 # 201 # print 'full_nodes:' 202 # print submesh['full_nodes'][p] 203 # 204 # print 'ghost_triangles:' 205 # print submesh['ghost_triangles'][p]# 206 # 207 # print 'ghost_nodes:' 208 # print submesh['ghost_nodes'][p] 209 # print 210 # 211 #print 'Receive dict' 212 #print ghost_recv_dict 213 # 214 #print 'Send dict' 215 #print full_send_dict 216 217 177 218 # Return structures necessary for building the parallel domain 178 return points, vertices, boundary, quantities, \ 179 ghost_recv_dict, full_send_dict 180 181 182 183 219 return points, vertices, boundary, quantities,\ 220 ghost_recv_dict, full_send_dict,\ 221 number_of_full_nodes, number_of_full_triangles 222 223 224 225 -
anuga_core/source/anuga_parallel/parallel_shallow_water.py
r3893 r3926 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, coordinates, vertices, 33 boundary=None, 34 full_send_dict=None, 35 ghost_recv_dict=None, 36 number_of_full_nodes=0, 37 number_of_full_triangles=0): 34 38 35 39 Domain.__init__(self, … … 40 44 ghost_recv_dict=ghost_recv_dict, 41 45 processor=pypar.rank(), 42 numproc=pypar.size()) 46 numproc=pypar.size(), 47 number_of_full_nodes=number_of_full_nodes, 48 number_of_full_triangles=number_of_full_triangles) 43 49 44 50 N = self.number_of_elements -
anuga_core/source/anuga_parallel/test_parallel_sw_runup.py
r3829 r3926 35 35 #-------------------------------------------------------------------------- 36 36 points, vertices, boundary = rectangular_cross(10, 10) # Basic mesh 37 38 #if myid == 0: 39 # print 'points', points 40 # print 'vertices', vertices 41 37 42 domain = Domain(points, vertices, boundary) # Create domain 38 43
Note: See TracChangeset
for help on using the changeset viewer.