mesh-partition v3.2.3

Mercurial revision 5786:5c8b45563631 | 2026-08-04


Description

mesh-partition is a tool that uses the METIS 4.0 program to partition a mesh. It is designed to work with METIS 4.0, so compatibility errors may occur with newer versions of METIS.


Usage

mesh-partition [OPTIONS] -m input

Options

Option

Description

-h, --help

Display this help message and exit.

-m <file>

Required. Input mesh file or element list.

--metis-path <path>

Path to the METIS programs directory. Default: /home/softs/metis-4.0/.

--metis5

Use this flag if you have installed METIS 5.x instead of METIS 4.x.

-p <number>

Number of desired partitions. Default: 4.


Deprecated Options

Warning: These options are no longer supported and may be removed in future versions.

Option

Description

-o <file>

Output file (deprecated).

-z <zone>

Pre-set zone to limit the working area (deprecated).


Examples

Basic Usage

Partition a mesh file into 4 parts using the default METIS 4.0 path:

mesh-partition -m input_mesh.nc

Custom METIS Path

Specify a custom path for METIS programs:

mesh-partition --metis-path /custom/path/to/metis/ -m input_mesh.nc

Partition into 8 Parts

Partition the mesh into 8 parts:

mesh-partition -m input_mesh.nc -p 8

Using METIS 5.x

Use METIS 5.x instead of METIS 4.0:

mesh-partition --metis5 -m input_mesh.nc

Custom METIS Path with METIS 5.x

Combine a custom METIS path with METIS 5.x:

mesh-partition --metis-path /custom/path/to/metis5/ --metis5 -m input_mesh.nc -p 6

Environment Variables

mesh-partition relies on the METIS library. Ensure that:

  • The METIS programs (partnmesh for METIS 4.x or mpmetis for METIS 5.x) are accessible via the specified --metis-path.

  • The environment is configured to run METIS executables (e.g., PATH includes the METIS directory if not using --metis-path).


Notes

  1. Compatibility:

  • This tool is tested with METIS 4.0. Using METIS 5.x requires the --metis5 flag.

  • If you encounter errors, verify that the METIS version matches the flag used (--metis5 for 5.x, no flag for 4.0).

  1. Input File:

  • The input mesh file (-m) must be in a supported format (e.g., NetCDF or element list).

  • If the file cannot be read, the tool will exit with an error.

  1. Output:

  • The partitioned mesh is saved as mesh.metis.epart.<n>, where <n> is the number of partitions.

  • The tool also generates intermediate files like mesh.metis for METIS processing.

  1. Performance:

  • Partitioning large meshes may require significant memory and CPU resources.

  • Adjust -p based on the size of your mesh and available computational resources.


See Also