第一步 Ubuntu下安装SSH服务器和客户端
打开新立得,在全部里键入openssh,选择openssh-client和openssh-server标记安装应用,或者直接执行
$ sudo apt-get install openssh-client openssh-server第二步 安装MPICH
打开新立得,在全部里键入mpi,选择mpi-bin、mpi-doc、libmpich1.0-dev标记安装应用
$ sudo apt-get install mpi-bin mpi-doc libmpich1.0-dev第三步 测试安装
$ touch hello.c
键入以下内容到hello.c
1 #include <mpi.h>
2 #include <stdio.h>
3 int main(int argc, char *argv[])
4 {
5 int npes, myrank;
6 MPI_Init(&argc, &argv);
7 MPI_Comm_size(MPI_COMM_WORLD, &npes);
8 MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
9 printf("From process %d out of %d, Hello World!
", myrank, npes);
10 MPI_Finalize();
11 }
$ mpicc -o hello hello.c
$ mpirun -np 2 hello #应该会输出两次Hello,中间可能要求输入密码,如不想输入密码,看第四步第四步 取消SSH的密码步骤
$ ssh-keygen -t dsa #中间提示输入密码,直接回车,会在生成文件~/.ssh/id_dsa.pub
$ cat id_dsa.pub >> authorized_keys
$ mpirun -np 2 hello #应该没有密码输入提示了在Ubuntu上安装MS Office 2007Vista SP1可以与Linux共存相关资讯 ubuntu安装 MPICH
- Linux系统教程:如何通过代理服务 (03月17日)
- MacBook Air 安装 Ubuntu 双系统 (01/27/2015 16:21:32)
- Ubuntu 12.04中安装Qt SDK 1.2.1图 (11/24/2012 13:19:21)
| - Linux系统入门教程: 当使用代理服 (11/08/2015 09:04:46)
- Ubuntu安装到移动硬盘 & grub (02/05/2014 19:52:51)
- Linux CentOS下安装MPICH以及运行 (10/10/2012 09:26:19)
|
本文评论 查看全部评论 (0)