Metis从安装到使用全教程(Linux)

Metis的安装

首先需要从Karypis Lab 的网页上进行下载开源版压缩包,地址在下面附上
http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
页面中的Download进行下载,目前笔者用的是metis 5.1.0的版本。

下载到本地后解压等操作本文不再叙述。

基本环境配置

在编译和安装METIS 5.0时要做好以下几个基本操作:

  1. 你需要一个支持C99标准的C编译器 .Gcc也可以.
  2. 你需要安装GNU make 以及 Cmake 2.8(http://www.cmake.org/
  3. include/metis.h 中修改以下代码,做到与自己计算机位数匹配(32bit or 64 bit).
//if your system is 64 bit. 
#define IDXTYPEWIDTH 64 
 
//if your system is 32 bit
#define IDXTYPEWIDTH 32 

编译以及安装

  1. 在metis的顶层文件夹下执行
make config
  1. 在metis的顶层文件夹下执行
make
  1. 执行完上述步骤后,build文件夹中会出现Linux-x86_64文件夹,进去可以看到build后的结果,接下来需要进行安装METIS.
make install

若上述操作报错,原因是否为**Error at include/cmake_install.cmake:36(file): file INSTALL cannot copy file**. 若是则需要修改make install的地址。
由于默认的安装前缀为 /usr/loacl. 所以我们需要根据自己METIS 的文件地址进行修改。

make config prefix=~/myroot/
//my root为你的metis顶层文件夹的地址

到此位置METIS的 编译 以及 安装 全部结束。

使用METIS中programs

在METIS中有许多可以执行的程序,比如gpmetis,mpmetis以及m2gmetis.

gpmetis是将一张graph切分成指定的块数.
mpmetis是将一张mesh切分成指定的块数.
m2gmetis是将mesh转换为可以兼容METIS的graph

下面我以gpmeis为例演示一下如何使用这些程序.
具体的使用说明可以参考manual pdf
下载地址:http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/manual.pdf

gpmetis [options] graphfile nparts
//options 为许多具体参数,可以参见上述pdf
//graphfile 为graph的文件
//nparts 为想要分成几部分

在这里插入图片描述
上图为一个简单的实例,左边为无向无权图,右边

  • 13
    点赞
  • 32
    收藏
    觉得还不错? 一键收藏
  • 18
    评论
metis-5.1.0安装包和manual手册 2 What is new in version 5.0 4 2.1 Changes in the command-line programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.1 Migration issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2 Changes in the API routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.2.1 Migration issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 Overview of METIS 6 3.1 Partitioning a graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2 Alternate partitioning objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.3 Support for multi-phase and multi-physics computations . . . . . . . . . . . . . . . . . . . . . . . . 8 3.4 Partitioning a mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.5 Partitioning for heterogeneous parallel computing architectures . . . . . . . . . . . . . . . . . . . . . 8 3.6 Computing a fill-reducing ordering of a sparse matrix . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.7 Converting a mesh into a graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4 METIS’ stand-alone programs 9 4.1 Input file formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.1.1 Graph file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 4.1.2 Mesh file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.1.3 Target partition weights file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 4.2 Output file formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 4.2.1 Partition file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
评论 18
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值