本机
ssh-keygen -t rsa
– cd ~/ssh
– cp -p id_rsa.pub authorized_keys2
– chmod go-rwx authorized_keys2
– ssh-agent $SHELL; ssh-add
ssh-copy-id -i id_rsa.pub uwhpsc@166.111.138.172

http://unixlab.sfsu.edu/~whsu/EXCL/656proj/tutorial

open-mpi没有p4pg

		Getting ready for Project 5 --- MPI tutorial
-------------------------------------------- For Project 5, you will be writing a simple parallel
program to run on a network of workstations in Science 252.
This handout contains preliminary information for you to get
setup and run some examples. SETTING UP THE MACHINES MPI stands for Message Passing Interface. It is becoming
the standard for parallel programming. You will be running programs
using the MPI library on a network of workstations in Sci 252. The network of PCs in Sci 252 can boot either Windows NT
or Sun Solaris. You must make sure that the machines you intend
to work on are running Solaris. The MPI installation comes with
a "tstmachines" script that should test if machines are available;
unfortunately we have not been able to get this to work. If you
can successfully "finger" a PC in Sci 252, it should be running
Solaris and available to you for running MPI programs. The server
for the network, sci-252pc20, always runs Solaris. If you are in the lab and need to reboot an NT station
to run Solaris, go to the initial NT window and click on "Shutdown".
Make sure the option "Shutdown and restart" is selected, and
allow the machine to proceed. When you come to a screen for
selecting NT and Solaris, pick Solaris (of course). Everything
else should be default; when in doubt just hit ENTER. For initial development, I suggest using a small number
of machines (like 2 or 3). Get that to work, then move to a
larger group. If you wrote clean code, there shouldn't be major
problems. The common mpi commands are in /usr/local/mpi/bin. You
should add this to your path. SETTING UP SSH (SECURE SHELL) When you log on for the first time, you will need to
setup ssh. (Setting it up on one of the clients will get you setup
on all of them.) Follow this procedure: prompt> /usr/local/bin/ssh-keygen
prompt> cp ~/.ssh/identity.pub ~/.ssh/authorized_keys
prompt> chmod 600 ~/.ssh/authorized_keys
prompt> chmod 700 ~/.ssh
prompt> chmod 644 ~/.ssh/identity.pub prompt> /usr/local/bin/ssh-agent $SHELL
prompt> /usr/local/bin/ssh-add When you run ssh-keygen, you will be prompted for a
passphrase. This is like a password; it's case-sensitive and
can include white spaces. Think of a phrase you can remember easily,
and DO *NOT* SAVE IT IN A FILE!!!! When you run ssh-add, you will be prompted for your passphrase. You have to type all 7 lines the first time you log in. After
that, every time you log in, you only have to type the last two
lines to setup ssh and run MPI programs. RUNNING SOME EXAMPLE PROGRAMS Once you're set up, copy the example programs cpi.c and
sr.c from my directory ~hsu/mpi_ex on sci-252pc20 (or any of
the other machines in Sci 252). sr.c only involves two processors. Processor 0 sends a
message to processor 1. Processor 1 waits for this message, and
sends a message back to processor 0. Processor 0 measures the
roundtrip time for a message, for 20 send-receive pairs. cpi.c is a somewhat cleaner version of the pi computation
program that you saw in the book chapter copies you received in
class. Processor 0 reads the value of n from the user, and broadcasts
it to all processors. Each processor does its computations, all
partial results are accumulated using MPI_Reduce(), and processor 0
prints the result and the execution time. The times reported (using MPI_Wtime() calls) is in
1000s of seconds (when the display says 0.1, it means 100
seconds). To compile an MPI program (for example, cpi.c), type mpicc cpi.c -o cpi To run an MPI program, log onto sci-252pc14, and type mpirun -p4pg pf4 cpi (pf4 is a file that specifies how processes are assigned to
hosts. More on that later.) You'll get output similar to this (don't worry about the stty
error messages for now): stty: : No such device or address
stty: : No such device or address
stty: : No such device or address
Process 0 on sci-252pc14.sci252_cs.sfsu
Process 1 on sci-252pc20.sci252_cs.sfsu
Process 2 on sci-252pc6.sci252_cs.sfsu
Process 3 on sci-252pc7.sci252_cs.sfsu
Enter the number of intervals: (0 quits) 10000 [user entered 10000]
pi is approximately 3.1415926544231239, Error is 0.0000000008333307
wall clock time = 0.000000
Enter the number of intervals: (0 quits) 40000 [user entered 40000]
pi is approximately 3.1415926536418795, Error is 0.0000000000520863
wall clock time = 0.000002
Enter the number of intervals: (0 quits) 0 [user entered 0]
P4 procgroup file is pf4.
prompt> Your output may also be scrambled a little bit, since you have
several processes printing to the same screen, and order was not
enforced. As we mentioned earlier pf4 gives mpirun directions on how
to assign processes to processors. The pf4 included in your examples
looks like this: sci-252pc14 0 /Users/hsu/mpi_ex/cpi
sci-252pc20 1 /Users/hsu/mpi_ex/cpi
sci-252pc6 1 /Users/hsu/mpi_ex/cpi
sci-252pc7 1 /Users/hsu/mpi_ex/cpi Each line is a triplet: [hostname] [#processes] [program name].
The first line indicates that the job was started on pc14; notice that
the number of processes specified for the host that started the job
is always 0. The next three lines indicate that one process is to be
started on pc20, pc6 and pc7. They will run the program
/Users/hsu/mpi_ex/cpi. You can also put multiple processes on the same host. For
example, to put two processes on pc6 and start it from pc6, you would
make a file: sci-252pc6 0 /Users/hsu/mpi_ex/cpi
sci-252pc7 1 /Users/hsu/mpi_ex/cpi

使用ssh免密码登录其他机器的更多相关文章

  1. ssh免密码登录机器(使用公钥和秘钥进行加密来实现)

    ssh 无密码登录要使用公钥与私钥.linux下可以用用ssh-keygen生成公钥/私钥对,下面我以CentOS为例. 登录的原理: 有机器A(192.168.1.155),B(192.168.1. ...

  2. 集群中配置多台机器之间 SSH 免密码登录

    集群中配置多台机器之间 SSH 免密码登录 问题描述 由于现在项目大多数由传统的单台机器部署,慢慢转变成多机器的集群化部署. 但是,这就涉及到机器间的 SSH 免密码互通问题. 当集群机器比较多的时候 ...

  3. 如何配置ssh免密码登录

    [TOC] 如果你在管理一堆unix机器,每次登录都要输入密码是挺烦的事情,一方面为了安全我们一般不会将所有机器的密码都设置成一样,另一方面就算一样每次都输入一遍也很麻烦. 这种情况下我们一般是用ss ...

  4. ssh免密码登录记录

    做mha.hadoop安装过程中都要用ssh免密码登陆,查过一些资料,踩过很多坑,下面用简单记录一下 首先要安装ssh linux : centOS 6.5 yum -y install *ssh* ...

  5. Linux下SSH免密码登录

    转自:http://haitao.iteye.com/blog/1744272 ssh配置 主机A:10.0.5.199 主机B:10.0.5.198 需要配置主机A无密码登录主机A,主机B 先确保所 ...

  6. [Hadoop] - SSH免密码登录

    在安装hadoop之前需要进行ssh免密码登录,ssh 无密码登录要使用公钥与私钥.linux下可以用用ssh-keygen生成公钥/私钥对,下面我以Redhat为例. 我这里只采用一台机器A(10. ...

  7. 配置ssh免密码登录——集群学习日记

    度过了难熬的考试月时期之后,最近和小伙伴一起参加的的比赛进入了紧张的准备时期.在进行工作的时候,发现有很多基础的知识点,自己不是很清楚以及了解,所以在想,要不就边学习的时候边写下学习日记,以供自己后来 ...

  8. 多台CentOS服务器下实现SSH免密码登录

    ROOT用户下实现SSH免密码登录 第一步:进入目录/root/.ssh $ cd  /root/.ssh/ 执行以下命令,会在当前目录下生成公钥(id_rsa.pub)/私钥(id_rsa)对 第二 ...

  9. Centos 解决SSH 免密码登录 以及Crontab制作定时SSH自动登录和关闭的脚本

    一.SSH免密码登录 假设要登录的机器为192.168.1.100,当前登录的机器为192.168.1.101. 首先在101的机器上生成密钥(如果已经生成可以跳过): $ ssh-keygen -t ...

随机推荐

  1. [C++] socket - 3 [线程简单例子 代码]

    #include<windows.h> #include<stdio.h> DWORD WINAPI myfun1(LPVOID lpParameter);//声明线程函数 D ...

  2. 不要过早退出循环 while(1){no break}

    我们在尝试新的事物的时候,总是会遇到各种各样的困难,不同的人会在碰壁不同的次数之后退出.用程序员喜欢的话来说就是,我们都在for循环,区别在于你是什么情况下break的.有的人退出阈值高,这是能坚持的 ...

  3. paip.php 与js 的相似性以及为什么它们这么烂还很流行。。

    paip.php 与js 的相似性以及为什么它们这么烂还很流行.. php与js异常的流行,web 90%都被他们统治了.发现了他们有意思的一些共性.. 结构一番总结,得出了它们共有的特点.特性: = ...

  4. fir.im Weekly - 工欲善其事,必先利其器

    这周为大家搜罗了一些优秀的 GitHub 资源.APP开发工具.产品UI设计资源等等,同时也有一些程序员个人成长的Tips,"软硬件兼备"也许事半功倍不只是梦! Open-Sour ...

  5. iOS开发-迭代器模式

    迭代器模式(Iterator),提供一种方法顺序访问一个聚合对象中的各种元素,而又不暴露该对象的内部表示.开发过程中,我们可能需要针对不同的需求,可能需要以不同的方式来遍历整个整合对象,但是我们不希望 ...

  6. iOS开发--JSON

    1.什么是JSON? JSON(JavaScript Object Notation)在网络传输中几乎无处不在,JSON是一种轻量级的数据交换格式,是基于JavaScript(Standard ECM ...

  7. iOS开发---集成百度地图

    由于iOS MapKit框架很多情况并不能满足我们的需求,我们可以选择集成百度地图,那该如何操作呢? 申请Key 登录百度API管理中心申请Key http://lbsyun.baidu.com/ap ...

  8. JS变量的作用域

    深入理解JavaScript变量的作用域   1.JavaScript的作用域链 2.函数体内部,局部变量的优先级比同名的全局变量高. 3.JavaScript没有块级作用域. 4.函数中声明的变量在 ...

  9. eclipse、myeclipse,svn插件subclipse 忘记密码的解决方法(win7、win8、xp)

    如果是Windows7.Windows8系统只要删除当前用户目录下的AppData\Roaming\Subversion\auth\svn.simple 比如我的用户名taoweiji,就删除C:\U ...

  10. 如何在IIS7下配置ASP+ACCESS环境

    如何在IIS7下配置ASP+ACCESS环境 | 浏览:901 | 更新:2013-01-16 17:46 1 2 3 4 5 6 7 分步阅读 默认装完IIS7之后,使用ASP程序会发现提示数据库连 ...