Changeset 9220
- Timestamp:
- Jun 25, 2014, 9:03:17 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_parallel/test_parallel_frac_op.py
r9174 r9220 13 13 import warnings 14 14 warnings.simplefilter("ignore") 15 16 #from anuga.structures.boyd_box_operator import Boyd_box_operator17 #from anuga.structures.inlet_operator import Inlet_operator18 19 #from anuga.culvert_flows.culvert_routines import boyd_generalised_culvert_model20 15 21 16 … … 38 33 from anuga.geometry.polygon import inside_polygon, is_inside_polygon, line_intersect 39 34 40 #from parallel_operator_factory import Inlet_operator, Boyd_box_operator41 35 from anuga import Inlet_operator, Boyd_box_operator 42 36 … … 246 240 if verbose: 247 241 print 'P%d tri %d, control = %s, actual = %s, Success = %s' %(myid, i, control_data[i], stage.centroid_values[tri_ids[i]], local_success) 248 assert local_success, 'Ouput P%d tri %d, control = %s, actual = %s, Success = %s' %(myid, i, control_data[i], stage.centroid_values[tri_ids[i]], local_success) 249 250 251 242 if not local_success: 243 print 'Ouput P%d tri %d, control = %s, actual = %s, Success = %s' %(myid, i, control_data[i], stage.centroid_values[tri_ids[i]], local_success) 244 245 246 #assert success 252 247 253 248 if inlet0 is not None: … … 274 269 #assert(success) 275 270 276 return control_data 271 return control_data, success 277 272 278 273 … … 308 303 if myid == 0: 309 304 if verbose: print 'PARALLEL START' 305 random.seed(2) 310 306 for i in range(samples): 311 307 x = random.randrange(0,1000)/1000.0 * length … … 320 316 321 317 if myid == 0: 322 control_data = run_test(parallel=False, test_points = test_points, verbose = verbose)318 control_data, success = run_test(parallel=False, test_points = test_points, verbose = verbose) 323 319 324 320 for proc in range(1,numprocs): … … 329 325 330 326 pypar.barrier() 331 run_test(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose) 332 327 _, success = run_test(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose) 328 329 sys.stdout.flush() 330 331 pypar.barrier() 332 333 msg = 'Discrepency between sequential and parallel runs on P%g' % myid 334 assert success, msg 333 335 334 336 finalize()
Note: See TracChangeset
for help on using the changeset viewer.