feelpp_mesh_partitioner(1)
2. SYNOPSIS
feelpp_mesh_partitioner --part num [num2…] --ifile file [--dim d] [--json file.json] [--shape s] [--order num] [--by-markers] [--by-markers-desc markers] [--ofile file] [--odir dir]
3. DESCRIPTION
feelpp_mesh_partitioner is a simple application which can generate a partitioned mesh and
save it in a Feel++ specific json+hdf5 file format.
The generated mesh can then be loaded very efficiently in parallel.
3.1. Options
feelpp_mesh_partitioner requires some options.
| Name | Description | Default value |
|---|---|---|
dim |
dimension of the mesh |
3 |
shape |
shape of the mesh elements |
Simplex |
order |
mesh geometric order |
1 |
by-markers |
partitioning on each marker |
|
by-markers-desc |
partitioning by specifying the markers |
|
part |
number of desired partitions |
|
ifile |
name or path to the mesh |
|
ofile |
output filename prefix (without extension) |
|
odir |
output directory |
|
json |
json file that describes the partitioning |
4. EXAMPLES
We are now using the feelpp/feelpp-toolboxes:latest docker images as described in book.feelpp.org/user-manual/#getting_started to demonstrate feelpp_mesh_partitioner usage.
We use the meshes in src/feelpp/data/gmsh/primitives in the docker image.
feelpp/feelpp-toolboxes:latestdocker run --rm -ti -v $HOME/feel:/feel feelpp/feelpp-toolboxes
4.1. Generating a single mesh partitioning
We generate a mesh partitioned on 4 cores with the following command
feelpp_mesh_partitioner --part 4 --ifile src/feelpp/data/gmsh/primitives/torus.geo --ofile torus
You should have in the current directory 4 files
ls torus*
torus.geo torus.h5 torus.json torus.msh
Now the file torus.json can be loaded in a Feel++ application distributed on 4 cores.
4.2. Generating multiple mesh partitioning
Often we are interested in a set of partitioned meshes in order to do a speed-up study.
feelpp_mesh_partitioner is the right tool for that. Let’s consider a set of partitions \(\mathcal{P}=\{2, 4, 8, 16, 32 \}\).
feelpp_mesh_partitioner --part 2 4 8 16 32 --ifile src/feelpp/data/gmsh/primitives/torus.geo --odir torus-mesh
You should have in the directory torus-mesh (thanks to the odir option) 5 partitioned meshes
ls torus*
torus_p16.h5 torus_p2.h5 torus_p32.h5 torus_p4.h5 torus_p8.h5
torus_p16.json torus_p2.json torus_p32.json torus_p4.json torus_p8.json
| The mesh filenames contain the partition information. |
If you want a different prefix than torus, like torus-coarse, you can use the --ifile torus-coarse option and you will have a set of files named torus-coarse_p*.* in the torus-mesh directory.
|
4.3. Generating a mesh partitioning by markers
1) partitioning of each marker present in the mesh :
feelpp_mesh_partitioner --ifile toto.geo --by-markers --part 4 8 15 --odir hola
2) partitioning of and partitioning of the union of marker1 :marker2 and marker3
feelpp_mesh_partitioner --ifile toto.geo --by-markers-desc marker1:marker2,marker3 --part 4 8 15 --odir hola
In option, the by-markers-desc keyword create an union of the markers and , keyword allow to split the partitioning regions.:
4.4. Aggregating elements of a mesh
For some numerical methods, it is necessary to aggregate elements that share faces marked with a specific marker. This is done to
-
avoid these faces are also interprocess faces
-
avoid having degrees of freedom split over different processes
To do so we use the --json option to specify the partitioning.
The following code will aggregate the elements of the spheres marked with CenterSphere, LeftSphere and RightSphere in the mesh on the same processor.
The aggregation is done by adding weights to the elements sharing the same face marked with the same marker which then force the graph partitioner to put them on the same processor.
{
"partitioner":
{
"aggregates":
{
"spheres":{
"type": "faces",
"markers": ["CenterSphere","LeftSphere","RightSphere"]
}
}
}
}
5. SEE ALSO
Feel++ Book: book.feelpp.org