This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

MPI, Submesh, and partitioning

+1 vote

Dear all,

I am still working on a way to refine a mesh, but it's really not easy. I will bother you in the future :)

Anyway, I've read the topic SubMesh workaround for parallel computation, and since I still get errors on SubMesh with MPI, I was wondering if any progress have been made.

The question is now, as a workaround, how can I drive the mesh partitioning on each process? And how is partitioning made by default?

Reading and playing with meshes, I've concluded partitions are "load balanced", in the sense that, as far as I understand, the number of cells (vertices) is evenly distributed among processes.

I was wondering this: what if I have a local phenomena? For instance, in a cracked domain, I could say that cells near the crack tip should belong to one process. I am also thinking if this is also a good strategy, I don't really know, so any advice is hugely welcome!

Thanks & Cheers!

asked May 20, 2015 by senseiwa FEniCS User (2,620 points)

Regarding SubMesh in parallel, you can use cbcpost:

from cbcpost.utils import create_submesh
submesh = create_submesh(mesh, meshfunction, domain_id)

Regarding the mesh partitioning, I'll leave that for someone smarter than me :)

Thanks! The cbcpost is cool, but I have to stick with C++ :(

1 Answer

+2 votes
 
Best answer

You are right that the mesh is evenly partitioned, according to the number of cells.
However, if you refine, i.e.
mesh = refine(mesh, markers)
then it will be rebalanced, i.e. if there are more markers in one region they will be split up.

It is true that it is currently rather crude, and there are some changes in the development version which allow you to set weights on each cell.

answered May 22, 2015 by chris_richardson FEniCS Expert (31,740 points)
selected May 27, 2015 by senseiwa

This is awesome to know that load balancing is done automagically! Even if crude, is there something I can do to partition the mesh myself? I don't know, maybe something like setting cell colors or markers.

If that could be done, that would be great. Even if it would come at a cost, for instance taking a look at some code and writing my own function!

I'm open to everything, it's really interesting!

Thanks!

As I said, I think there is something in the development version, where you can set a weight per cell. It should be in the 1.6 release - although I'm not sure how accessible it is from python.

Oh well, I need C++ so Python is irrelevant to me (at this moment). No news on when it will hopefully be released, or for if any beta app would be available to testers?

You can browse the source code and download from bitbucket.org - 1.6 should be out in July

...