被平行化的標准程式庫。無論如何要將可攜性和效能之間的平衡牢記心中。 從歷史上的理由,大多數數值計算的程式是用Fortran語言所寫的,因此在平行計算中,Fortran是受最大的支援(工具、程式庫等)。現在大多數的程式設計者都是用C語言,或是認為C語言可以執行地更快,而用C語言重新改寫現存的Fortran應用程式。由於C語言最接近通用的機器語言,C語言較快可能是正確的,但是它也有一些重要的缺陷。C語言使用指標(pointer)會讓資料相關性的決定極度困難,自動分析指標也是極度困難,假如□有現成的Fortran程式,並且未來想要變成平行程式□千萬不要把它轉成C語言。 隱含的方法 隱含方法是使用者放棄一些或全部放棄自行平行,改用編譯器的一種方法,例如 FORTRAN 90, 高效能Frotran (High Performance Fortran,HPF), 大量協同平行(Bulk Synchronous Parallel,BSP)還有許多正在發展當中。 隱含方法仍要求使用者對於程式同時的特性提供一些資訊,但是編譯器必須對如何平行地執行同時性做出許多決定,這些方法提供某種程度的可攜性和效能,但是對一個平行編譯器,仍然沒有一個最好的方法來描述同時性的問題。 -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- 5. Beowulf資源 5.1 起點 Beowulf mailing list. 只要電子郵件寄到
[email protected] ,在郵件內容填上 subscribe 。 Beowulf 網頁 http://www.beowulf.org Extreme Linux http://www.extremelinux.org 在RedHat網站上的Extreme Linux 軟體 http://www.redhat.com/extreme 5.2 文件 Beowulf HOWTO最新版本 http://www.sci.usq.edu.au/staff/jacek/beowulf. 架設一個Beowulf系統 http://www.cacr.caltech.edu/beowulf/tutorial/building.Html Jacek的 Beowulf 連結 http://www.sci.usq.edu.au/staff/jacek/beowulf. Beowulf安裝維護HOWTO http://www.sci.usq.edu.au/staff/jacek/beowulf. Linux平行計算HOWTO http://yara.ecn.purdue.edu/~pplinux/PPHOWTO/pphowto.html 5.3 相關論文 Chance Reschke, Thomas Sterling, Daniel Ridge, Daniel Savarese, Donald Becker, and Phillip Merkey A Design Study of Alternative Network Topologies for the Beowulf Parallel Workstation. Proceedings Fifth IEEE International Symposium on High Performance Distributed Computing, 1996. http://www.beowulf.org/papers/HPDC96/hpdc96.html Daniel Ridge, Donald Becker, Phillip Merkey, Thomas Sterling Becker, and Phillip Merkey. Harnessing the Power of Parallelism in a Pile-of-PCs. Proceedings, IEEE Aerospace, 1997. http://www.beowulf.org/papers/AA97/aa97.ps Thomas Sterling, Donald J. Becker, Daniel Savarese, Michael R. Berry, and Chance Res. Achieving a Balanced Low-Cost Architecture for Mass Storage Management through Multiple Fast Ethernet Channels on the Beowulf Parallel Workstation. Proceedings, International Parallel Processing Symposium, 1996. http://www.beowulf.org/papers/IPPS96/ipps96.html Donald J. Becker, Thomas Sterling, Daniel Savarese, BrUCe Fryxell, Kevin Olson. Communication Overhead for Space Science Applications on the Beowulf Parallel Workstation. Proceedings,High Performance and Distributed Computing, 1995. http://www.beowulf.org/papers/HPDC95/hpdc95.html Donald J. Becker, Thomas Sterling, Daniel Savarese, John E. Dorband, Udaya A. Ranawak, Charles V. Packer. BEOWULF: A PARALLEL WORKSTATION FOR SCIENTIFIC COMPUTATION. Proceedings, International Conference on Parallel Processing, 95. http://www.beowulf.org/papers/ICPP95/icpp95.html Papers at the Beowulf site http://www.beowulf.org/papers/papers.html 5.4 軟體 PVM - Parallel Virtual Machine http://www.epm.ornl.gov/pvm/pvm_home.html LAM/MPI (Local Area Multicomputer / Message Passing Interface http://www.mpi.nd.edu/lam BERT77 - FORTRAN conversion tool http://www.plogic.com/bert.html Beowulf software from Beowulf Project Page http://beowulf.gsfc.nasa.gov/software/software.html Jacek's Beowulf-utils FTP://ftp.sci.usq.edu.au/pub/jacek/beowulf-utils bWatch - cluster monitoring tool http://www.sci.usq.edu.au/staff/jacek/bWatch 5.5 Beowulf機器 Avalon 是由 140台Alpha 處理器組成,36GB記憶體,可能是最快的Beowulf機器,計算速度高達47.7Gflops,在全世界前五百快的機器中排名第114。 http://swift.lanl.gov/avalon/ Megalon-A Massively PArallel CompuTer Resource (MPACTR)由14台個人電腦組成,每台電腦內有四顆Pentium Pro200處理器,總共有14GB記憶體 http://megalon.ca.sandia.gov/description.html HIVE - Highly-parallel Integrated Virtual Environment 是另一套高速的Beowulf超級電腦,有64個計算節點,共計128顆處理器,4GB記憶體。 http://newton.gsfc.nasa.gov/thehive/ Topcat 是一套比較小型的機器,總共有16顆處理器和1.2GB記憶體。 http://www.sci.usq.edu.au/staff/jacek/topcat MAGI cluster 是個有趣的網站,內有許多有趣的連結。 http://noel.feld.cvut.cz/magi/ 5.6 其他有趣的網站 SMP Linux http://www.linux.org.uk/SMP/title.html Paralogic - Buy a Beowulf http://www.plogic.com 5.7 歷史 Legends - Beowulf http://legends.dm.net/beowulf/index.html The Adventures of Beowulf http://www.lnstar.com/literature/beowulf/beowulf.html -------------------------------------------------------------------------------- 6. 原始碼 6.1 sum.c /* Jacek Radajewski
[email protected] */ /* 21/08/1998 */ #include #include int main (void) { double result = 0.0; double number = 0.0; char string[80]; while (scanf("%s", string) != EOF) { number = atof(string); result = result + number; } printf("%lf\n", result); return 0; } 6.2 sigmasqrt.c /* Jacek Radajewski
[email protected] */ /* 21/08/1998 */ #include #include int main (int argc, char** argv) { long number1, number2, counter; double result; if (argc < 3) { printf ("usage : %s number1 number2\n",argv[0]); exit(1); } else { number1 = atol (argv[1]); number2 = atol (argv[2]); result = 0.0; } for (counter = number1; counter <= number2; counter++) { result = result + sqrt((double)counter); } printf("%lf\n", result); return 0; } 6.3 prun.sh #!/bin/bash # Jacek Radajewski
[email protected] # 21/08/1998 eXPort SIGMASQRT=/home/staff/jacek/beowulf/HOWTO/example1/sigmasqrt # $OUTPUT must be a named pipe # mkfifo output export OUTPUT=/home/staff/jacek/beowulf/HOWTO/example1/output rsh scilab01 $SIGMASQRT 1 50000000 > $OUTPUT < /dev/null& rsh scilab02 $SIGMASQRT 50000001 100000000 > $OUTPUT < /dev/null& rsh scilab03 $SIGMASQRT 100000001 150000000 > $OUTPUT < /dev/null& rsh scilab04 $SIGMASQRT 150000001 200000000 > $OUTPUT < /dev/null& rsh scilab05 $SIGMASQRT 200000001 250000000 > $OUTPUT < /dev/null& rsh scilab06 $SIGMASQRT 250000001 300000000 > $OUTPUT < /dev/null& rsh scilab07 $SIGMASQRT 300000001 350000000 > $OUTPUT < /dev/null& rsh scilab08 $SIGMASQRT 350000001 400000000 > $OUTPUT < /dev/null& rsh scilab09 $SIGMASQRT 400000001 450000000 > $OUTPUT < /dev/null& rsh scilab10 $SIGMASQRT 450000001 500000000 > $OUTPUT < /dev/null& rsh scilab11 $SIGMASQRT 500000001 550000000 > $OUTPUT < /dev/null& rsh scilab12 $SIGMASQRT 550000001 600000000 > $OUTPUT < /dev/null& rsh scilab13 $SIGMASQRT 600000001 650000000 > $OUTPUT < /dev/null& rsh scilab14 $SIGMASQRT 650000001 700000000 > $OUTPUT < /dev/null& rsh scilab15 $SIGMASQRT 700000001 750000000 > $OUTPUT < /dev/null& rsh scilab16 $SIGMASQRT 750000001 800000000 > $OUTPUT < /dev/null& rsh scilab17 $SIGMASQRT 800000001 850000000 > $OUTPUT < /dev/null& rsh scilab18 $SIGMASQRT 850000001 900000000 > $OUTPUT < /dev/null& rsh scilab19 $SIGMASQRT 900000001 950000000 > $OUTPUT < /dev/null& rsh scilab20 $SIGMASQRT 950000001 1000000000 > $OUTPUT < /dev/null& --------------------------------------------------------------------------------