windows下用intel 编译器 构建mpi并行程序

windows下用intel 编译器 构建mpi并行程序

在使用软件的时候,最好首先去官网了解一下软件说明,比如intel parallel studio的说明,特别是release note,这样对于需要什么样的环境和安装要求就会比较清楚,而不用自己去尝试,也就不用浪费时间了。

目前intel的编译器整合成一个intel parallel studio,这套软件分不同的版本,其中cluster版本带有mpi库,而其它版本则不带,因此实现mpi并行程序编译有两种方式:

  1. 利用intel parallel studio的编译器+msmpi来构建mpi并行程序
  2. 直接安装cluster版本,它自带mpi库,由它来构建。但是cluster版本只支持64位系统。具体要求见版本说明。

还要注意,intel parallel studio 的安装除了系统要求可能还有软件要求,比如可能需要安装visual studio或者.net framework。同时如果要实现32位系统下的mpi并行,那么只能采用上面的第一种方式了。

对于第二种方法,这里做了一些测试环境是windows 7 x64,visual studio 2010,intel parallel studio 2015 cluster版。安装完成后操作步骤为:

  • step 1:在软件菜单中选择wmpiconfig,配置主机(host),并注册。
  • step 2:运行软件菜单中Intel 64 Build Environment得到一个命令行,在其中运行一下

    "C:\Program Files (x86)\Intel\Composer XE 2015\bin\ipsxe-comp-vars.bat" intel64 vs2010"

    注意后面该命令很重要,否则无法编译。

  • step 3:编译mpi程序并运行,命令为:

    对于c:

    mpiicc test.c
    mpiexec -n 3 test.exe
    

    对于c++:

    mpiicpc test.cpp
    mpiexec -n 3 test.exe
    

    对于fortran:

    mpif90 test.f90
    mpiexec -n 3 test.exe
    

ps:当然不使用msmpi,而使用老的win下的mpich2版本(比如:mpich2-1.4.1p1-win-ia32.msi,mpich2-1.4.1p1-win-x86-64.msi)也是可以构建mpi并行程序的。

猜你喜欢

转载自blog.csdn.net/xenonhu/article/details/78206755
今日推荐