MPICH ¦w¸Ë¡BRsh ¾÷¨î¤Î¨t²ÎÀô¹Ò³]©w
rsh ¾÷¨î³]©w
¨Ï¥ÎªÌ HOME ¥Ø¿ý¤U«Ø¥ß .rhosts ÀÉ¡A¨ä¤º¨C¤@¦æ¦³ host-name user-name ªº¹ïÀ³¡A¥Nªí±q¨º¤@¥x»·ºÝ¾÷¾¹ host-name ªº¨º¤@Ó¨Ï¥ÎªÌ user-name¡A¥i¥H¤£°Ý±K½Xª½±µ¶i¤J¥»¦aºÝ¨t²Î¡C ª`·N .rhosts ÀÉn chmod ¦¨ g-w ¡]¤]´N¬O»¡¡A¥u¦³¾Ö¦³ªÌ¥»¤H¤~¯à¦³¼g¤JªºÅv¡^¡A¦p¦¹ rsh ¤~·|¹B§@¡]³o¬O¦w¥þ¤Wªº³]p¡^¡C
·í .rhosts Àɮצs¦b©ó¬Y¥x¾÷¾¹ªº¨Ï¥ÎªÌ HOME ¥Ø¿ý¤U¡A¨Ã¥B¸ÓÀɮ׬O¦³®Äªº±¡ªp®É¡Aùر©Ò¦Cªº¨C¤@Ó¾÷¾¹ªº¨º¨Ç¨Ï¥ÎªÌ³£¥i¥H¤£¥Î±K½X¶i¤J³o¥x¾÷¾¹¡CÁ|¨Ò»¡©ú¡G¾÷¾¹ proton3 ªº¬YÓ¨Ï¥ÎªÌ u006 ¨ä®a¥Ø¿ý©³¤U¦³¤@Ó¦X®æªº .rhosts ÀÉ¡A¨ä¤º°O¸ü¦³¤@¦æ proton2 u007 «h¥Nªí¡A¦b proton2 ¤Wªº¨Ï¥ÎªÌ u007 ¥i¥H¤£¶·±K½X¥H u006 ªº¨¥÷¶i¤J proton3 ©Î»·ª½±µ¶] job
rsh ÁöµM¬O¹L¥h°t¦X mpich ³Ì±`¥Îªº¾÷¨î¡A¦ý¥¦¦bºô¸ô¦w¥þ©Ê¨ü«µøªº¤µ¤Ñ³Q»{¬°¬O¤£¦w¥þªº¡A«Ü¦h¨t²Î¬Æ¦Ü¤£´£¨Ñ rsh¡C²{¤µ¥D¬y«h¬O¨Ï¥Î¤U±¤¶²Ðªº ssh ¨Ó§@¬° mpich ·¾³q¤§ºÞ¹D¡C
ssh ªº§K±K½Xµn¤J¼Ò¦¡³]©w¡]¥H§ÚÌ VM ±Ð¾ÇÀô¹Òªº Fedora Core 5 ¬°¨Ò¡^
°ò¥»¨BÆJºKn (¥u¥Î©ó¤@¥x¡^¡G
¥ý½T»{¨t²Î¤¤¦³ ssh ªA°È¡A§Q¥Î ssh username@hostname ¡]»·ºÝ¡^©Î ssh localhost ¡]¥»¾÷¡^¸ÕµÛ¥Î ssh ¥H»Ýn±K½Xªº¤è¦¡µn¤J»·ºÝ©Î¥»¾÷¨t²Î¡C
¥´ cd ~/.ssh¡]ª`·N ssh «e±¦³¤@ÓÂI¡^¶i¤J¨Ï¥ÎªÌÓ¤HÁôÂêº ssh ³]©w¥Ø¿ý¡]¦b UNIX ¤U¤Z¬O¦WºÙ¥H¤@ÂI§@¬°¶}©lªºÀɮפΥؿý¡A³£·|ÁôÂáA¥u¥Î ls ¬Ý¤£¨£¡An¥Î ls -a ¤~¬Ý±o¨£¡^¡C
¥´ ssh-keygen ²£¥Í ssh ªºÆ_°Í¡]¦³¨Ç¨t²Îª©¥»¤£±µ¨ü¥u¥´ ssh-keygen «hn ssh-keygen -t rsa¡^¡A¥¦·|°Ýn¿é¤J passphrase¡Aµ¹¤£µ¹³£¥i¥H¡A¤§«á§A¦b¥Ø¿ý¤U¬Ý·|¨ì id_rsa ¤Î id_rsa.pub ¨âÓÀɮסC
§â id_rsa.pub «þ¨©¬°ÀɦW¥s§@ authorized_keys ªºÀɮסC
~/.ssh ©³¤Uªº id_rsa¡Bid_rsa.pub¡Bauthorized_keys µ¥ÀɮסA³£n chmod ¦¨¬°¸s²Õ (g) »P¨ä¥L (o) ¬Ò¤£¥iŪ»P¼g¡Cchmod g-w [filename] ¡B chmod g-r [filename] ¡A¤ñ¸û§Öªº¤èªk¬O chmod 500 [filename]¡C
²{¦b¥i¥H¸ÕµÛ¥H ssh username@hostname ¡]»·ºÝ¡^©Î ssh localhost ¡]¥»¾÷¡^¸ÕµÛ¥Î ssh ¥H¤£»Ýn±K½Xªº¤è¦¡µn¤J»·ºÝ©Î¥»¾÷¨t²Î¡A¦pªG¤£»Ýn±K½X¥i¥Hµn¤J¡A«hªí¥Ü³]©w¦¨¥\¡C
³]¸m¦h¥x ssh ¥i¶i¤J¤§§K±K½X¾÷¾¹²Õ
Æ[©À¬O¡A»·ºÝªº¨º¥x¾÷¾¹¤W¤§¨Ï¥ÎªÌªº .ssh ¤l¥Ø¿ý¤U¤§ authorized_keys Àɮפ§¤¤n¦³°O¸ü·Q§K±K½XªñºÝ¾÷¾¹¤§¤½Æ_°Í¡C¶i¤J¤§
«ö¤W±ªº¤èªk¡A¥ý¦bªñºÝ¾÷¾¹ªº¨Ï¥ÎªÌ¥Ø¿ý¤U²£¥Í .ssh ¤l¥Ø¿ý¥H¤Î¨ä¤U¬ÛÃöÀɮסC§â¨ä¤¤ id_rsa.pub ¶Ç°e¨ì»·ºÝ¡A¨Ã§Q¥Î cat id_rsa.pub >> authorized_keys¡]ª`·N¬O¨âÓ¤j©ó¸¹¡A¥Nªí°l¥[¡^¨Ó§â¨ä¤º®e¥[¤J¨ì»·ºÝ¾÷¾¹ªº authorized_keys Àɮפ¤¡C
´ú¸Õ±qªñºÝ¨ì»·ºÝ¥H ssh µn¤J¡A¬Ý¬O§_»Ýn±K½X¡C
°Ñ¦Ò¸ê®Æ
http://www.me.berkeley.edu/~kirpekar/sshMpich.htm
ssh °ò¥»¨Ï¥Î¤èªk http://140.126.107.250/peiyuli/unix/OpenSSH%E4%BC%BA%E6%9C%8D%E5%99%A8.htm
SSH ªº¤@¨Ç¦w¥þ¤p§Þ¥© http://www.study-area.org/tips/ssh_tips.htm
MPICH ¦w¸Ë
¤U¸ü®M¥ó¥]
©x¤èºô¯¸¡Ghttp://www-unix.mcs.anl.gov/mpi/
¤U¸ü³B¡Ghttp://www-unix.mcs.anl.gov/mpi/mpich1/download.html
FAQ¡Ghttp://www-unix.mcs.anl.gov/mpi/mpich1/docs/faq.htm
¤W±Â©xºô³sµ²¤£¦A¦s¦b¡A¥H¤U´£¨Ñºô¸ô¨ä¥L¯¸«O¦sªº®M¥ó¥]¤Î¤â¥U
¸Ñ¶}®M¥ó
tar -zxf mpich-1.2.7.tar.gz ©Î tar -zxf mpich.tar.gz
«h©Ò¦b¥Ø¿ý¤U·|·s¥Í¤@Ó¥s mpich-1.2.7 ©Î mpich ªº¤l¥Ø¿ý¡A³o¬O±N¨Ó mpich ®M¥óªº¥D¥Ø¿ý¡C
Àô¹Ò³]©w¨Ã²£¥Í Makefile
./configure ¡]§¹¥þ¦Û°Ê°»´ú¡^
./configure -fc=g77 -f90=gfortran ¡]«ü©w g77 ¬° Fortran77 »y¨¥¡Bgfortran ¬° Fortran90 »y¨¥¡A¤§«á·|°µ¥X mpif77 ¤Î mpif90 ¨âÓ script ¡^¡]¦b¸û·sª©ªº MPICH «h¬O«Øij§Ú̥Τ]¥i¤£«ü©wÀô¹ÒÅÜ¼Æ FC ¤Î F90 ªº¤è¦¡¡A¨Ò¦p¡An³] FC=g77¡A¦b bash ¤U¥Î export FC=g77¡A¦b csh ©Î tcsh ¤U¥Î setenv FC g77¡C¦P²zYn³] F90=gfortran ´N¬O¦A¤U«ü¥O¼W³]¤@«h¡C¡^
./configure -rsh=ssh ¡]«ü©w secure shell ¬° rsh ¾÷¨î©Ò¥Îªº shell¡A¤ñ rsh ¦³§ó°ªªº¦w¥þ©Ê¡^¡]¦b¸û·sª©ªº MPICH ¤]¥i¤£«ü©w¡A¦Ó±Ä¥Î³]©wÀô¹ÒÅÜ¼Æ RSHCOMMAND ¬° rsh ªº¤è¦¡¡A¹ê»Úªº°µªk¡A¦b bash ¤U¥Î export RSHCOMMAND=ssh¡A¦b csh ©Î tcsh ¤U¥Î setenv RSHCOMMAND ssh¡C ¡^
¥H¤W¤¶²Ðªº³]©w°Ñ¼Æ³£¥i¥H¦X¦b¤@°_¥Î¡A§ó¸Ô²Óªº¸ê®Æ½Ð¨£ mpich Á`¥Ø¿ý¤§ doc ©³¤Uªº¤å¥ó¡C
«Ø¥ß°Æµ{¦¡®w¤ÎÀô¹Ò
¥´ make ¡A¨Ãµ¥¤@¬q®É¶¡§â³\¦hÀÉ¥[¥H½sĶ¤ÎÁåµ²¦b¤@°_¦¨ library¡C ¦pªG¦¨¥\ªº¸Ü·|¨£¨ì§i¶D§AY¦³°ÝÃD¦pªG§@ bug report ªºµe±¡C
´ú¸Õ MPI Fortran script mpif77 ªº½sĶ¥H¤Î¶] fpi ¥¦æµ{¦¡
¶i¤J example/basic ¥Ø¿ý¡A¥´ make fpi ·|¥u½sĶ fpi.f ¦Ó°µ¥X fpi °õ¦æÀÉ¡C
¶]¤@Ó MPI ¦h CPU job ªº¤èªk¡A¬O¤U¹F
mpirun -np [³B²z¾¹Ó¼Æ] [¥i°õ¦æÀɦWºÙ]
¡A¨Ò¦p¥H 2 Ó CPU ¶] fpi Õ¹¦¡¡A«ü¥O¬O
mpirun -np 2 fpi
¡]¥»¾÷¡^
³]©w¦hÁû CPU ®É¥á job ªº¶¶§Ç
¦hÁû CPU ®É¥á job ªº¶¶§Ç¡A¦pªG¨Ï¥ÎªÌ¨S¦³¯S§O«ü©w¡A«h¬O¦b MPICH ¨t²Îªº machines.LINUX ÀÉ¡A¬O¦ì©ó MPICH ¥D¥Ø¿ý¤Uªº utils/machines ¤l¥Ø¿ý¡A ¥¦ªº®æ¦¡¦p¤U¡G
hostname1
hostname2
hostname3¦pªG¦³¨Ç¾÷¾¹¦³¨âÓ CPU ¦Ó§A§Æ±æÀu¥ý¥Î§¹¨º¨âÓ¦A¥á¨ì¤U¤@Ó¾÷¾¹¡A«h¥i¦b hostname «á±¥[«_¸¹¤Î³B²z¾¹¼Æ¥Ø¡A¦p¤U¡G
hostname:2
ª`·N³oùتº hostname ¥²¶·¬On¥H¦³¨t²Î¥´«ü¥O hostname «á©Ò§e²{¥Xªº¥¿¦¡¨t²Î¦WºÙ¡AY¬O¥Î§O¦W©Î¬Æ¦Ü IP ¦a§}¤£¤@©w·|³Q¥¿½T¿ë»{¡A¨ºÓ¾÷¾¹¦WºÙ´N·|³Q¸õ¹L¡C
¦b¦³¨ÇÔ·¦X©Î¬OÀô¹Ò¡A±Ä¥Î¨Ï¥ÎªÌ¦Û¤v©w¸qªº machine file ·|¤ñ¸û¤è«K¦Ó¦³¼u©Ê¡]¤×¨ä¬O·í MPICH Àô¹Ò¤£¬O§A¦Û¤v«Ø¸m¡A¦Ó§A¨S¦³Åv§ó§ï util/machines ¤UªºÀɮ׮ɡA«h¥i¦bµo°Ê job ªº¥Ø¿ý¤U³Æ§´¤@Ó»P«ez machines.LINUX ®æ¦¡¤@¼ËªºÀɮסAÀɦW¤£©ë¡]·íµMª½±µ¥s°µ machines.LINUX ¤]¥i¥H¡^¡A¨Ï¥Îªº¤èªk¡A¬O¦b mpirun ®É¦h¤U¤@Ó°Ñ¼Æ -machinefile filename ¡A¹³¬O
mpirun -np 4 -machinefile my_machine_file fpi
¡]·í§A¹Á¸Õ¤Wz«ü¥O®É¡A¦pªG mpirun ¨Ã¤£¦b¹w³]ªº¸ô®|ùئӧ䤣¨ì¡A´N½Ð§@§¹¾ãªº¬Û¹ï¸ô®|©Îµ´¹ï¸ô®|¡C¡^
·í¦h¥x¹q¸£¨Ã¤£¥H NFS ¦@¨ÉÀɮרt²Î®É
NFS (Network File System ºô¸ôÀɮרt²Î) ±`¥Î©ó´£¨Ñ¦h¥x¹q¸£Àô¹Ò¡A¨Ó³Ð³y¥X¤@ÓÅý¨C¥x³£¹q¸£³£¬Ý¨ì¤@¼Ò¤@¼Ëªº¤º®e¡AY¨Ï¥ÎªÌµn¤J©ó¨ä¤¤¬Y¤@¥x¦b¸ÓÀɮרt²Î¤¤¼g¤J©Îקï¤F¤@ÓÀɮסA«h±q¨ä¥Lªº¾÷¾¹¤]¦P¨B¬Ý¨ì³oÓ§ïÅÜ¡C
¦pªG§Aªº¦h¥x¹q¸£Àô¹Ò¡A¨S¦³¬[³]¤Î¨Ï¥Î NFS ªA°È¡A¥un±N¨CÓÓ§O¾÷¾¹¤W³£¦³°õ¦æÀÉ¡A¨Ã¥B°õ¦æÀÉ©Ò¦s©ñ¤§¦ì¸mªº¸ô®|³£¤@¼Ë¡A¤´µM¥i¥H¶i¦æ¦h¥x¹q¸£pºâ¡C
¬[³] NFS ¦øªA¾¹¡A°£¤F¦b¹Ï§Î¤Æµøµ¡¤¶±ªº³]©w¤u¨ã¥~¡A¤å¦r¼Ò¦¡ªº¾Þ§@¥i°Ñ¦Ò¡G
³¾ôªº Linux ¨p©Ðµæ¡G NFS ¦øªA¾¹
¬f«Côªº SuSE Linux¡G ¬[³] NFS ¤Î NIS Server
¦Ü©ón¨Ï¥Î NFS ¦øªA¾¹¤WªºÀɮרt²Î¡A«h¦bºÞ²zªÌÅv¤U¥´¡G
mount [¾÷¾¹ IP ¦a§}©Îºô°ì¦WºÙ]:/[Àɮרt²Î¦WºÙ] [±¾¸ü¾¹]
¦bµêÀÀ¾÷¾¹±Ð¾ÇÀô¹Òªº¯S®íª`·N¨Æ¶µ
n¯u¥¿ªº g77 ¡]¦Ó«D¥H gfortran «_¦WÃìµ²ªº¡^¤~¯à¶¶§Q½s¥X MPICH 1.2.6 ª© fortran n¥Îªº³¡¤À¡A³]©w gfortran ¬° fortran compiler ªº¸Ü·|¾ÉP¸Ó³¡¤À¤£¶i¦æ¡C
n¦bµêÀÀ¾÷¾¹©³¤U¦w¸Ë g77 ªº¤èªk¡A½Ð¨£§Ú¥t¦æ½s¼gªº VM_FC5_g77 ½u¤W¦w¸Ë»¡©ú¡C
¦h¥x¹q¸£¥¦æ¤À´²pºâªº¤@¨Çª`·N¨Æ¶µ
Y¬O¨Ï¥Î ssh §@³q°T¡A«hµo°Êªº¥D¾÷n§â iptable Ãö±¼¡A¤~¤£·|¦³¹³ rm_15725: p4_error: rm_start: net_conn_to_listener failed: ¤Î net_send: could not write to fd=4, errno = 32 ªº¿ù»~°T®§¡C
Ãö³¬ iptable¡]¨¾¤õÀð¡^ªº¤èªk¡] ¾A¥Î©ó RedHat / CentOS / Fedora ¡^¡G
/etc/init.d/iptables save
/etc/init.d/iptables stop¨ä¥L²Ó¸`½Ð¨£ http://www.cyberciti.biz/faq/turn-on-turn-off-firewall-in-linux/
¹q¸£ÂO¶°«Ø¸mªº°Ñ¦Ò¸ê®Æ
³¾ôªº Linux ¨p©Ðµæ¡G²©ö Cluster ¬[³]
http://linux.vbird.org/linux_server/0600cluster.php