Skip to content

Commit 41e25a4

Browse files
authored
Enable Parmetis parallel partitioning for large meshes
For larger meshes, this adds a parallel partitioning for reduced memory footprint and faster partitioning. It includes - added ParMetisKWay partitioning with a ParMetisKWay config option - updated documentation - removal of many unnecessary return codes and integration with new error handler The serial MetisKWay option is retained as the default since it is more efficient for smaller meshes and node counts. To test the new option, the input config must be manually modified to use the ParMetisKWay method in the Decomp config. As noted in the updated documentation, ParMetis gives a somewhat different decomposition than the serial algorithm (and the offline gpmetis tool which matches the serial version).
2 parents 2e01743 + 7df8d30 commit 41e25a4

File tree

5 files changed

+554
-279
lines changed

5 files changed

+554
-279
lines changed

components/omega/doc/devGuide/Decomp.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ In order to run across nodes in a parallel computer, Omega subdivides the
66
horizontal domain into subdomains that are distributed across the machine
77
and communicate using message passing via the Message Passing Interface (MPI).
88
To decompose the domain, we utilize the
9-
[METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/overview) library.
10-
An Omega mesh is fully described by the
9+
[METIS/ParMETIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/overview)
10+
libraries. An Omega mesh is fully described by the
1111
[MPAS Mesh Specification](https://mpas-dev.github.io/files/documents/MPAS-MeshSpec.pdf)
1212
which we will reproduce here eventually. The Decomp class decomposes
1313
the domain based on the index space and number of MPI tasks (currently
@@ -21,11 +21,14 @@ with the call:
2121
```
2222
This must be called very early in the init process, just after initializing
2323
the MachEnv, Config and IO. Mesh information is first read using parallel
24-
IO into an equally-spaced linear decomposition, then partitioned by METIS
25-
into a more optimal decomposition. The parallel METIS implementation
26-
(ParMETIS) will eventually be used to reduce the memory footprint for
27-
high-resolution configurations, but currently we use the serial METIS library
28-
for the partitioning.
24+
IO into an equally-spaced linear decomposition, then partitioned by METIS or
25+
ParMETIS into a more optimal decomposition. The parallel ParMETIS
26+
implementation should be used to reduce the memory footprint for
27+
high-resolution configurations. Although the algorithmic method is similar,
28+
ParMETIS leads to a somewhat different partitioning than the serial METIS
29+
version. The serial version should give the same partition as the serial
30+
offline gpmetis tool used by MPAS when the same version of the METIS library
31+
is used.
2932

3033
METIS requires information about the connectivity in the mesh. In particular,
3134
it needs the total number of cells and edges in the mesh and the connectivity

components/omega/doc/userGuide/Decomp.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,30 @@ cells, edges and vertices so that a time step can largely be completed
1212
without the need to communicate.
1313

1414
The partitioning itself is performed using the
15-
[METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/overview) library that
16-
can partition unstructured domains in a way that also optimizes communication.
17-
More details on the mesh, connectivity and partitioning can be found in
18-
the [Developer's Guide](#omega-dev-decomp).
15+
[METIS/ParMETIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/overview)
16+
libraries that can partition unstructured domains in a way that also optimizes
17+
communication. More details on the mesh, connectivity and partitioning can be
18+
found in the [Developer's Guide](#omega-dev-decomp).
1919

20-
There are three parameters that are set by the user in the input configuration
20+
There are two parameters that are set by the user in the input configuration
2121
file. These are:
2222
```yaml
2323
Decomp:
2424
HaloWidth: 3
25-
MeshFileName: OmegaMesh.nc
2625
DecompMethod: MetisKWay
2726
```
28-
(until the config module is complete, these are currently hardwired to
29-
the defaults above). The HaloWidth is set to be able to compute all of the
30-
baroclinic terms in a timestep without communication and for higher-order
31-
tracer advection terms, this currently must be at least 3. The MeshFileName
32-
should include the complete path and filename to a standard Omega mesh file
33-
that contains at a minimum
27+
The HaloWidth is set to be able to compute all of the baroclinic terms in a
28+
timestep without communication and for higher-order tracer advection terms,
29+
this currently must be at least 3.
30+
31+
METIS and ParMETIS support a number of partitioning schemes, but the MetisKWay
32+
and its parallel equivalent ParMetisKWay are the only currently supported
33+
decomposition methods for Omega. The serial form (MetisKWay) is typically
34+
faster for small meshes and decompositions. The ParMetisKWay option is a
35+
parallel form that is faster and requires less memory than the serial option.
36+
Note that the two methods will not result in the same partition.
37+
38+
An input mesh file must be provided that contains at a minimum
3439
- the total number of cells, edges and vertices (NCells, NEdges, NVertices)
3540
- the mesh connectivity contained in the arrays CellsOnCell, EdgesOnCell
3641
VerticesOnCell, CellsOnEdge, EdgesOnEdge, CellsOnVertex, EdgesOnVertex.
@@ -40,12 +45,8 @@ The mesh information is read via parallel IO into an initial linear domain
4045
decomposition and then is partitioned by METIS and rearranged into the
4146
final METIS parallel decomposition.
4247
43-
METIS and ParMETIS support a number of partitioning schemes, but MetisKWay
44-
is currently the only supported decomposition method for Omega and is
45-
generally the better option.
46-
4748
Once the mesh is decomposed, all of the mesh index arrays are stored in
4849
a Decomp named Default which can be retrieved as described in the
4950
Developer guide. In the future, additional decompositions associated
50-
with processor subsets (as described in MachEnv) but this capability is
51-
not yet supported.
51+
with processor subsets (as described in MachEnv) should be possible, but
52+
this capability is not yet supported.

0 commit comments

Comments
 (0)