============================================================================================= simplescalar: sslittle-na-sstrix-gcc -o mm mm.c sim-outorder mm sim-cache mm ============================================================================================= Pthread: gcc pt.c -o pt -lpthread // $gcc -pthread pt.c -o pt ./pt ============================================================================================= Cilk: cilkclocal -DHAVE_CONFIG_H -I. -I.. -I../runtime -g -O2 -c -o fft.o fft.cilk cilkclocal -g -O2 -o fft fft.o getoptions.o -lm fft -nproc 4 //run for 4 thread ============================================================================================= StreamIt: strc MatrixMult.str --cluster 4 //compile for 4 thread ./a.out dot -Tps before-partition.dot BF.ps dot -Tps after-partition.dot AF.ps ============================================================================================= Valgrind: gcc -g mm.c -o mm valgrind --tool=cachegrind mm cg-annotate cachegrind.out.6405 mm.c ============================================================================================= OpenMP: gcc -fopenmp hello.c -o hello setenv OMP_NUM_THREADS 4 ./hello ============================================================================================= MPI on a Single Machine: lamboot mpicc mm.cc -o mm setenv MP_PROCS 4 // ./mm ./mm -proc 4 ============================================================================================= MPI on a Cluster of Machines: 1. Installation: Please do a step given below in all the machine: yum install lam* yum install openmp yum install ypserv* (only at NFS & NIS server) 2. Make sure all the file system are same in both the machine: Replicate file using mount: Enable NFS & NIS : make NFS and NIS cluster : make one system as server as a root add this line to /etc/exportfs /home/usr machine2(ro,no_root_squash,async) root@machine1#service nfs start root@machine2#mount machine1:/home/usr /home/usr use NIS login, instead of individual login to machine on clients: System->Adminstration->Authendication Enable NIS login: Give domain & IP Server 3. Autologin setup: user@machine1$ ssh-keygen -t rsa user@machine1$ ssh user@machine2 mkdir -p .ssh user@machine1$ cat .ssh/id_rsa.pub | ssh user@machine2 'cat >> .ssh/authorized_keys' you should be able login and execute without password: user@machine1$ rsh machine2 uptime 4. Set PATH, ALIAS and LD_LIBRARY_PATH add line to ~/.bashhrc of usr export PATH=$PATH:/usr/lib/lam/bin export LD_LABRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/lam/lib export LAMRSH=ssh 5: adding host to MPI cluster on server /etc/lam-bhost.def localhost ganga kaveri 10.20.3.17 6. login to server machine: $lamboot -v //it should start lamboot on all other server sucessfully 7. Compiling and running MPI program mpiCC /home/usr/test.cc mpirun -np 4 /home/usr/a.out ============================================================================================= Gprof: gcc -p bt.c -o bt ./bt gprof ./bt >& profile ============================================================================================= Gcov: gcc -fprofile-arcs -ftest-coverage mm.c -o mm ./mm gcov mm.c ============================================================================================= latex: latex D.tex bibtex D.bib latex D.tex dvips D.dvi -o D.ps ps2pdf14 -dPDFSETTINGS=/prepress -dOptimize=true -dEmbedAllFonts=true D.ps pdffonts D.pdf =============================================================================================