Changeset 8425
- Timestamp:
- May 8, 2012, 9:59:56 PM (13 years ago)
- Location:
- trunk/anuga_core/source/anuga_parallel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga_parallel/parallel_boyd_box_operator.py
r8420 r8425 97 97 def parallel_safe(self): 98 98 99 print "ZZZZ parallel_boyd"100 99 return True 101 100 -
trunk/anuga_core/source/anuga_parallel/test_parallel_frac_op.py
r8424 r8425 15 15 16 16 #from anuga.culvert_flows.culvert_routines import boyd_generalised_culvert_model 17 17 18 19 #------------------------------------------ 20 # Import pypar without the initial output 21 #------------------------------------------ 22 class NullStream: 23 def write(self,text): 24 pass 25 sys.stdout = NullStream() 26 import pypar 27 sys.stdout = sys.__stdout__ 28 29 18 30 from math import pi, pow, sqrt 19 31 … … 24 36 25 37 from parallel_operator_factory import Inlet_operator, Boyd_box_operator 26 import pypar 38 27 39 import random 28 40 import unittest … … 33 45 This test exercises the parallel culvert and checks values 34 46 """ 35 verbose = True36 nprocs = 247 verbose = False 48 nprocs = 3 37 49 38 50 … … 170 182 verbose=False) 171 183 172 if inlet0 is not None : inlet0.print_statistics()173 if inlet1 is not None : inlet1.print_statistics()174 if boyd_box0 is not None : boyd_box0.print_statistics()184 if inlet0 is not None and verbose: inlet0.print_statistics() 185 if inlet1 is not None and verbose: inlet1.print_statistics() 186 if boyd_box0 is not None and verbose: boyd_box0.print_statistics() 175 187 176 188 # if parallel: … … 210 222 ##----------------------------------------------------------------------- 211 223 212 for t in domain.evolve(yieldstep = 0.1, finaltime = 38):213 if myid == 0 :224 for t in domain.evolve(yieldstep = 2.0, finaltime = 2.0): 225 if myid == 0 and verbose: 214 226 domain.write_time() 215 227 … … 219 231 220 232 221 if boyd_box0 is not None : boyd_box0.print_timestepping_statistics()233 if boyd_box0 is not None and verbose : boyd_box0.print_timestepping_statistics() 222 234 223 235 #for i in range(samples): … … 282 294 283 295 284 #assert(success)296 assert(success) 285 297 286 298 return control_data … … 290 302 # against the sequential code. 291 303 292 class Test_parallel_ shallow_domain(unittest.TestCase):293 def test_parallel_ shallow_domain(self):304 class Test_parallel_frac_op(unittest.TestCase): 305 def test_parallel_frac_op(self): 294 306 #print "Expect this test to fail if not run from the parallel directory." 295 result = os.system("mpirun -np %d python test_parallel_ shallow_domain.py" % nprocs)307 result = os.system("mpirun -np %d python test_parallel_frac_op.py" % nprocs) 296 308 assert_(result == 0) 297 309 … … 307 319 if numprocs == 1: 308 320 runner = unittest.TextTestRunner() 309 suite = unittest.makeSuite(Test_parallel_shallow_domain, 'test') 321 suite = unittest.makeSuite(Test_parallel_frac_op, 'test') 322 #print "Running for numproc = 1" 310 323 runner.run(suite) 311 324 else: 312 325 #print "Running for numproc > 1" 313 326 pypar.barrier() 314 327 test_points = [] … … 328 341 329 342 if myid == 0: 330 control_data = run_test(parallel=False, test_points = test_points, verbose = True)343 control_data = run_test(parallel=False, test_points = test_points, verbose = verbose) 331 344 332 345 for proc in range(1,numprocs): … … 337 350 338 351 pypar.barrier() 339 run_test(parallel=True, control_data = control_data, test_points = test_points, verbose = True)352 run_test(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose) 340 353 341 354
Note: See TracChangeset
for help on using the changeset viewer.