Changeset 9737 for trunk/anuga_core/anuga/parallel
- Timestamp:
- Oct 4, 2016, 4:13:00 PM (9 years ago)
- Location:
- trunk/anuga_core/anuga/parallel
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/parallel/parallel_api.py
r9500 r9737 43 43 44 44 45 def collect_value(value): 46 47 value = value 48 49 if myid == 0: 50 for i in range(numprocs): 51 if i == 0: continue 52 val = receive(i) 53 value = value + val 54 else: 55 send(value, 0) 56 57 return value 58 59 60 61 45 62 def distribute(domain, verbose=False, debug=False, parameters = None): 46 63 """ Distribute the domain to all processes … … 61 78 domain_name, domain_dir, domain_store, domain_store_centroids, \ 62 79 domain_minimum_storable_height, domain_minimum_allowed_height, \ 63 domain_flow_algorithm, georef = partition.extract_submesh(0) 80 domain_flow_algorithm, domain_georef, \ 81 domain_quantities_to_be_stored, domain_smooth \ 82 = partition.extract_submesh(0) 64 83 65 84 for p in range(1, numprocs): … … 72 91 73 92 kwargs, points, vertices, boundary, quantities, boundary_map, \ 74 domain_name, domain_dir, domain_store, domain_store_centroids, \ 75 domain_minimum_storable_height, domain_minimum_allowed_height, \ 76 domain_flow_algorithm, georef = receive(0) 93 domain_name, domain_dir, domain_store, domain_store_centroids, \ 94 domain_minimum_storable_height, domain_minimum_allowed_height, \ 95 domain_flow_algorithm, domain_georef, \ 96 domain_quantities_to_be_stored, domain_smooth \ 97 = receive(0) 77 98 78 99 #--------------------------------------------------------------------------- … … 111 132 parallel_domain.set_minimum_allowed_height(domain_minimum_allowed_height) 112 133 parallel_domain.set_flow_algorithm(domain_flow_algorithm) 113 parallel_domain.geo_reference = georef 114 134 parallel_domain.geo_reference = domain_georef 135 parallel_domain.set_quantities_to_be_stored(domain_quantities_to_be_stored) 136 parallel_domain.smooth = domain_smooth 115 137 116 138 return parallel_domain … … 465 487 466 488 ## return l2g 467 -
trunk/anuga_core/anuga/parallel/parallel_boyd_box_operator.py
r9681 r9737 23 23 losses, 24 24 width, 25 blockage=0.0, #added PM 24/7/2016 25 26 z1=0.0, 26 z2=0.0, 27 height=None, 27 z2=0.0, 28 height=None, 28 29 end_points=None, 29 30 exchange_lines=None, … … 55 56 width=width, 56 57 height=height, 58 blockage=0.0, #added PM 24/7/2016 57 59 z1=0.0, 58 60 z2=0.0, 59 diameter= None, 61 diameter= None, 60 62 apron=apron, 61 63 manning=manning, … … 92 94 self.culvert_width = self.get_culvert_width() 93 95 self.culvert_height = self.get_culvert_height() 96 self.culvert_blockage = self.get_culvert_blockage()#added PM 24/7/2016 94 97 95 98 self.max_velocity = 10.0 … … 283 286 flow_width =self.culvert_width, 284 287 length =self.culvert_length, 288 blockage =self.culvert_blockage, #added PM 24/7/2016 285 289 driving_energy =self.driving_energy, 286 290 delta_total_energy =self.delta_total_energy, -
trunk/anuga_core/anuga/parallel/parallel_generic_communications.py
r9529 r9737 134 134 135 135 136 def communicate_ghosts_asynchronous(domain ):136 def communicate_ghosts_asynchronous(domain, quantities=None): 137 137 138 138 # We must send the information from the full cells and … … 145 145 import time 146 146 t0 = time.time() 147 148 if quantities is None: 149 quantities = domain.conserved_quantities 147 150 148 151 # update of non-local ghost cells by copying full cell data into the … … 156 159 Xout = domain.full_send_dict[send_proc][2] 157 160 158 for i, q in enumerate( domain.conserved_quantities):161 for i, q in enumerate(quantities): 159 162 #print 'Store send data',i,q 160 163 Q_cv = domain.quantities[q].centroid_values … … 163 166 164 167 165 # from pprint import pprint 166 # 167 # if pypar.rank() == 0: 168 # print 'Before commun 0' 169 # pprint(domain.full_send_dict) 170 # 171 # if pypar.rank() == 1: 172 # print 'Before commun 1' 173 # pprint(domain.full_send_dict) 168 174 169 175 170 … … 197 192 #print X 198 193 199 for i, q in enumerate( domain.conserved_quantities):194 for i, q in enumerate(quantities): 200 195 #print 'Read receive data',i,q 201 196 Q_cv = domain.quantities[q].centroid_values -
trunk/anuga_core/anuga/parallel/parallel_operator_factory.py
r9672 r9737 118 118 def Boyd_box_operator(domain, 119 119 losses, 120 width, 121 height=None, 120 width, 121 height=None, 122 blockage=0.0, #added by DPM 24/7/2016 122 123 z1=0.0, 123 124 z2=0.0, … … 147 148 width=width, 148 149 height=height, 150 blockage=blockage,#added by DPM 24/7/2016 149 151 z1=0.0, 150 152 z2=0.0, … … 253 255 width=width, 254 256 height=height, 257 blockage=blockage, #added by DPM 24/7/2016 255 258 end_points=end_points, 256 259 exchange_lines=exchange_lines, -
trunk/anuga_core/anuga/parallel/parallel_shallow_water.py
r9500 r9737 136 136 137 137 138 def update_ghosts(self ):138 def update_ghosts(self, quantities=None): 139 139 """We must send the information from the full cells and 140 140 receive the information for the ghost cells 141 141 """ 142 142 143 generic_comms.communicate_ghosts_asynchronous(self )143 generic_comms.communicate_ghosts_asynchronous(self, quantities) 144 144 #generic_comms.communicate_ghosts_blocking(self) 145 145 -
trunk/anuga_core/anuga/parallel/parallel_structure_operator.py
r9682 r9737 46 46 z1,#added by PM 22/10/2013 47 47 z2,#added by PM 22/10/2013 48 blockage,#added by PM 24/7/2016 48 49 apron, 49 50 manning, … … 117 118 self.z1 = z1 #added by PM 22/10/2013 118 119 self.z2 = z2 #added by PM 22/10/2013 120 self.blockage = blockage #added by PM 24/7/2016 119 121 self.apron = apron 120 122 self.manning = manning … … 710 712 def get_culvert_z2(self): #added by PM 22/10/2013 711 713 return self.z2 712 714 715 def get_culvert_blockage(self): #added by PM 24/7/2016 716 return self.blockage #added by PM 24/7/2016 717 713 718 def get_culvert_apron(self): 714 719 return self.apron … … 746 751 747 752 self.culvert_z2 = z2 748 753 754 def set_culvert_blockage(self, blockage): #added by PM 24/7/2016 755 756 self.culvert_blockage = blockage #added by PM 24/7/2016 757 749 758 def parallel_safe(self): 750 759 return True -
trunk/anuga_core/anuga/parallel/parallel_weir_orifice_trapezoid_operator.py
r9681 r9737 247 247 248 248 Q, barrel_velocity, outlet_culvert_depth, flow_area, case = \ 249 weir_orifice_trapezoid_function(depth 249 weir_orifice_trapezoid_function(depth =self.culvert_height, 250 250 width =self.culvert_width, 251 251 z1 =self.culvert_z1, -
trunk/anuga_core/anuga/parallel/sequential_distribute.py
r9501 r9737 60 60 self.domain_minimum_allowed_height = domain.get_minimum_allowed_height() 61 61 self.domain_georef = domain.geo_reference 62 self.domain_quantities_to_be_stored = domain.quantities_to_be_stored 63 self.domain_smooth = domain.smooth 62 64 self.number_of_global_triangles = domain.number_of_triangles 63 65 self.number_of_global_nodes = domain.number_of_nodes … … 193 195 domain_flow_algorithm = self.domain_flow_algorithm 194 196 domain_georef = self.domain_georef 197 domain_quantities_to_be_stored = self.domain_quantities_to_be_stored 198 domain_smooth = self.domain_smooth 195 199 196 200 tostore = (kwargs, points, vertices, boundary, quantities, \ … … 199 203 domain_minimum_storable_height, \ 200 204 domain_minimum_allowed_height, domain_flow_algorithm, \ 201 domain_georef )205 domain_georef, domain_quantities_to_be_stored, domain_smooth) 202 206 203 207 … … 269 273 domain_name, domain_dir, domain_store, domain_store_centroids, \ 270 274 domain_minimum_storable_height, domain_minimum_allowed_height, \ 271 domain_flow_algorithm, georef = cPickle.load(f) 275 domain_flow_algorithm, domain_georef, \ 276 domain_quantities_to_be_stored, domain_smooth = cPickle.load(f) 272 277 f.close() 273 278 … … 304 309 domain.set_minimum_storable_height(domain_minimum_storable_height) 305 310 domain.set_minimum_allowed_height(domain_minimum_allowed_height) 306 domain.geo_reference = georef 307 311 domain.geo_reference = domain_georef 312 domain.set_quantities_to_be_stored(domain_quantities_to_be_stored) 313 domain.smooth = domain_smooth 308 314 309 315 return domain -
trunk/anuga_core/anuga/parallel/tests/test_sequential_dist_sw_flow.py
r9571 r9737 41 41 #-------------------------------------------------------------------------- 42 42 yieldstep = 0.25 43 finaltime = 3.043 finaltime = 1.0 44 44 nprocs = 4 45 45 N = 29 … … 149 149 if verbose: 150 150 151 order = 0151 order = 2 152 152 print 'PDOMAIN CENTROID VALUES' 153 153 print num.linalg.norm(odomain_c.x-pdomain_c.x,ord=order)
Note: See TracChangeset
for help on using the changeset viewer.