Comments (2)
some diff
diff --git a/anuga/parallel/distribute_mesh.py b/anuga/parallel/distribute_mesh.py
index 88497575..29a5b1bb 100644
--- a/anuga/parallel/distribute_mesh.py
+++ b/anuga/parallel/distribute_mesh.py
@@ -122,7 +122,9 @@ def reorder_new(quantities, epart_order, proc_sum):
#path.append('..' + sep + 'pymetis')
try:
- from anuga.pymetis.metis_ext import partMeshNodal
+# from anuga.pymetis.metis_ext import partMeshNodal
+ import pymetis
+ from sets import Set
except ImportError:
print "***************************************************"
print " Metis is probably not compiled."
@@ -160,26 +162,34 @@ def pmesh_divide_metis_helper(domain, n_procs):
n_tri = len(domain.triangles)
if n_procs != 1: #Because metis chokes on it...
- n_vert = domain.get_number_of_nodes()
- t_list = domain.triangles.copy()
- t_list = num.reshape(t_list, (-1,))
-
- # The 1 here is for triangular mesh elements.
- # FIXME: Should update to Metis 5
- edgecut, epart, npart = partMeshNodal(n_tri, n_vert, t_list, 1, n_procs)
- # print edgecut
- # print npart
- #print epart
- del edgecut
- del npart
+ # n_vert = domain.get_number_of_nodes()
+ # t_list2 = domain.triangles.copy()
+ # t_list = num.reshape(t_list2, (-1,))
+
+ # build adjacency list
+ # neighbours uses negative integer-indices to denote boudary edges.
+ # pymetis totally cant handle that, so we have to delete these.
+ neigh = domain.neighbours.tolist()
+ for i in xrange(len(neigh)):
+ if neigh[i][2] < 0:
+ del neigh[i][2]
+ if neigh[i][1] < 0:
+ del neigh[i][1]
+ if neigh[i][0] < 0:
+ del neigh[i][0]
+
+ cutcount,partvert = pymetis.part_graph(n_procs,neigh)
+
+ #print "cutcount: ",cutcount
+ #print "partvert: ",len(partvert)
+ epart = partvert
# Sometimes (usu. on x86_64), partMeshNodal returns an array of zero
# dimensional arrays. Correct this.
+ # TODO: Not sure if this can still happen with metis 5
if type(epart[0]) == num.ndarray:
epart_new = num.zeros(len(epart), num.int)
epart_new[:] = epart[:][0]
-# for i in xrange(len(epart)):
-# epart_new[i] = epart[i][0]
epart = epart_new
del epart_new
so this seems to work for me. using latest pymetis from python2.7's pip. just builds adjacency lists from domain-data and feeds that to pymetis. did a few meshes and worked even with ~120mio triangles. whereas old pymetis would crumble somewhere between 50mio and 60mio. per-cpu-blobs look ok when visually checking.
from anuga_core.
See #153
from anuga_core.
Related Issues (20)
- anuga cannot generate .sww file HOT 2
- run the code on multi-node platform HOT 7
- How to run anuga's .py script in parallel under windows 10 HOT 1
- Input files with stl format
- About the floating and boundary HOT 1
- Is the code can be used for the simulation of the solute transportation and diffusion?
- How do I generate rectangular mesh for irregular boundaries? HOT 2
- Need help to compile Anuga code with Intel compiler and Python3.8 in parallel HOT 1
- Problem in running HOT 1
- Using SPACK for supporting wider architecture support HOT 1
- error: implicit declaration of function '__GKfree' is invalid in C99 HOT 3
- Installation issue: Anuga_parallel with Intel MPI HOT 6
- Error running Anuga_py3 branch on large number of nodes HOT 5
- Any plan for upgrading syntax for numpy w.r.t numpy version 20+ HOT 1
- AssertionError: assert current_volume >= 0.0 (SOLVED) HOT 1
- Looping hourly rainfall HOT 2
- Small triangles in mesh generated HOT 9
- how to set initial flow and rain in mesh HOT 1
- Which repo/branch is for current python3 development? HOT 1
- improvement in quad_tree.c in subroutine __point_on_line(...) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anuga_core.