问题描述
因此配置 MPI 标志我意识到在 /usr/include
目录中有两个文件夹具有相同的文件.所以有两个相关的问题:
so configuring the MPI flags I have realized that in the /usr/include
directory there are two folders with the same files. So two related questions:
- 这对于 MPICH 安装是否正常?
- 它们之间有什么区别?
祝一切顺利,提前致谢
推荐答案
这取决于您的安装,但这是提供多个并行 MPI 安装的常用方法.
This can depend on your installation, but this is a common way for providing several parallel MPI installation.
我安装了 MPICH2 和 OpenMPI,/usr/include
中的这个文件夹:
I have both MPICH2 and OpenMPI installed, and this folders in /usr/include
:
lrwxrwxrwx 1 root root 21 Apr 1 17:03 mpi -> /etc/alternatives/mpi/
drwxr-xr-x 3 root root 4096 Apr 1 17:03 mpich/
lrwxrwxrwx 1 root root 22 Nov 30 01:21 openmpi -> ../lib/openmpi/include/
和mpi
文件夹是一个文件夹,应该作为#include
来使用alternatives
机制(我建议从this 和 这个,它可以在基于 Debian 的发行版以外的其他发行版上使用).
And mpi
folder is a folder which should be used as #include
to make use of alternatives
mechanism (I recommend starting from this and this, it's available on other than Debian based distros).
如果您运行 update-alternatives --config mpi
,您可以更改默认的 MPI 分发.
If you run update-alternatives --config mpi
you can change the default MPI distribution.
例子,/etc/alternatives/mpi
前后update-alternatives
:
# before, pointing to MPICH2
lrwxrwxrwx 1 root root 18 Apr 1 17:14 /etc/alternatives/mpi -> /usr/include/mpich/
# and after, pointing to OpenMPI
lrwxrwxrwx 1 root root 24 Apr 1 17:07 /etc/alternatives/mpi -> /usr/lib/openmpi/include/
总结:
- 使用
/usr/include/mpi/
使您的代码尽可能具有可移植性. - 使用
update-alternatives
更改所需的 MPI 发行版. - 这是一种
alternatives
机制,可提供多种软件版本(和发行版)的简便方法.
- Use
/usr/include/mpi/
to make your code as much portable as possible. - Use
update-alternatives
to change the desired MPI distro. - This is a mechanism of
alternatives
to provide easy way of multiple version (and distributions) of software.
这篇关于mpi 和 mpich2 文件夹之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!