论文要用到MPI做并行算法,设置VS花了不少的功夫,现在分享一下小办法
一下为MPI 中Readme之中的方法
THE INSTALLER:
You must install MPICH2 on all machines that you want to run MPI programs on. Run the installer on each machine individually.
The installer creates the following mpich2 directory structure on your machine:
mpich2/bin
mpich2/include
mpich2/lib
The include and lib directories contain the libraries needed to compile MPI programs. The mpich2 dlls are copied to the Windows/system32 directory. The bin directory contains smpd.exe which is the MPICH2 process manager used to launch MPI programs. mpiexec.exe, also found in the bin directory, is used to start MPICH2 jobs.
以下为我用VS设置的方法
1.
http://www.mcs.anl.gov/research/projects/mpich2/从中下载 winIA32 Binary 那一个
2.
安装MPI
3.
#include"mpi.h"
4. 项目->属性->c/c++->常规->附加包含目录 设置mpi/include所在的目录
例如F:/mpi/include
5.项目->属性->链接器->常规->附加库目录 设置mpi/lib所在的目录
例如F:/mpi/lib
6.项目->属性->链接器->输入->附加依赖项 设置为 mpi.lib
7.后面就剩下编译了,本人用vs2008暂时还没遇到什么问题