Changeset 9707
- Timestamp:
- Mar 6, 2015, 5:28:51 PM (9 years ago)
- Location:
- trunk/anuga_core
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/__init__.py
r9703 r9707 33 33 except NameError: 34 34 __ANUGA_SETUP__ = False 35 35 36 36 37 37 if __ANUGA_SETUP__: -
trunk/anuga_core/anuga/parallel/tests/skip_parallel_boyd_box_op_apron.py
r9572 r9707 42 42 This test exercises the parallel culvert and checks values 43 43 """ 44 verbose = False44 verbose = True 45 45 nprocs = 3 46 46 … … 302 302 303 303 304 assert(success) 305 306 return control_data 304 return control_data, success 307 305 308 306 … … 315 313 def test_parallel_operator(self): 316 314 317 318 #print "Expect this test to fail if not run from the parallel directory." 319 result = os.system("mpirun -np %d python test_parallel_boyd_box_op_apron.py" % nprocs) 320 assert_(result == 0) 315 abs_script_name = os.path.abspath(__file__) 316 cmd = "mpirun -np %d python %s" % (nprocs, abs_script_name) 317 exitstatus = os.system(cmd) 318 319 320 assert_(exitstatus == 0) 321 321 322 322 … … 353 353 354 354 if myid == 0: 355 control_data = run_simulation(parallel=False, test_points = test_points, verbose = verbose)355 control_data, success = run_simulation(parallel=False, test_points = test_points, verbose = verbose) 356 356 357 357 for proc in range(1,numprocs): … … 362 362 363 363 pypar.barrier() 364 run_simulation(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose) 365 366 367 finalize() 368 369 364 _, success = run_simulation(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose) 365 366 367 #assert(success) 368 all_success = True 369 if myid == 0: 370 all_success = success 371 for i in range(1,numprocs): 372 all_success = all_success and pypar.receive(i) 373 else: 374 pypar.send(success, 0) 375 376 if myid == 0: 377 for i in range(1,numprocs): 378 pypar.send(all_success,i) 379 else: 380 all_success= pypar.receive(0) 381 382 print 'myid ',myid, 'all_success ',all_success 383 384 385 finalize() 386 387 import sys 388 if all_success: 389 sys.exit(0) 390 else: 391 sys.exit(1) 392 393 394 -
trunk/anuga_core/anuga/parallel/tests/test_parallel_boyd_box_operator.py
r9701 r9707 270 270 print 'P%d average depth, control = %s, actual = %s' %(myid, control_data[samples+4], average_depth) 271 271 272 assert(success)273 274 275 return control_data 272 #assert(success) 273 274 275 return control_data, success 276 276 277 277 … … 284 284 285 285 abs_script_name = os.path.abspath(__file__) 286 exitstatus = mpi_cmd(nprocs, abs_script_name) 286 cmd = "mpirun -np %d python %s" % (nprocs, abs_script_name) 287 exitstatus = os.system(cmd) 288 #exitstatus = mpi_cmd(nprocs, abs_script_name) 287 289 288 290 assert_(exitstatus == 0) 289 291 290 292 291 def mpi_cmd(nprocs, script_name):292 293 import subprocess294 295 cmd = "mpirun -v -np %d python %s" % (nprocs, script_name)296 297 exitstatus = 0298 try:299 outtext = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)300 except subprocess.CalledProcessError as e:301 exitstatus=e.returncode302 outtext = e.output303 304 if verbose:305 print exitstatus306 print outtext307 308 309 return exitstatus293 # def mpi_cmd(nprocs, script_name): 294 # 295 # import subprocess 296 # 297 # cmd = "mpirun -v -np %d python %s" % (nprocs, script_name) 298 # 299 # exitstatus = 0 300 # try: 301 # outtext = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT) 302 # except subprocess.CalledProcessError as e: 303 # exitstatus=e.returncode 304 # outtext = e.output 305 # 306 # if verbose: 307 # print exitstatus 308 # print outtext 309 # 310 # 311 # return exitstatus 310 312 311 313 … … 343 345 344 346 if myid == 0: 345 control_data = run_simulation(parallel=False, test_points = test_points, verbose = verbose)347 control_data, success = run_simulation(parallel=False, test_points = test_points, verbose = verbose) 346 348 347 349 for proc in range(1,numprocs): … … 352 354 353 355 pypar.barrier() 354 run_simulation(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose) 355 356 356 _, success = run_simulation(parallel=True, control_data = control_data, test_points = test_points, verbose = verbose) 357 358 359 #assert(success) 360 all_success = True 361 if myid == 0: 362 all_success = success 363 for i in range(1,numprocs): 364 all_success = all_success and pypar.receive(i) 365 else: 366 pypar.send(success, 0) 367 368 if myid == 0: 369 for i in range(1,numprocs): 370 pypar.send(all_success,i) 371 else: 372 all_success= pypar.receive(0) 373 374 print 'myid ',myid, 'all_success ',all_success 375 376 357 377 finalize() 358 359 378 379 import sys 380 if all_success: 381 sys.exit(0) 382 else: 383 sys.exit(1) 384 385 386 -
trunk/anuga_core/examples/runup.py
r8728 r9707 39 39 Bd = anuga.Dirichlet_boundary([-0.2,0.,0.]) # Constant boundary values 40 40 Bw = anuga.Time_boundary(domain=domain, # Time dependent boundary 41 f =lambda t: [(0.1*sin(t*2*pi)-0.3)*exp(-t), 0.0, 0.0])41 function=lambda t: [(0.1*sin(t*2*pi)-0.3)*exp(-t), 0.0, 0.0]) 42 42 43 43 # Associate boundary tags with boundary objects -
trunk/anuga_core/tools/install_packages.sh
r9701 r9707 93 93 git clone https://github.com/daleroberts/pypar; 94 94 pushd pypar; 95 python setup.py install; 95 python setup.py build; 96 sudo python setup.py install; 96 97 popd; 97 98 fi
Note: See TracChangeset
for help on using the changeset viewer.