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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.