Changeset 9220


Ignore:
Timestamp:
Jun 25, 2014, 9:03:17 PM (10 years ago)
Author:
steve
Message:

Should produce the same error for each run of test_parallel_frac_op.py

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga_parallel/test_parallel_frac_op.py

    r9174 r9220  
    1313import warnings
    1414warnings.simplefilter("ignore")
    15 
    16 #from anuga.structures.boyd_box_operator import Boyd_box_operator
    17 #from anuga.structures.inlet_operator import Inlet_operator
    18                            
    19 #from anuga.culvert_flows.culvert_routines import boyd_generalised_culvert_model
    2015
    2116
     
    3833from anuga.geometry.polygon import inside_polygon, is_inside_polygon, line_intersect
    3934
    40 #from parallel_operator_factory import Inlet_operator, Boyd_box_operator
    4135from anuga import Inlet_operator, Boyd_box_operator
    4236
     
    246240                if verbose:
    247241                    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       
    252247               
    253248        if inlet0 is not None:
     
    274269        #assert(success)
    275270
    276     return control_data
     271    return control_data, success
    277272
    278273
     
    308303        if myid == 0:
    309304            if verbose: print 'PARALLEL START'
     305            random.seed(2)
    310306            for i in range(samples):
    311307                x = random.randrange(0,1000)/1000.0 * length
     
    320316
    321317        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)
    323319
    324320            for proc in range(1,numprocs):
     
    329325
    330326        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
    333335
    334336    finalize()
Note: See TracChangeset for help on using the changeset viewer.