2018-2-13-win10-安装Mpi
title | author | date | CreateTime | categories |
---|---|---|---|---|
win10 安装Mpi |
lindexi |
2018-2-13 17:23:3 +0800 |
2018-2-13 17:23:3 +0800 |
Win10 |
首先我们需要安装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
博客园博客只做备份,博客发布就不再更新,如果想看最新博客,请访问 https://blog.lindexi.com/
如图片看不见,请在浏览器开启不安全http内容兼容
本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。欢迎转载、使用、重新发布,但务必保留文章署名[林德熙](https://www.cnblogs.com/lindexi)(包含链接:https://www.cnblogs.com/lindexi ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请与我[联系](mailto:lindexi_gd@163.com)。