Changeset 2850


Ignore:
Timestamp:
May 11, 2006, 4:10:50 PM (19 years ago)
Author:
jack
Message:

test_parallel_sw.py now correctly shows up the problem with losing stage
in the parallel shallow water model.

Location:
inundation/parallel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/parallel/pmesh_divide.py

    r2769 r2850  
    2020from math import floor
    2121
    22 from Numeric import zeros, Float, Int, reshape, argsort
     22from Numeric import zeros, Float, Int, reshape, argsort, ArrayType
    2323
    2424
     
    116116   
    117117        # The 1 here is for triangular mesh elements.
    118        
    119118        edgecut, epart, npart = partMeshNodal(n_tri, n_vert, t_list, 1, n_procs)
    120119        # print edgecut
     
    123122        del edgecut
    124123        del npart
     124
     125        # Sometimes (usu. on x86_64), partMeshNodal returnes an array of zero
     126        # dimensional arrays. Correct this.
     127        if type(epart[0]) == ArrayType:
     128            epart_new = zeros(len(epart), Int)
     129            for i in range(len(epart)):
     130                epart_new[i] = epart[i][0]
     131            epart = epart_new
     132            del epart_new
    125133        # Assign triangles to processes, according to what metis told us.
    126134       
  • inundation/parallel/test_parallel_sw.py

    r2777 r2850  
    55# Tested with MPICH.
    66
    7 mesh_filename = "merimbula_10785.tsh"
     7#mesh_filename = "test-100.tsh"
     8mesh_filename= "merimbula_10785_1.tsh"
    89yieldstep = 1
    9 finaltime = 60
     10finaltime = 90
    1011quantity = 'stage'
    1112nprocs = 8
     
    5960       
    6061        domain_full.set_quantity('stage', Set_Stage(756000.0, 756500.0, 2.0))
     62        #domain_full.set_quantity('stage', Set_Stage(200.0,300.0,1.0))
    6163        domain_full.check_integrity()
    6264        domain_full.smooth = False
     
    179181    def testParallelSw(self):
    180182        print "Expect this test to fail if not run from the parallel directory."
    181         result = os.system("mpirun -np %d test_parallel_sw.py" % nprocs)
    182         assert result == 0
     183        result = os.system("mpirun -np %d python test_parallel_sw.py" % nprocs)
     184        assert_(result == 0)
    183185
    184186# Because we are doing assertions outside of the TestCase class
     
    186188def assert_(condition, msg="Assertion Failed"):
    187189    if condition == False:
     190        pypar.finalize()
    188191        raise AssertionError, msg
    189192
Note: See TracChangeset for help on using the changeset viewer.