Changeset 8856


Ignore:
Timestamp:
Apr 30, 2013, 8:42:00 PM (12 years ago)
Author:
steve
Message:

Got an error when distributing a small mesh over 17 processors

Location:
trunk/anuga_core/source/anuga_parallel
Files:
2 edited

Legend:

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

    r8605 r8856  
    132132    # Wrapper for old pmesh_divide_metis which does not return tri_index or r_tri_index
    133133    nodes, ttriangles, boundary, triangles_per_proc, quantities, tri_index, r_tri_index = pmesh_divide_metis_helper(domain, n_procs)
     134
     135    print triangles_per_proc
     136    assert num.all(triangles_per_proc>0), 'Metis created a partition where one mesh has 0 triangles'
     137
    134138    return nodes, ttriangles, boundary, triangles_per_proc, quantities
    135139
    136140def pmesh_divide_metis_with_map(domain, n_procs):
     141
    137142    return pmesh_divide_metis_helper(domain, n_procs)
    138143
     
    208213
    209214        triangles_per_proc = num.bincount(epart)
     215
     216        msg = """Metis created a partition where at least one submesh has no triangles.
     217        Try using a smaller number of mpi processors"""
     218        assert num.all(triangles_per_proc>0), msg
     219
    210220        proc_sum = num.zeros(n_procs+1,num.int)
    211221        proc_sum[1:] = num.cumsum(triangles_per_proc)
     
    400410
    401411
     412    print triangles_per_proc
     413   
    402414    nodes = mesh.nodes
    403415    triangles = mesh.triangles
     
    450462
    451463        ids = num.unique(subtriangles.flat)
     464
     465           
    452466        lnodes = nodes[ids]
    453 #        print nodes.shape
    454 #        print ids.shape
    455 #        print lnodes.shape
     467#       print nodes.shape
     468#       print ids.shape
     469#       print lnodes.shape
    456470        x = num.concatenate((num.reshape(ids, (-1,1)),lnodes ), 1)
    457 #        print x
    458 #        print y
     471#       print x
     472#       print y
    459473        node_list.append(x)
     474
     475           
    460476        # Move to the next processor
    461477
  • trunk/anuga_core/source/anuga_parallel/run_parallel_sw_merimbula.py

    r8855 r8856  
    4646#mesh_filename = "merimbula_17156.tsh"   ; x0 = 756000.0 ; x1 = 756500.0; yieldstep = 50; finaltime = 500
    4747#mesh_filename = "merimbula_43200_1.tsh"   ; x0 = 756000.0 ; x1 = 756500.0; yieldstep = 50; finaltime = 500
    48 #mesh_filename = "test-100.tsh" ; x0 = 200.0 ; x1 = 300.0; yieldstep = 1; finaltime = 50
     48mesh_filename = "test-100.tsh" ; x0 = 200.0 ; x1 = 300.0; yieldstep = 1; finaltime = 50
    4949#mesh_filename = "test-20.tsh" ; x0 = 250.0 ; x1 = 350.0; yieldstep = 1; finaltime = 50
    5050
     
    172172t0 = time.time()
    173173for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
    174     if myid == 0:
    175         domain.write_time()
     174    print 'P:'+ str(myid) + ' '+ domain.timestepping_statistics()
     175    #if myid == 0:
     176    #    domain.write_time()
    176177
    177178
Note: See TracChangeset for help on using the changeset viewer.