!!MPICHからmpirunの使い方 !最初にする事 *ユーザの登録 [root@cluster ~]# useradd ユーザの名前 [root@cluster ~]# rocks sync users Enter passphrase for key '/root/.ssh/id_rsa': Enter passphrase for key '/root/.ssh/id_rsa': make: Entering directory `/var/411' rm -rf /etc/411.d/* make make[1]: Entering directory `/var/411' /opt/rocks/sbin/411put --comment="#" /etc/auto.home 411 Wrote: /etc/411.d/etc.auto..home Size: 470/174 bytes (encrypted/plain) Alert: sent on channel 255.255.255.255:8649 with master 10.1.1.1 /opt/rocks/sbin/411put --comment="#" /etc/auto.master 411 Wrote: /etc/411.d/etc.auto..master Size: 417/134 bytes (encrypted/plain) Alert: sent on channel 255.255.255.255:8649 with master 10.1.1.1 /opt/rocks/sbin/411put --comment="#" /etc/auto.misc 411 Wrote: /etc/411.d/etc.auto..misc Size: 1098/637 bytes (encrypted/plain) Alert: sent on channel 255.255.255.255:8649 with master 10.1.1.1 /opt/rocks/sbin/411put --comment="#" /etc/auto.net 411 Wrote: /etc/411.d/etc.auto..net Size: 2103/1382 bytes (encrypted/plain) Alert: sent on channel 255.255.255.255:8649 with master 10.1.1.1 /opt/rocks/sbin/411put --comment="#" /etc/auto.share 411 Wrote: /etc/411.d/etc.auto..share Size: 437/145 bytes (encrypted/plain) Alert: sent on channel 255.255.255.255:8649 with master 10.1.1.1 /opt/rocks/sbin/411put --comment="#" /etc/passwd 411 Wrote: /etc/411.d/etc.passwd Size: 3031/2069 bytes (encrypted/plain) Alert: sent on channel 255.255.255.255:8649 with master 10.1.1.1 /opt/rocks/sbin/411put --comment="#" /etc/shadow 411 Wrote: /etc/411.d/etc.shadow Size: 1949/1265 bytes (encrypted/plain) Alert: sent on channel 255.255.255.255:8649 with master 10.1.1.1 /opt/rocks/sbin/411put --comment="#" /etc/group 411 Wrote: /etc/411.d/etc.group Size: 1300/785 bytes (encrypted/plain) Alert: sent on channel 255.255.255.255:8649 with master 10.1.1.1 /opt/rocks/sbin/411put --comment="#" /etc/services 411 Wrote: /etc/411.d/etc.services Size: 28113/20638 bytes (encrypted/plain) Alert: sent on channel 255.255.255.255:8649 with master 10.1.1.1 /opt/rocks/sbin/411put --comment="#" /etc/rpc 411 Wrote: /etc/411.d/etc.rpc Size: 2492/1665 bytes (encrypted/plain) Alert: sent on channel 255.255.255.255:8649 with master 10.1.1.1 make[1]: Leaving directory `/var/411' make: Leaving directory `/var/411' ### compute-0-1(stat: 0, dur(s): 6.8): Warning: Permanently added 'compute-0-1' (RSA) to the list of known hosts. Checking for changes to /etc/auto.master .... Reload map /usr/sbin/automount --timeout=1200 /share file /etc/auto.share Reload map /usr/sbin/automount --timeout=1200 /home file /etc/auto.home ### compute-0-0(stat: 0, dur(s): 107.74): Checking for changes to /etc/auto.master .... Reload map /usr/sbin/automount --timeout=1200 /share file /etc/auto.share Reload map /usr/sbin/automount --timeout=1200 /home file /etc/auto.home [root@cluster ~]# *以上のコマンドにより,ユーザのホームディレクトリとNFSが設定される。 [root@cluster etc]# less auto.home install cluster.local:/export/home/& condor cluster.local:/export/home/condor username cluster.local:/export/home/username [root@cluster etc]# less auto.master /share /etc/auto.share --timeout=1200 /home /etc/auto.home --timeout=1200 !MPICHのサンプルプログラム *まず,サンプルプログラムをコンパイルする。 [root@cluster ~]# cd /opt/ [root@cluster opt]# cd mpich/ [root@cluster mpich]# ls gnu [root@cluster mpich]# cd gnu [root@cluster gnu]# ls bin doc etc examples include lib logfiles man sbin share www [root@cluster gnu]# cd examples/ [root@cluster examples]# ls cpi.c cpip.c Makefile MPI-2-C++ pi3.f README cpilog.c hello++.cc Makefile.in mpirun pi3p.f simpleio.c [root@cluster examples]# ../bin/mpireconfig Makefile creating Makefile [root@cluster examples]# make /opt/mpich/gnu/bin/mpicc -c cpi.c /opt/mpich/gnu/bin/mpicc -o cpi cpi.o -lm /opt/mpich/gnu/bin/mpif77 -c pi3.f /opt/mpich/gnu/bin/mpif77 -o pi3 pi3.o /opt/mpich/gnu/bin/mpicc -c cpip.c /opt/mpich/gnu/bin/mpicc -o cpip cpip.o -lm /opt/mpich/gnu/bin/mpif77 -c pi3p.f /opt/mpich/gnu/bin/mpif77 -o pi3p pi3p.o [root@cluster examples]# *サンプルプログラムを使う。 [root@cluster examples]# ../bin/mpirun -np 1 cpi Process 0 on cluster.keiaiemu.net pi is approximately 3.1416009869231254, Error is 0.0000083333333323 wall clock time = 0.001109 [root@cluster examples]# !!MPIの入門編 !リンク *MPIの考え方(初歩) **http://geant4.kek.jp/~iwai/wiki/?MPI *インストール **http://lab.twcu.ac.jp/ogita/math/mpi1.htm **簡単に書かれているので,重宝する。 **http://www.sfk-nga.co.jp/HPC/document/ex01.html *MPICH:PCクラスタ(およびLinux)の初心者向きに8CPUのOpteronで構成したクラスタで基本操作とMPICHの実行方法を解説した動画。 **http://zoome.jp/hoehoe2nd/diary/2/