# 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 ```bash mesh-partition [OPTIONS] -m input ``` --- ## Options | Option | Description | | --------------------- | ------------------------------------------------------------------------ | | `-h`, `--help` | Display this help message and exit. | | `-m ` | **Required.** Input mesh file or element list. | | `--metis-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 of desired partitions. Default: `4`. | --- ## Deprecated Options > **Warning:** These options are **no longer supported** and may be removed in future versions. | Option | Description | | ----------- | ---------------------------------------------------- | | `-o ` | Output file (deprecated). | | `-z ` | 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: ```bash mesh-partition -m input_mesh.nc ``` ### **Custom METIS Path** Specify a custom path for METIS programs: ```bash mesh-partition --metis-path /custom/path/to/metis/ -m input_mesh.nc ``` ### **Partition into 8 Parts** Partition the mesh into 8 parts: ```bash mesh-partition -m input_mesh.nc -p 8 ``` ### **Using METIS 5.x** Use METIS 5.x instead of METIS 4.0: ```bash mesh-partition --metis5 -m input_mesh.nc ``` ### **Custom METIS Path with METIS 5.x** Combine a custom METIS path with METIS 5.x: ```bash 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). 2. **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. 3. **Output**: - The partitioned mesh is saved as `mesh.metis.epart.`, where `` is the number of partitions. - The tool also generates intermediate files like `mesh.metis` for METIS processing. 4. **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 - [METIS Documentation](http://glaros.dtc.umn.edu/gkhome/metis/metis/overview) (for METIS 4.0 and 5.x) - [METIS 5.x Release Notes](http://glaros.dtc.umn.edu/gkhome/metis/metis/download) (for compatibility details)