- Timestamp:
- Aug 28, 2009, 6:19:35 PM (15 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga_parallel/test_distribute_domain.py
r7448 r7449 16 16 import pypar 17 17 18 #from Numeric import allclose, array, zeros, Float, take, nonzero19 20 18 import numpy as num 21 19 22 from anuga.pmesh.mesh_interface import create_mesh_from_regions 23 24 from anuga.interface import rectangular_cross 25 from anuga.abstract_2d_finite_volumes.pmesh2domain import pmesh_to_domain_instance 20 21 26 22 27 23 from anuga.utilities.numerical_tools import ensure_numeric … … 35 31 from anuga.interface import Transmissive_boundary 36 32 37 38 from anuga_parallel.parallel_api import distribute, myid, numprocs 33 from anuga.interface import rectangular_cross 34 from anuga.interface import create_domain_from_file 35 36 37 from anuga_parallel.interface import distribute, myid, numprocs 39 38 40 39 … … 71 70 72 71 73 domain = pmesh_to_domain_instance(mesh_filename, Domain)72 domain = create_domain_from_file(mesh_filename) 74 73 domain.set_quantity('stage', Set_Stage(756000.0, 756500.0, 2.0)) 75 74 … … 80 79 if parallel: 81 80 if myid == 0: print 'DISTRIBUTING PARALLEL DOMAIN' 82 domain = distribute(domain , verbose=False)81 domain = distribute(domain) 83 82 84 83 #------------------------------------------------------------------------------ … … 126 125 l2norm[2] = pow(l2norm[2], 2) 127 126 if myid == 0: 128 domain.write_time()127 #domain.write_time() 129 128 130 129 #print edges[:,1] … … 151 150 pypar.send(linfnorm, 0) 152 151 else: 153 domain.write_time()152 #domain.write_time() 154 153 l1list.append(l1norm) 155 154 l2list.append(l2norm) … … 159 158 return (l1list, l2list, linflist) 160 159 161 # Test an 8-way run of the shallow water equations160 # Test an nprocs-way run of the shallow water equations 162 161 # against the sequential code. 163 162 164 class Test_ Parallel_Sw(unittest.TestCase):165 def test ParallelSw(self):163 class Test_distribute_domain(unittest.TestCase): 164 def test_distribute_domain(self): 166 165 print "Expect this test to fail if not run from the parallel directory." 167 result = os.system("mpirun -np %d python test_ parallel_sw.py" % nprocs)166 result = os.system("mpirun -np %d python test_distribute_domain.py" % nprocs) 168 167 assert_(result == 0) 169 168 … … 178 177 if numprocs == 1: 179 178 runner = unittest.TextTestRunner() 180 suite = unittest.makeSuite(Test_ Parallel_Sw, 'test')179 suite = unittest.makeSuite(Test_distribute_domain, 'test') 181 180 runner.run(suite) 182 181 else:
Note: See TracChangeset
for help on using the changeset viewer.