Fork me on GitHub

林德熙

If you have any language confusion,please talk to me lindexi_gd@163.com.

win10 安装Mpi

首先我们需要安装Bash

$ sudo apt-get install libcr-dev mpich2 mpich2-doc


写hello.c

# include <mpi.h>
# include <stdio.h>

int main (int argc, char* argv[])
{
  int rank, size;

  MPI_Init (&argc, &argv);      /* starts MPI */
  MPI_Comm_rank (MPI_COMM_WORLD, &rank);        /* get current process id */
  MPI_Comm_size (MPI_COMM_WORLD, &size);        /* get number of processes */
  printf( "Hello world from process %d of %d\n", rank, size );
  MPI_Finalize();
  return 0;
}

使用mpicc ,[[INVALID],INVALID] ORTE_ERROR_LOG: A system-required executable either could not be found or was not executable by this user in file ess_singleton_module.c at line 231

$ mpicc.mpich2 hello.c -o h

$ mpiexec.mpich -np <num> ./h

I use mpiexec.mpich run the code.mpicc.mpich2 hello.c -o h mpiexec.mpich -np <num> ./h

可以安装mpi,从http://download.csdn.net/detail/lindexi_gd/9714817 下载,使用

tar zvf  openmpi-1.6.5.tar.gz  
cd openmpi-1.6.5
./config
sudo make & make install

本文会经常更新,请到原文:/lindexi/post/win10-%E5%AE%89%E8%A3%85Mpi/,避免陈旧错误知识的误导,同时有更好的阅读体验。

知识共享许可协议
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。欢迎转载、使用、重新发布,但务必保留文章署名林德熙(包含链接:http://blog.csdn.net/lindexi_gd ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请与我联系